summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:54 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:32:24 -0600
commitfb605a566d55aa8b2b920cf2b667888ed442bf05 (patch)
treebef5acd7d7728043cce77231477edf3279594749 /hw
parent0581a76b5cb6beebf085378d5c051bc985c185da (diff)
downloadhqemu-fb605a566d55aa8b2b920cf2b667888ed442bf05.zip
hqemu-fb605a566d55aa8b2b920cf2b667888ed442bf05.tar.gz
qapi: Swap visit_* arguments for consistent 'name' placement
JSON uses "name":value, but many of our visitor interfaces were called with visit_type_FOO(v, &value, name, errp). This can be a bit confusing to have to mentally swap the parameter order to match JSON order. It's particularly bad for visit_start_struct(), where the 'name' parameter is smack in the middle of the otherwise-related group of 'obj, kind, size' parameters! It's time to do a global swap of the parameter ordering, so that the 'name' parameter is always immediately after the Visitor argument. Additional reason in favor of the swap: the existing include/qjson.h prefers listing 'name' first in json_prop_*(), and I have plans to unify that file with the qapi visitors; listing 'name' first in qapi will minimize churn to the (admittedly few) qjson.h clients. Later patches will then fix docs, object.h, visitor-impl.h, and those clients to match. Done by first patching scripts/qapi*.py by hand to make generated files do what I want, then by running the following Coccinelle script to affect the rest of the code base: $ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'` I then had to apply some touchups (Coccinelle insisted on TAB indentation in visitor.h, and botched the signature of visit_type_enum() by rewriting 'const char *const strings[]' to the syntactically invalid 'const char*const[] strings'). The movement of parameters is sufficient to provoke compiler errors if any callers were missed. // Part 1: Swap declaration order @@ type TV, TErr, TObj, T1, T2; identifier OBJ, ARG1, ARG2; @@ void visit_start_struct -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp) +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp) { ... } @@ type bool, TV, T1; identifier ARG1; @@ bool visit_optional -(TV v, T1 ARG1, const char *name) +(TV v, const char *name, T1 ARG1) { ... } @@ type TV, TErr, TObj, T1; identifier OBJ, ARG1; @@ void visit_get_next_type -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp) +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp) { ... } @@ type TV, TErr, TObj, T1, T2; identifier OBJ, ARG1, ARG2; @@ void visit_type_enum -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp) +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp) { ... } @@ type TV, TErr, TObj; identifier OBJ; identifier VISIT_TYPE =~ "^visit_type_"; @@ void VISIT_TYPE -(TV v, TObj OBJ, const char *name, TErr errp) +(TV v, const char *name, TObj OBJ, TErr errp) { ... } // Part 2: swap caller order @@ expression V, NAME, OBJ, ARG1, ARG2, ERR; identifier VISIT_TYPE =~ "^visit_type_"; @@ ( -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR) +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR) | -visit_optional(V, ARG1, NAME) +visit_optional(V, NAME, ARG1) | -visit_get_next_type(V, OBJ, ARG1, NAME, ERR) +visit_get_next_type(V, NAME, OBJ, ARG1, ERR) | -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR) +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR) | -VISIT_TYPE(V, OBJ, NAME, ERR) +VISIT_TYPE(V, NAME, OBJ, ERR) ) Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/acpi/core.c4
-rw-r--r--hw/acpi/ich9.c14
-rw-r--r--hw/core/machine.c10
-rw-r--r--hw/core/qdev-properties-system.c12
-rw-r--r--hw/core/qdev-properties.c66
-rw-r--r--hw/core/qdev.c2
-rw-r--r--hw/i386/pc.c14
-rw-r--r--hw/ide/qdev.c4
-rw-r--r--hw/intc/xics.c8
-rw-r--r--hw/isa/lpc_ich9.c2
-rw-r--r--hw/mem/pc-dimm.c2
-rw-r--r--hw/misc/edu.c2
-rw-r--r--hw/misc/tmp105.c4
-rw-r--r--hw/net/ne2000-isa.c4
-rw-r--r--hw/pci-host/piix.c8
-rw-r--r--hw/pci-host/q35.c10
-rw-r--r--hw/ppc/spapr_drc.c12
-rw-r--r--hw/usb/dev-storage.c4
-rw-r--r--hw/virtio/virtio-balloon.c12
19 files changed, 97 insertions, 97 deletions
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index edf3f96..3a14e90 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -243,7 +243,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
OptsVisitor *ov;
ov = opts_visitor_new(opts);
- visit_type_AcpiTableOptions(opts_get_visitor(ov), &hdrs, NULL, &err);
+ visit_type_AcpiTableOptions(opts_get_visitor(ov), NULL, &hdrs, &err);
opts_visitor_cleanup(ov);
}
@@ -302,7 +302,7 @@ out:
QapiDeallocVisitor *dv;
dv = qapi_dealloc_visitor_new();
- visit_type_AcpiTableOptions(qapi_dealloc_get_visitor(dv), &hdrs, NULL,
+ visit_type_AcpiTableOptions(qapi_dealloc_get_visitor(dv), NULL, &hdrs,
NULL);
qapi_dealloc_visitor_cleanup(dv);
}
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 746d890..c3b6035 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -290,7 +290,7 @@ static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v,
ICH9LPCPMRegs *pm = opaque;
uint32_t value = pm->pm_io_base + ICH9_PMIO_GPE0_STS;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static bool ich9_pm_get_memory_hotplug_support(Object *obj, Error **errp)
@@ -315,7 +315,7 @@ static void ich9_pm_get_disable_s3(Object *obj, Visitor *v,
ICH9LPCPMRegs *pm = opaque;
uint8_t value = pm->disable_s3;
- visit_type_uint8(v, &value, name, errp);
+ visit_type_uint8(v, name, &value, errp);
}
static void ich9_pm_set_disable_s3(Object *obj, Visitor *v,
@@ -326,7 +326,7 @@ static void ich9_pm_set_disable_s3(Object *obj, Visitor *v,
Error *local_err = NULL;
uint8_t value;
- visit_type_uint8(v, &value, name, &local_err);
+ visit_type_uint8(v, name, &value, &local_err);
if (local_err) {
goto out;
}
@@ -342,7 +342,7 @@ static void ich9_pm_get_disable_s4(Object *obj, Visitor *v,
ICH9LPCPMRegs *pm = opaque;
uint8_t value = pm->disable_s4;
- visit_type_uint8(v, &value, name, errp);
+ visit_type_uint8(v, name, &value, errp);
}
static void ich9_pm_set_disable_s4(Object *obj, Visitor *v,
@@ -353,7 +353,7 @@ static void ich9_pm_set_disable_s4(Object *obj, Visitor *v,
Error *local_err = NULL;
uint8_t value;
- visit_type_uint8(v, &value, name, &local_err);
+ visit_type_uint8(v, name, &value, &local_err);
if (local_err) {
goto out;
}
@@ -369,7 +369,7 @@ static void ich9_pm_get_s4_val(Object *obj, Visitor *v,
ICH9LPCPMRegs *pm = opaque;
uint8_t value = pm->s4_val;
- visit_type_uint8(v, &value, name, errp);
+ visit_type_uint8(v, name, &value, errp);
}
static void ich9_pm_set_s4_val(Object *obj, Visitor *v,
@@ -380,7 +380,7 @@ static void ich9_pm_set_s4_val(Object *obj, Visitor *v,
Error *local_err = NULL;
uint8_t value;
- visit_type_uint8(v, &value, name, &local_err);
+ visit_type_uint8(v, name, &value, &local_err);
if (local_err) {
goto out;
}
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 1261368..03d9a95 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -41,7 +41,7 @@ static void machine_set_kernel_irqchip(Object *obj, Visitor *v,
MachineState *ms = MACHINE(obj);
OnOffSplit mode;
- visit_type_OnOffSplit(v, &mode, name, &err);
+ visit_type_OnOffSplit(v, name, &mode, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -75,7 +75,7 @@ static void machine_get_kvm_shadow_mem(Object *obj, Visitor *v,
MachineState *ms = MACHINE(obj);
int64_t value = ms->kvm_shadow_mem;
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v,
@@ -86,7 +86,7 @@ static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v,
Error *error = NULL;
int64_t value;
- visit_type_int(v, &value, name, &error);
+ visit_type_int(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
@@ -177,7 +177,7 @@ static void machine_get_phandle_start(Object *obj, Visitor *v,
MachineState *ms = MACHINE(obj);
int64_t value = ms->phandle_start;
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void machine_set_phandle_start(Object *obj, Visitor *v,
@@ -188,7 +188,7 @@ static void machine_set_phandle_start(Object *obj, Visitor *v,
Error *error = NULL;
int64_t value;
- visit_type_int(v, &value, name, &error);
+ visit_type_int(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index ff00f5c..acbe403 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -31,7 +31,7 @@ static void get_pointer(Object *obj, Visitor *v, Property *prop,
char *p;
p = *ptr ? print(*ptr) : g_strdup("");
- visit_type_str(v, &p, name, errp);
+ visit_type_str(v, name, &p, errp);
g_free(p);
}
@@ -51,7 +51,7 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -202,7 +202,7 @@ static void get_netdev(Object *obj, Visitor *v, void *opaque,
NICPeers *peers_ptr = qdev_get_prop_ptr(dev, prop);
char *p = g_strdup(peers_ptr->ncs[0] ? peers_ptr->ncs[0]->name : "");
- visit_type_str(v, &p, name, errp);
+ visit_type_str(v, name, &p, errp);
g_free(p);
}
@@ -223,7 +223,7 @@ static void set_netdev(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -308,7 +308,7 @@ static void get_vlan(Object *obj, Visitor *v, void *opaque,
}
}
- visit_type_int32(v, &id, name, errp);
+ visit_type_int32(v, name, &id, errp);
}
static void set_vlan(Object *obj, Visitor *v, void *opaque,
@@ -327,7 +327,7 @@ static void set_vlan(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_int32(v, &id, name, &local_err);
+ visit_type_int32(v, name, &id, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index e878e80..77f3542 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -49,8 +49,8 @@ static void get_enum(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
int *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_enum(v, ptr, prop->info->enum_table,
- prop->info->name, prop->name, errp);
+ visit_type_enum(v, prop->name, ptr, prop->info->enum_table,
+ prop->info->name, errp);
}
static void set_enum(Object *obj, Visitor *v, void *opaque,
@@ -65,8 +65,8 @@ static void set_enum(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_enum(v, ptr, prop->info->enum_table,
- prop->info->name, prop->name, errp);
+ visit_type_enum(v, prop->name, ptr, prop->info->enum_table,
+ prop->info->name, errp);
}
/* Bit */
@@ -96,7 +96,7 @@ static void prop_get_bit(Object *obj, Visitor *v, void *opaque,
uint32_t *p = qdev_get_prop_ptr(dev, prop);
bool value = (*p & qdev_get_prop_mask(prop)) != 0;
- visit_type_bool(v, &value, name, errp);
+ visit_type_bool(v, name, &value, errp);
}
static void prop_set_bit(Object *obj, Visitor *v, void *opaque,
@@ -112,7 +112,7 @@ static void prop_set_bit(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_bool(v, &value, name, &local_err);
+ visit_type_bool(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -154,7 +154,7 @@ static void prop_get_bit64(Object *obj, Visitor *v, void *opaque,
uint64_t *p = qdev_get_prop_ptr(dev, prop);
bool value = (*p & qdev_get_prop_mask64(prop)) != 0;
- visit_type_bool(v, &value, name, errp);
+ visit_type_bool(v, name, &value, errp);
}
static void prop_set_bit64(Object *obj, Visitor *v, void *opaque,
@@ -170,7 +170,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_bool(v, &value, name, &local_err);
+ visit_type_bool(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -194,7 +194,7 @@ static void get_bool(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
bool *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_bool(v, ptr, name, errp);
+ visit_type_bool(v, name, ptr, errp);
}
static void set_bool(Object *obj, Visitor *v, void *opaque,
@@ -209,7 +209,7 @@ static void set_bool(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_bool(v, ptr, name, errp);
+ visit_type_bool(v, name, ptr, errp);
}
PropertyInfo qdev_prop_bool = {
@@ -227,7 +227,7 @@ static void get_uint8(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint8_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_uint8(v, ptr, name, errp);
+ visit_type_uint8(v, name, ptr, errp);
}
static void set_uint8(Object *obj, Visitor *v, void *opaque,
@@ -242,7 +242,7 @@ static void set_uint8(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_uint8(v, ptr, name, errp);
+ visit_type_uint8(v, name, ptr, errp);
}
PropertyInfo qdev_prop_uint8 = {
@@ -260,7 +260,7 @@ static void get_uint16(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint16_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_uint16(v, ptr, name, errp);
+ visit_type_uint16(v, name, ptr, errp);
}
static void set_uint16(Object *obj, Visitor *v, void *opaque,
@@ -275,7 +275,7 @@ static void set_uint16(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_uint16(v, ptr, name, errp);
+ visit_type_uint16(v, name, ptr, errp);
}
PropertyInfo qdev_prop_uint16 = {
@@ -293,7 +293,7 @@ static void get_uint32(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_uint32(v, ptr, name, errp);
+ visit_type_uint32(v, name, ptr, errp);
}
static void set_uint32(Object *obj, Visitor *v, void *opaque,
@@ -308,7 +308,7 @@ static void set_uint32(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_uint32(v, ptr, name, errp);
+ visit_type_uint32(v, name, ptr, errp);
}
static void get_int32(Object *obj, Visitor *v, void *opaque,
@@ -318,7 +318,7 @@ static void get_int32(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
int32_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_int32(v, ptr, name, errp);
+ visit_type_int32(v, name, ptr, errp);
}
static void set_int32(Object *obj, Visitor *v, void *opaque,
@@ -333,7 +333,7 @@ static void set_int32(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_int32(v, ptr, name, errp);
+ visit_type_int32(v, name, ptr, errp);
}
PropertyInfo qdev_prop_uint32 = {
@@ -357,7 +357,7 @@ static void get_uint64(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint64_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_uint64(v, ptr, name, errp);
+ visit_type_uint64(v, name, ptr, errp);
}
static void set_uint64(Object *obj, Visitor *v, void *opaque,
@@ -372,7 +372,7 @@ static void set_uint64(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_uint64(v, ptr, name, errp);
+ visit_type_uint64(v, name, ptr, errp);
}
PropertyInfo qdev_prop_uint64 = {
@@ -398,9 +398,9 @@ static void get_string(Object *obj, Visitor *v, void *opaque,
if (!*ptr) {
char *str = (char *)"";
- visit_type_str(v, &str, name, errp);
+ visit_type_str(v, name, &str, errp);
} else {
- visit_type_str(v, ptr, name, errp);
+ visit_type_str(v, name, ptr, errp);
}
}
@@ -418,7 +418,7 @@ static void set_string(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -461,7 +461,7 @@ static void get_mac(Object *obj, Visitor *v, void *opaque,
mac->a[0], mac->a[1], mac->a[2],
mac->a[3], mac->a[4], mac->a[5]);
- visit_type_str(v, &p, name, errp);
+ visit_type_str(v, name, &p, errp);
}
static void set_mac(Object *obj, Visitor *v, void *opaque,
@@ -479,7 +479,7 @@ static void set_mac(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -573,11 +573,11 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_free(local_err);
local_err = NULL;
- visit_type_int32(v, &value, name, &local_err);
+ visit_type_int32(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
} else if (value < -1 || value > 255) {
@@ -644,7 +644,7 @@ static void set_blocksize(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_uint16(v, &value, name, &local_err);
+ visit_type_uint16(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -690,7 +690,7 @@ static void get_pci_host_devaddr(Object *obj, Visitor *v, void *opaque,
addr->domain, addr->bus, addr->slot, addr->function);
assert(rc == sizeof(buffer) - 1);
- visit_type_str(v, &p, name, errp);
+ visit_type_str(v, name, &p, errp);
}
/*
@@ -715,7 +715,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, void *opaque,
return;
}
- visit_type_str(v, &str, name, &local_err);
+ visit_type_str(v, name, &str, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -837,7 +837,7 @@ static void set_prop_arraylen(Object *obj, Visitor *v, void *opaque,
name);
return;
}
- visit_type_uint32(v, alenptr, name, &local_err);
+ visit_type_uint32(v, name, alenptr, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1101,7 +1101,7 @@ static void get_size(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint64_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_size(v, ptr, name, errp);
+ visit_type_size(v, name, ptr, errp);
}
static void set_size(Object *obj, Visitor *v, void *opaque,
@@ -1111,7 +1111,7 @@ static void set_size(Object *obj, Visitor *v, void *opaque,
Property *prop = opaque;
uint64_t *ptr = qdev_get_prop_ptr(dev, prop);
- visit_type_size(v, ptr, name, errp);
+ visit_type_size(v, name, ptr, errp);
}
PropertyInfo qdev_prop_size = {
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 779de2b..c731bb2 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -903,7 +903,7 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, void *opaque,
char *ptr = buffer;
prop->info->print(dev, prop, buffer, sizeof(buffer));
- visit_type_str(v, &ptr, name, errp);
+ visit_type_str(v, name, &ptr, errp);
}
/**
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index af2fe84..5dcdde4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1747,7 +1747,7 @@ pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, void *opaque,
PCMachineState *pcms = PC_MACHINE(obj);
int64_t value = memory_region_size(&pcms->hotplug_memory.mr);
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v,
@@ -1757,7 +1757,7 @@ static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v,
PCMachineState *pcms = PC_MACHINE(obj);
uint64_t value = pcms->max_ram_below_4g;
- visit_type_size(v, &value, name, errp);
+ visit_type_size(v, name, &value, errp);
}
static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
@@ -1768,7 +1768,7 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
Error *error = NULL;
uint64_t value;
- visit_type_size(v, &value, name, &error);
+ visit_type_size(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
@@ -1796,7 +1796,7 @@ static void pc_machine_get_vmport(Object *obj, Visitor *v, void *opaque,
PCMachineState *pcms = PC_MACHINE(obj);
OnOffAuto vmport = pcms->vmport;
- visit_type_OnOffAuto(v, &vmport, name, errp);
+ visit_type_OnOffAuto(v, name, &vmport, errp);
}
static void pc_machine_set_vmport(Object *obj, Visitor *v, void *opaque,
@@ -1804,7 +1804,7 @@ static void pc_machine_set_vmport(Object *obj, Visitor *v, void *opaque,
{
PCMachineState *pcms = PC_MACHINE(obj);
- visit_type_OnOffAuto(v, &pcms->vmport, name, errp);
+ visit_type_OnOffAuto(v, name, &pcms->vmport, errp);
}
bool pc_machine_is_smm_enabled(PCMachineState *pcms)
@@ -1838,7 +1838,7 @@ static void pc_machine_get_smm(Object *obj, Visitor *v, void *opaque,
PCMachineState *pcms = PC_MACHINE(obj);
OnOffAuto smm = pcms->smm;
- visit_type_OnOffAuto(v, &smm, name, errp);
+ visit_type_OnOffAuto(v, name, &smm, errp);
}
static void pc_machine_set_smm(Object *obj, Visitor *v, void *opaque,
@@ -1846,7 +1846,7 @@ static void pc_machine_set_smm(Object *obj, Visitor *v, void *opaque,
{
PCMachineState *pcms = PC_MACHINE(obj);
- visit_type_OnOffAuto(v, &pcms->smm, name, errp);
+ visit_type_OnOffAuto(v, name, &pcms->smm, errp);
}
static bool pc_machine_get_nvdimm(Object *obj, Error **errp)
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 21607d9..572f61d 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -205,7 +205,7 @@ static void ide_dev_get_bootindex(Object *obj, Visitor *v, void *opaque,
{
IDEDevice *d = IDE_DEVICE(obj);
- visit_type_int32(v, &d->conf.bootindex, name, errp);
+ visit_type_int32(v, name, &d->conf.bootindex, errp);
}
static void ide_dev_set_bootindex(Object *obj, Visitor *v, void *opaque,
@@ -215,7 +215,7 @@ static void ide_dev_set_bootindex(Object *obj, Visitor *v, void *opaque,
int32_t boot_index;
Error *local_err = NULL;
- visit_type_int32(v, &boot_index, name, &local_err);
+ visit_type_int32(v, name, &boot_index, &local_err);
if (local_err) {
goto out;
}
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index cd91ddc..dafcdeb 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -95,7 +95,7 @@ static void xics_prop_get_nr_irqs(Object *obj, Visitor *v,
XICSState *icp = XICS_COMMON(obj);
int64_t value = icp->nr_irqs;
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void xics_prop_set_nr_irqs(Object *obj, Visitor *v,
@@ -106,7 +106,7 @@ static void xics_prop_set_nr_irqs(Object *obj, Visitor *v,
Error *error = NULL;
int64_t value;
- visit_type_int(v, &value, name, &error);
+ visit_type_int(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
@@ -129,7 +129,7 @@ static void xics_prop_get_nr_servers(Object *obj, Visitor *v,
XICSState *icp = XICS_COMMON(obj);
int64_t value = icp->nr_servers;
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void xics_prop_set_nr_servers(Object *obj, Visitor *v,
@@ -141,7 +141,7 @@ static void xics_prop_set_nr_servers(Object *obj, Visitor *v,
Error *error = NULL;
int64_t value;
- visit_type_int(v, &value, name, &error);
+ visit_type_int(v, name, &value, &error);
if (error) {
error_propagate(errp, error);
return;
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index d198945..e439955 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -577,7 +577,7 @@ static void ich9_lpc_get_sci_int(Object *obj, Visitor *v,
ICH9LPCState *lpc = ICH9_LPC_DEVICE(obj);
uint32_t value = ich9_lpc_sci_irq(lpc);
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void ich9_lpc_add_properties(ICH9LPCState *lpc)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 32d00dd..6514428 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -383,7 +383,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, void *opaque,
mr = host_memory_backend_get_memory(dimm->hostmem, errp);
value = memory_region_size(mr);
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
static void pc_dimm_check_memdev_is_busy(Object *obj, const char *name,
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 65e8f20..1486441 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -368,7 +368,7 @@ static void edu_obj_uint64(Object *obj, Visitor *v, void *opaque,
{
uint64_t *val = opaque;
- visit_type_uint64(v, val, name, errp);
+ visit_type_uint64(v, name, val, errp);
}
static void edu_instance_init(Object *obj)
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index e102b40..562d8cc 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -59,7 +59,7 @@ static void tmp105_get_temperature(Object *obj, Visitor *v, void *opaque,
TMP105State *s = TMP105(obj);
int64_t value = s->temperature * 1000 / 256;
- visit_type_int(v, &value, name, errp);
+ visit_type_int(v, name, &value, errp);
}
/* Units are 0.001 centigrades relative to 0 C. s->temperature is 8.8
@@ -72,7 +72,7 @@ static void tmp105_set_temperature(Object *obj, Visitor *v, void *opaque,
Error *local_err = NULL;
int64_t temp;
- visit_type_int(v, &temp, name, &local_err);
+ visit_type_int(v, name, &temp, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index ac7277b..6d1e963 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -100,7 +100,7 @@ static void isa_ne2000_get_bootindex(Object *obj, Visitor *v, void *opaque,
ISANE2000State *isa = ISA_NE2000(obj);
NE2000State *s = &isa->ne2000;
- visit_type_int32(v, &s->c.bootindex, name, errp);
+ visit_type_int32(v, name, &s->c.bootindex, errp);
}
static void isa_ne2000_set_bootindex(Object *obj, Visitor *v, void *opaque,
@@ -111,7 +111,7 @@ static void isa_ne2000_set_bootindex(Object *obj, Visitor *v, void *opaque,
int32_t boot_index;
Error *local_err = NULL;
- visit_type_int32(v, &boot_index, name, &local_err);
+ visit_type_int32(v, name, &boot_index, &local_err);
if (local_err) {
goto out;
}
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 3832ed6..8ff5c6b 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -222,7 +222,7 @@ static void i440fx_pcihost_get_pci_hole_start(Object *obj, Visitor *v,
I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
uint32_t value = s->pci_info.w32.begin;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v,
@@ -232,7 +232,7 @@ static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v,
I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
uint32_t value = s->pci_info.w32.end;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v,
@@ -244,7 +244,7 @@ static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v,
pci_bus_get_w64_range(h->bus, &w64);
- visit_type_uint64(v, &w64.begin, name, errp);
+ visit_type_uint64(v, name, &w64.begin, errp);
}
static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v,
@@ -256,7 +256,7 @@ static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v,
pci_bus_get_w64_range(h->bus, &w64);
- visit_type_uint64(v, &w64.end, name, errp);
+ visit_type_uint64(v, name, &w64.end, errp);
}
static void i440fx_pcihost_initfn(Object *obj)
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 42b421e..0966eb5 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -74,7 +74,7 @@ static void q35_host_get_pci_hole_start(Object *obj, Visitor *v,
Q35PCIHost *s = Q35_HOST_DEVICE(obj);
uint32_t value = s->mch.pci_info.w32.begin;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void q35_host_get_pci_hole_end(Object *obj, Visitor *v,
@@ -84,7 +84,7 @@ static void q35_host_get_pci_hole_end(Object *obj, Visitor *v,
Q35PCIHost *s = Q35_HOST_DEVICE(obj);
uint32_t value = s->mch.pci_info.w32.end;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v,
@@ -96,7 +96,7 @@ static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v,
pci_bus_get_w64_range(h->bus, &w64);
- visit_type_uint64(v, &w64.begin, name, errp);
+ visit_type_uint64(v, name, &w64.begin, errp);
}
static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v,
@@ -108,7 +108,7 @@ static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v,
pci_bus_get_w64_range(h->bus, &w64);
- visit_type_uint64(v, &w64.end, name, errp);
+ visit_type_uint64(v, name, &w64.end, errp);
}
static void q35_host_get_mmcfg_size(Object *obj, Visitor *v,
@@ -118,7 +118,7 @@ static void q35_host_get_mmcfg_size(Object *obj, Visitor *v,
PCIExpressHost *e = PCIE_HOST_BRIDGE(obj);
uint32_t value = e->size;
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static Property mch_props[] = {
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 90016e6..fda6a95 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -221,7 +221,7 @@ static void prop_get_index(Object *obj, Visitor *v, void *opaque,
sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj);
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
uint32_t value = (uint32_t)drck->get_index(drc);
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void prop_get_type(Object *obj, Visitor *v, void *opaque,
@@ -230,7 +230,7 @@ static void prop_get_type(Object *obj, Visitor *v, void *opaque,
sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj);
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
uint32_t value = (uint32_t)drck->get_type(drc);
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static char *prop_get_name(Object *obj, Error **errp)
@@ -248,7 +248,7 @@ static void prop_get_entity_sense(Object *obj, Visitor *v, void *opaque,
uint32_t value;
drck->entity_sense(drc, &value);
- visit_type_uint32(v, &value, name, errp);
+ visit_type_uint32(v, name, &value, errp);
}
static void prop_get_fdt(Object *obj, Visitor *v, void *opaque,
@@ -260,7 +260,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, void *opaque,
void *fdt;
if (!drc->fdt) {
- visit_start_struct(v, NULL, NULL, name, 0, &err);
+ visit_start_struct(v, name, NULL, NULL, 0, &err);
if (!err) {
visit_end_struct(v, &err);
}
@@ -283,7 +283,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, void *opaque,
case FDT_BEGIN_NODE:
fdt_depth++;
name = fdt_get_name(fdt, fdt_offset, &name_len);
- visit_start_struct(v, NULL, NULL, name, 0, &err);
+ visit_start_struct(v, name, NULL, NULL, 0, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -309,7 +309,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, void *opaque,
return;
}
for (i = 0; i < prop_len; i++) {
- visit_type_uint8(v, (uint8_t *)&prop->data[i], NULL, &err);
+ visit_type_uint8(v, NULL, (uint8_t *)&prop->data[i], &err);
if (err) {
error_propagate(errp, err);
return;
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index f7ab741..dafbea3 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -787,7 +787,7 @@ static void usb_msd_get_bootindex(Object *obj, Visitor *v, void *opaque,
USBDevice *dev = USB_DEVICE(obj);
MSDState *s = USB_STORAGE_DEV(dev);
- visit_type_int32(v, &s->conf.bootindex, name, errp);
+ visit_type_int32(v, name, &s->conf.bootindex, errp);
}
static void usb_msd_set_bootindex(Object *obj, Visitor *v, void *opaque,
@@ -798,7 +798,7 @@ static void usb_msd_set_bootindex(Object *obj, Visitor *v, void *opaque,
int32_t boot_index;
Error *local_err = NULL;
- visit_type_int32(v, &boot_index, name, &local_err);
+ visit_type_int32(v, name, &boot_index, &local_err);
if (local_err) {
goto out;
}
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 7d05d3f..b46cb58 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -120,21 +120,21 @@ static void balloon_stats_get_all(Object *obj, Visitor *v,
VirtIOBalloon *s = opaque;
int i;
- visit_start_struct(v, NULL, "guest-stats", name, 0, &err);
+ visit_start_struct(v, name, NULL, "guest-stats", 0, &err);
if (err) {
goto out;
}
- visit_type_int(v, &s->stats_last_update, "last-update", &err);
+ visit_type_int(v, "last-update", &s->stats_last_update, &err);
if (err) {
goto out_end;
}
- visit_start_struct(v, NULL, NULL, "stats", 0, &err);
+ visit_start_struct(v, "stats", NULL, NULL, 0, &err);
if (err) {
goto out_end;
}
for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
- visit_type_uint64(v, &s->stats[i], balloon_stat_names[i], &err);
+ visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], &err);
if (err) {
break;
}
@@ -156,7 +156,7 @@ static void balloon_stats_get_poll_interval(Object *obj, Visitor *v,
Error **errp)
{
VirtIOBalloon *s = opaque;
- visit_type_int(v, &s->stats_poll_interval, name, errp);
+ visit_type_int(v, name, &s->stats_poll_interval, errp);
}
static void balloon_stats_set_poll_interval(Object *obj, Visitor *v,
@@ -167,7 +167,7 @@ static void balloon_stats_set_poll_interval(Object *obj, Visitor *v,
Error *local_err = NULL;
int64_t value;
- visit_type_int(v, &value, name, &local_err);
+ visit_type_int(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
OpenPOWER on IntegriCloud