Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-12-10' into staging

Miscellaneous patches for 2020-12-10

# gpg: Signature made Thu 10 Dec 2020 16:17:43 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-misc-2020-12-10:
  docs/devel/writing-qmp-commands.txt: Fix docs
  qapi: Normalize version references x.y.0 to just x.y
  Tweak a few "Parameter 'NAME' expects THING" error message
  qom: Improve {qom,device}-list-properties error messages
  qga: Tweak a guest-shutdown error message
  qga: Replace an unreachable error by abort()
  ui: Tweak a client_migrate_info error message
  ui: Improve a client_migrate_info error message
  ui: Improve some set_passwd, expire_password error messages
  block: Improve some block-commit, block-stream error messages
  qerror: Eliminate QERR_ macros used in just one place
  qerror: Drop unused QERR_ macros
  Clean up includes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell
2020-12-10 17:01:05 +00:00
55 changed files with 180 additions and 287 deletions
+1 -1
View File
@@ -856,7 +856,7 @@ static int quorum_valid_threshold(int threshold, int num_children, Error **errp)
if (threshold < 1) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
"vote-threshold", "value >= 1");
"vote-threshold", "a value >= 1");
return -ERANGE;
}
+10 -7
View File
@@ -2531,7 +2531,7 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
if (has_base) {
base_bs = bdrv_find_backing_image(bs, base);
if (base_bs == NULL) {
error_setg(errp, QERR_BASE_NOT_FOUND, base);
error_setg(errp, "Can't find '%s' in the backing chain", base);
goto out;
}
assert(bdrv_get_aio_context(base_bs) == aio_context);
@@ -2703,13 +2703,16 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
}
} else if (has_base && base) {
base_bs = bdrv_find_backing_image(top_bs, base);
if (base_bs == NULL) {
error_setg(errp, "Can't find '%s' in the backing chain", base);
goto out;
}
} else {
base_bs = bdrv_find_base(top_bs);
}
if (base_bs == NULL) {
error_setg(errp, QERR_BASE_NOT_FOUND, base ? base : "NULL");
goto out;
if (base_bs == NULL) {
error_setg(errp, "There is no backimg image");
goto out;
}
}
assert(bdrv_get_aio_context(base_bs) == aio_context);
@@ -2988,7 +2991,7 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
}
if (granularity & (granularity - 1)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "granularity",
"power of 2");
"a power of 2");
return;
}
+1 -1
View File
@@ -521,7 +521,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
if (object_class_is_abstract(oc)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
"abstract device type");
"an abstract device type");
return NULL;
}
+1
View File
@@ -12,6 +12,7 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
#include <virglrenderer.h>
#include "virgl.h"
+1
View File
@@ -7,6 +7,7 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
#include "vugbm.h"
static bool
-2
View File
@@ -10,10 +10,8 @@
#ifndef VHOST_USER_GPU_VUGBM_H
#define VHOST_USER_GPU_VUGBM_H
#include "qemu/osdep.h"
#ifdef CONFIG_MEMFD
#include <sys/mman.h>
#include <sys/ioctl.h>
#endif
-1
View File
@@ -15,7 +15,6 @@
#ifndef VUGPU_H
#define VUGPU_H
#include "qemu/osdep.h"
#include "libvhost-user-glib.h"
#include "standard-headers/linux/virtio_gpu.h"
-1
View File
@@ -6,7 +6,6 @@
#include "qemu/osdep.h"
#include <glib.h>
#include <linux/input.h>
#include "qemu/iov.h"
+1 -1
View File
@@ -243,7 +243,7 @@ There are many examples of such documentation in the schema file already, but
here goes "hello-world"'s new entry for qapi/misc.json:
##
# @hello-world
# @hello-world:
#
# Print a client provided string to the standard output stream.
#
+1 -1
View File
@@ -776,7 +776,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
}
if (value < -1 || value > 255) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
name ? name : "null", "pci_devfn");
name ? name : "null", "a value between -1 and 255");
return;
}
*ptr = value;
-1
View File
@@ -9,7 +9,6 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/typedefs.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "qemu/units.h"
+2 -1
View File
@@ -9,11 +9,12 @@
* directory.
*/
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <linux/vfio.h>
#include <linux/vfio_zdev.h>
#include "qemu/osdep.h"
#include "trace.h"
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/s390-pci-clp.h"
-1
View File
@@ -11,7 +11,6 @@
#ifndef SWIM_H
#define SWIM_H
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "qom/object.h"
-1
View File
@@ -13,7 +13,6 @@
#ifndef MACFB_H
#define MACFB_H
#include "qemu/osdep.h"
#include "exec/memory.h"
#include "ui/console.h"
#include "qom/object.h"
-23
View File
@@ -16,8 +16,6 @@
* These macros will go away, please don't use in new code, and do not
* add new ones!
*/
#define QERR_BASE_NOT_FOUND \
"Base '%s' not found"
#define QERR_BUS_NO_HOTPLUG \
"Bus '%s' does not support hotplugging"
@@ -25,27 +23,15 @@
#define QERR_DEVICE_HAS_NO_MEDIUM \
"Device '%s' has no medium"
#define QERR_DEVICE_INIT_FAILED \
"Device '%s' could not be initialized"
#define QERR_DEVICE_IN_USE \
"Device '%s' is in use"
#define QERR_DEVICE_NO_HOTPLUG \
"Device '%s' does not support hotplugging"
#define QERR_FD_NOT_FOUND \
"File descriptor named '%s' not found"
#define QERR_FD_NOT_SUPPLIED \
"No file descriptor supplied via SCM_RIGHTS"
#define QERR_FEATURE_DISABLED \
"The feature '%s' is not enabled"
#define QERR_INVALID_BLOCK_FORMAT \
"Invalid block format '%s'"
#define QERR_INVALID_PARAMETER \
"Invalid parameter '%s'"
@@ -55,9 +41,6 @@
#define QERR_INVALID_PARAMETER_VALUE \
"Parameter '%s' expects %s"
#define QERR_INVALID_PASSWORD \
"Password incorrect"
#define QERR_IO_ERROR \
"An IO error has occurred"
@@ -82,12 +65,6 @@
#define QERR_REPLAY_NOT_SUPPORTED \
"Record/replay feature is not supported for '%s'"
#define QERR_SET_PASSWD_FAILED \
"Could not set password"
#define QERR_UNDEFINED_ERROR \
"An undefined error has occurred"
#define QERR_UNSUPPORTED \
"this feature or command is not currently supported"
-1
View File
@@ -1,7 +1,6 @@
#ifndef NVDIMM_UTILS_H
#define NVDIMM_UTILS_H
#include "qemu/osdep.h"
GSList *nvdimm_get_device_list(void);
#endif
+6 -6
View File
@@ -441,13 +441,13 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname,
has_port ? port : -1,
has_tls_port ? tls_port : -1,
cert_subject)) {
error_setg(errp, QERR_UNDEFINED_ERROR);
error_setg(errp, "Could not set up display for migration");
return;
}
return;
}
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "spice");
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'");
}
static void hmp_logfile(Monitor *mon, const QDict *qdict)
@@ -1232,7 +1232,7 @@ void qmp_getfd(const char *fdname, Error **errp)
fd = qemu_chr_fe_get_msgfd(&cur_mon->chr);
if (fd == -1) {
error_setg(errp, QERR_FD_NOT_SUPPLIED);
error_setg(errp, "No file descriptor supplied via SCM_RIGHTS");
return;
}
@@ -1286,7 +1286,7 @@ void qmp_closefd(const char *fdname, Error **errp)
}
qemu_mutex_unlock(&cur_mon->mon_lock);
error_setg(errp, QERR_FD_NOT_FOUND, fdname);
error_setg(errp, "File descriptor named '%s' not found", fdname);
}
int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp)
@@ -1357,7 +1357,7 @@ AddfdInfo *qmp_add_fd(bool has_fdset_id, int64_t fdset_id, bool has_opaque,
fd = qemu_chr_fe_get_msgfd(&mon->chr);
if (fd == -1) {
error_setg(errp, QERR_FD_NOT_SUPPLIED);
error_setg(errp, "No file descriptor supplied via SCM_RIGHTS");
goto error;
}
@@ -1410,7 +1410,7 @@ error:
} else {
snprintf(fd_str, sizeof(fd_str), "fdset-id:%" PRId64, fdset_id);
}
error_setg(errp, QERR_FD_NOT_FOUND, fd_str);
error_setg(errp, "File descriptor named '%s' not found", fd_str);
}
FdsetInfoList *qmp_query_fdsets(Error **errp)
+15 -23
View File
@@ -199,13 +199,7 @@ void qmp_set_password(const char *protocol, const char *password,
}
rc = qemu_spice.set_passwd(password, fail_if_connected,
disconnect_if_connected);
if (rc != 0) {
error_setg(errp, QERR_SET_PASSWD_FAILED);
}
return;
}
if (strcmp(protocol, "vnc") == 0) {
} else if (strcmp(protocol, "vnc") == 0) {
if (fail_if_connected || disconnect_if_connected) {
/* vnc supports "connected=keep" only */
error_setg(errp, QERR_INVALID_PARAMETER, "connected");
@@ -214,13 +208,15 @@ void qmp_set_password(const char *protocol, const char *password,
/* Note that setting an empty password will not disable login through
* this interface. */
rc = vnc_display_password(NULL, password);
if (rc < 0) {
error_setg(errp, QERR_SET_PASSWD_FAILED);
}
} else {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol",
"'vnc' or 'spice'");
return;
}
error_setg(errp, QERR_INVALID_PARAMETER, "protocol");
if (rc != 0) {
error_setg(errp, "Could not set password");
}
}
void qmp_expire_password(const char *protocol, const char *whenstr,
@@ -244,28 +240,24 @@ void qmp_expire_password(const char *protocol, const char *whenstr,
return;
}
rc = qemu_spice.set_pw_expire(when);
if (rc != 0) {
error_setg(errp, QERR_SET_PASSWD_FAILED);
}
return;
}
if (strcmp(protocol, "vnc") == 0) {
} else if (strcmp(protocol, "vnc") == 0) {
rc = vnc_display_pw_expire(NULL, when);
if (rc != 0) {
error_setg(errp, QERR_SET_PASSWD_FAILED);
}
} else {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol",
"'vnc' or 'spice'");
return;
}
error_setg(errp, QERR_INVALID_PARAMETER, "protocol");
if (rc != 0) {
error_setg(errp, "Could not set password expire time");
}
}
#ifdef CONFIG_VNC
void qmp_change_vnc_password(const char *password, Error **errp)
{
if (vnc_display_password(NULL, password) < 0) {
error_setg(errp, QERR_SET_PASSWD_FAILED);
error_setg(errp, "Could not set password");
}
}
+1 -1
View File
@@ -1013,7 +1013,7 @@ static int net_client_init1(const Netdev *netdev, bool is_netdev, Error **errp)
if (net_client_init_fun[netdev->type](netdev, netdev->id, peer, errp) < 0) {
/* FIXME drop when all init functions store an Error */
if (errp && !*errp) {
error_setg(errp, QERR_DEVICE_INIT_FAILED,
error_setg(errp, "Device '%s' could not be initialized",
NetClientDriver_str(netdev->type));
}
return -1;
+14 -14
View File
@@ -302,7 +302,7 @@
# @ro: true if the backing device was open read-only
#
# @drv: the name of the block format used to open the backing device. As of
# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
# 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
# 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
# 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
@@ -389,7 +389,7 @@
# @deprecated: Member @encryption_key_missing is deprecated. It is
# always false.
#
# Since: 0.14.0
# Since: 0.14
#
##
{ 'struct': 'BlockDeviceInfo',
@@ -607,7 +607,7 @@
# @deprecated: Member @dirty-bitmaps is deprecated. Use @inserted
# member @dirty-bitmaps instead.
#
# Since: 0.14.0
# Since: 0.14
##
{ 'struct': 'BlockInfo',
'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
@@ -655,7 +655,7 @@
# Returns: a list of @BlockInfo describing each virtual block device. Filter
# nodes that were created implicitly are skipped over.
#
# Since: 0.14.0
# Since: 0.14
#
# Example:
#
@@ -812,17 +812,17 @@
# @wr_operations: The number of write operations performed by the device.
#
# @flush_operations: The number of cache flush operations performed by the
# device (since 0.15.0)
# device (since 0.15)
#
# @unmap_operations: The number of unmap operations performed by the device
# (Since 4.2)
#
# @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.0).
# @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
#
# @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15.0).
# @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
#
# @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
# (since 0.15.0).
# (since 0.15).
#
# @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
# (Since 4.2)
@@ -884,7 +884,7 @@
#
# @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
#
# Since: 0.14.0
# Since: 0.14
##
{ 'struct': 'BlockDeviceStats',
'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
@@ -987,7 +987,7 @@
# @backing: This describes the backing block device if it has one.
# (Since 2.0)
#
# Since: 0.14.0
# Since: 0.14
##
{ 'struct': 'BlockStats',
'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
@@ -1011,7 +1011,7 @@
#
# Returns: A list of @BlockStats for each virtual block devices.
#
# Since: 0.14.0
# Since: 0.14
#
# Example:
#
@@ -1299,7 +1299,7 @@
# Returns: - nothing on success
# - If @device is not a valid block device, DeviceNotFound
#
# Since: 0.14.0
# Since: 0.14
#
# Example:
#
@@ -1484,7 +1484,7 @@
# Returns: - nothing on success
# - If @device is not a valid block device, DeviceNotFound
#
# Since: 0.14.0
# Since: 0.14
#
# Example:
#
@@ -4852,7 +4852,7 @@
# Note: If action is "stop", a STOP event will eventually follow the
# BLOCK_IO_ERROR event
#
# Since: 0.13.0
# Since: 0.13
#
# Example:
#

Some files were not shown because too many files have changed in this diff Show More