From d7bce9999df85c56c8cb1fcffd944d51bff8ff48 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 29 Jan 2016 06:48:55 -0700 Subject: qom: Swap 'name' next to visitor in ObjectPropertyAccessor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to the previous patch, it's nice to have all functions in the tree that involve a visitor and a name for conversion to or from QAPI to consistently stick the 'name' parameter next to the Visitor parameter. Done by manually changing include/qom/object.h and qom/object.c, then running this Coccinelle script and touching up the fallout (Coccinelle insisted on adding some trailing whitespace). @ rule1 @ identifier fn; typedef Object, Visitor, Error; identifier obj, v, opaque, name, errp; @@ void fn - (Object *obj, Visitor *v, void *opaque, const char *name, + (Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { ... } @@ identifier rule1.fn; expression obj, v, opaque, name, errp; @@ fn(obj, v, - opaque, name, + name, opaque, errp) Signed-off-by: Eric Blake Reviewed-by: Marc-André Lureau Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- backends/hostmem.c | 16 +++--- bootdevice.c | 8 +-- hw/acpi/ich9.c | 35 +++++------- hw/core/machine.c | 14 ++--- hw/core/qdev-properties-system.c | 32 +++++------ hw/core/qdev-properties.c | 116 +++++++++++++++++++-------------------- hw/core/qdev.c | 5 +- hw/i386/pc.c | 29 +++++----- hw/ide/qdev.c | 8 +-- hw/intc/xics.c | 12 ++-- hw/isa/lpc_ich9.c | 5 +- hw/mem/pc-dimm.c | 4 +- hw/misc/edu.c | 4 +- hw/misc/tmp105.c | 8 +-- hw/net/ne2000-isa.c | 10 ++-- hw/pci-host/piix.c | 10 ++-- hw/pci-host/q35.c | 13 ++--- hw/ppc/spapr_drc.c | 16 +++--- hw/usb/dev-storage.c | 8 +-- hw/virtio/virtio-balloon.c | 8 +-- include/qom/object.h | 4 +- memory.c | 18 +++--- net/dump.c | 8 +-- net/filter-buffer.c | 10 ++-- qom/object.c | 75 +++++++++++++------------ target-i386/cpu.c | 67 +++++++++++----------- target-ppc/translate_init.c | 8 +-- tests/test-qdev-global-props.c | 14 ++--- 28 files changed, 278 insertions(+), 287 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index da80662fcd..6c6f0da6d9 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -27,8 +27,8 @@ QEMU_BUILD_BUG_ON(HOST_MEM_POLICY_INTERLEAVE != MPOL_INTERLEAVE); #endif static void -host_memory_backend_get_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +host_memory_backend_get_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(obj); uint64_t value = backend->size; @@ -37,8 +37,8 @@ host_memory_backend_get_size(Object *obj, Visitor *v, void *opaque, } static void -host_memory_backend_set_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +host_memory_backend_set_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(obj); Error *local_err = NULL; @@ -64,8 +64,8 @@ out: } static void -host_memory_backend_get_host_nodes(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(obj); uint16List *host_nodes = NULL; @@ -96,8 +96,8 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, void *opaque, } static void -host_memory_backend_set_host_nodes(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +host_memory_backend_set_host_nodes(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { #ifdef CONFIG_NUMA HostMemoryBackend *backend = MEMORY_BACKEND(obj); diff --git a/bootdevice.c b/bootdevice.c index 149ee3aaf0..dbc0159392 100644 --- a/bootdevice.c +++ b/bootdevice.c @@ -271,15 +271,15 @@ typedef struct { DeviceState *dev; } BootIndexProperty; -static void device_get_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void device_get_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { BootIndexProperty *prop = opaque; visit_type_int32(v, name, prop->bootindex, errp); } -static void device_set_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void device_set_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { BootIndexProperty *prop = opaque; int32_t boot_index; diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index c3b6035f34..4f9ce05d04 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -283,9 +283,8 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, } } -static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; uint32_t value = pm->pm_io_base + ICH9_PMIO_GPE0_STS; @@ -308,9 +307,8 @@ static void ich9_pm_set_memory_hotplug_support(Object *obj, bool value, s->pm.acpi_memory_hotplug.is_enabled = value; } -static void ich9_pm_get_disable_s3(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_get_disable_s3(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; uint8_t value = pm->disable_s3; @@ -318,9 +316,8 @@ static void ich9_pm_get_disable_s3(Object *obj, Visitor *v, visit_type_uint8(v, name, &value, errp); } -static void ich9_pm_set_disable_s3(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_set_disable_s3(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; Error *local_err = NULL; @@ -335,9 +332,8 @@ out: error_propagate(errp, local_err); } -static void ich9_pm_get_disable_s4(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_get_disable_s4(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; uint8_t value = pm->disable_s4; @@ -345,9 +341,8 @@ static void ich9_pm_get_disable_s4(Object *obj, Visitor *v, visit_type_uint8(v, name, &value, errp); } -static void ich9_pm_set_disable_s4(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_set_disable_s4(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; Error *local_err = NULL; @@ -362,9 +357,8 @@ out: error_propagate(errp, local_err); } -static void ich9_pm_get_s4_val(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_get_s4_val(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; uint8_t value = pm->s4_val; @@ -372,9 +366,8 @@ static void ich9_pm_get_s4_val(Object *obj, Visitor *v, visit_type_uint8(v, name, &value, errp); } -static void ich9_pm_set_s4_val(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_pm_set_s4_val(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCPMRegs *pm = opaque; Error *local_err = NULL; diff --git a/hw/core/machine.c b/hw/core/machine.c index 03d9a951b2..6d1a0d8eeb 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -34,7 +34,7 @@ static void machine_set_accel(Object *obj, const char *value, Error **errp) } static void machine_set_kernel_irqchip(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { Error *err = NULL; @@ -69,7 +69,7 @@ static void machine_set_kernel_irqchip(Object *obj, Visitor *v, } static void machine_get_kvm_shadow_mem(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { MachineState *ms = MACHINE(obj); @@ -79,7 +79,7 @@ static void machine_get_kvm_shadow_mem(Object *obj, Visitor *v, } static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { MachineState *ms = MACHINE(obj); @@ -171,8 +171,8 @@ static void machine_set_dumpdtb(Object *obj, const char *value, Error **errp) } static void machine_get_phandle_start(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) + const char *name, void *opaque, + Error **errp) { MachineState *ms = MACHINE(obj); int64_t value = ms->phandle_start; @@ -181,8 +181,8 @@ static void machine_get_phandle_start(Object *obj, Visitor *v, } static void machine_set_phandle_start(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) + const char *name, void *opaque, + Error **errp) { MachineState *ms = MACHINE(obj); Error *error = NULL; diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index acbe403c63..e10cede749 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -112,14 +112,14 @@ static char *print_drive(void *ptr) return g_strdup(blk_name(ptr)); } -static void get_drive(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_drive(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { get_pointer(obj, v, opaque, print_drive, name, errp); } -static void set_drive(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_drive(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { set_pointer(obj, v, opaque, parse_drive, name, errp); } @@ -173,14 +173,14 @@ static char *print_chr(void *ptr) return g_strdup(val); } -static void get_chr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_chr(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { get_pointer(obj, v, opaque, print_chr, name, errp); } -static void set_chr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { set_pointer(obj, v, opaque, parse_chr, name, errp); } @@ -194,8 +194,8 @@ PropertyInfo qdev_prop_chr = { }; /* --- netdev device --- */ -static void get_netdev(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_netdev(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -206,8 +206,8 @@ static void get_netdev(Object *obj, Visitor *v, void *opaque, g_free(p); } -static void set_netdev(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_netdev(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -293,8 +293,8 @@ static int print_vlan(DeviceState *dev, Property *prop, char *dest, size_t len) return snprintf(dest, len, ""); } -static void get_vlan(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_vlan(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -311,8 +311,8 @@ static void get_vlan(Object *obj, Visitor *v, void *opaque, visit_type_int32(v, name, &id, errp); } -static void set_vlan(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 77f354233f..6a9289921f 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -42,8 +42,8 @@ void *qdev_get_prop_ptr(DeviceState *dev, Property *prop) return ptr; } -static void get_enum(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_enum(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -53,8 +53,8 @@ static void get_enum(Object *obj, Visitor *v, void *opaque, prop->info->name, errp); } -static void set_enum(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_enum(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -88,8 +88,8 @@ static void bit_prop_set(DeviceState *dev, Property *props, bool val) } } -static void prop_get_bit(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_bit(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -99,8 +99,8 @@ static void prop_get_bit(Object *obj, Visitor *v, void *opaque, visit_type_bool(v, name, &value, errp); } -static void prop_set_bit(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_set_bit(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -146,8 +146,8 @@ static void bit64_prop_set(DeviceState *dev, Property *props, bool val) } } -static void prop_get_bit64(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_bit64(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -157,8 +157,8 @@ static void prop_get_bit64(Object *obj, Visitor *v, void *opaque, visit_type_bool(v, name, &value, errp); } -static void prop_set_bit64(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_set_bit64(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -187,8 +187,8 @@ PropertyInfo qdev_prop_bit64 = { /* --- bool --- */ -static void get_bool(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_bool(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -197,8 +197,8 @@ static void get_bool(Object *obj, Visitor *v, void *opaque, visit_type_bool(v, name, ptr, errp); } -static void set_bool(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -220,8 +220,8 @@ PropertyInfo qdev_prop_bool = { /* --- 8bit integer --- */ -static void get_uint8(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_uint8(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -230,8 +230,8 @@ static void get_uint8(Object *obj, Visitor *v, void *opaque, visit_type_uint8(v, name, ptr, errp); } -static void set_uint8(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_uint8(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -253,8 +253,8 @@ PropertyInfo qdev_prop_uint8 = { /* --- 16bit integer --- */ -static void get_uint16(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_uint16(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -263,8 +263,8 @@ static void get_uint16(Object *obj, Visitor *v, void *opaque, visit_type_uint16(v, name, ptr, errp); } -static void set_uint16(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_uint16(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -286,8 +286,8 @@ PropertyInfo qdev_prop_uint16 = { /* --- 32bit integer --- */ -static void get_uint32(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_uint32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -296,8 +296,8 @@ static void get_uint32(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, ptr, errp); } -static void set_uint32(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_uint32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -311,8 +311,8 @@ static void set_uint32(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, ptr, errp); } -static void get_int32(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_int32(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -321,8 +321,8 @@ static void get_int32(Object *obj, Visitor *v, void *opaque, visit_type_int32(v, name, ptr, errp); } -static void set_int32(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_int32(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -350,8 +350,8 @@ PropertyInfo qdev_prop_int32 = { /* --- 64bit integer --- */ -static void get_uint64(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_uint64(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -360,8 +360,8 @@ static void get_uint64(Object *obj, Visitor *v, void *opaque, visit_type_uint64(v, name, ptr, errp); } -static void set_uint64(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_uint64(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -389,8 +389,8 @@ static void release_string(Object *obj, const char *name, void *opaque) g_free(*(char **)qdev_get_prop_ptr(DEVICE(obj), prop)); } -static void get_string(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_string(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -404,8 +404,8 @@ static void get_string(Object *obj, Visitor *v, void *opaque, } } -static void set_string(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_string(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -448,8 +448,8 @@ PropertyInfo qdev_prop_ptr = { * 01:02:03:04:05:06 * 01-02-03-04-05-06 */ -static void get_mac(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_mac(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -464,8 +464,8 @@ static void get_mac(Object *obj, Visitor *v, void *opaque, visit_type_str(v, name, &p, errp); } -static void set_mac(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -558,8 +558,8 @@ PropertyInfo qdev_prop_fdc_drive_type = { /* * bus-local address, i.e. "$slot" or "$slot.$fn" */ -static void set_pci_devfn(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_pci_devfn(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -629,8 +629,8 @@ PropertyInfo qdev_prop_pci_devfn = { /* --- blocksize --- */ -static void set_blocksize(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_blocksize(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -676,8 +676,8 @@ PropertyInfo qdev_prop_blocksize = { /* --- pci host address --- */ -static void get_pci_host_devaddr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -697,8 +697,8 @@ static void get_pci_host_devaddr(Object *obj, Visitor *v, void *opaque, * Parse [:]:. * if is not supplied, it's assumed to be 0. */ -static void set_pci_host_devaddr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -811,8 +811,8 @@ static void array_element_release(Object *obj, const char *name, void *opaque) g_free(p); } -static void set_prop_arraylen(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_prop_arraylen(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { /* Setter for the property which defines the length of a * variable-sized property array. As well as actually setting the @@ -1094,8 +1094,8 @@ void qdev_prop_set_globals(DeviceState *dev) /* --- 64bit unsigned int 'size' type --- */ -static void get_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void get_size(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; @@ -1104,8 +1104,8 @@ static void get_size(Object *obj, Visitor *v, void *opaque, visit_type_size(v, name, ptr, errp); } -static void set_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void set_size(Object *obj, Visitor *v, const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c731bb2032..db41aa1f26 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -893,8 +893,9 @@ char *qdev_get_dev_path(DeviceState *dev) * Legacy property handling */ -static void qdev_get_legacy_property(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void qdev_get_legacy_property(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5dcdde412e..0aeefd2c0d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1741,8 +1741,9 @@ static HotplugHandler *pc_get_hotpug_handler(MachineState *machine, } static void -pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); int64_t value = memory_region_size(&pcms->hotplug_memory.mr); @@ -1751,8 +1752,8 @@ pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, void *opaque, } static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) + const char *name, void *opaque, + Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); uint64_t value = pcms->max_ram_below_4g; @@ -1761,8 +1762,8 @@ static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v, } static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) + const char *name, void *opaque, + Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); Error *error = NULL; @@ -1790,8 +1791,8 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v, pcms->max_ram_below_4g = value; } -static void pc_machine_get_vmport(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void pc_machine_get_vmport(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); OnOffAuto vmport = pcms->vmport; @@ -1799,8 +1800,8 @@ static void pc_machine_get_vmport(Object *obj, Visitor *v, void *opaque, visit_type_OnOffAuto(v, name, &vmport, errp); } -static void pc_machine_set_vmport(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void pc_machine_set_vmport(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); @@ -1832,8 +1833,8 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms) return false; } -static void pc_machine_get_smm(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void pc_machine_get_smm(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); OnOffAuto smm = pcms->smm; @@ -1841,8 +1842,8 @@ static void pc_machine_get_smm(Object *obj, Visitor *v, void *opaque, visit_type_OnOffAuto(v, name, &smm, errp); } -static void pc_machine_set_smm(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void pc_machine_set_smm(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 572f61dbd4..2d14a768f1 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -200,16 +200,16 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind) return 0; } -static void ide_dev_get_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void ide_dev_get_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { IDEDevice *d = IDE_DEVICE(obj); visit_type_int32(v, name, &d->conf.bootindex, errp); } -static void ide_dev_set_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void ide_dev_set_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { IDEDevice *d = IDE_DEVICE(obj); int32_t boot_index; diff --git a/hw/intc/xics.c b/hw/intc/xics.c index dafcdeb1e0..e66ae32881 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -89,8 +89,8 @@ static void xics_common_reset(DeviceState *d) device_reset(DEVICE(icp->ics)); } -static void xics_prop_get_nr_irqs(Object *obj, Visitor *v, - void *opaque, const char *name, Error **errp) +static void xics_prop_get_nr_irqs(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { XICSState *icp = XICS_COMMON(obj); int64_t value = icp->nr_irqs; @@ -98,8 +98,8 @@ static void xics_prop_get_nr_irqs(Object *obj, Visitor *v, visit_type_int(v, name, &value, errp); } -static void xics_prop_set_nr_irqs(Object *obj, Visitor *v, - void *opaque, const char *name, Error **errp) +static void xics_prop_set_nr_irqs(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { XICSState *icp = XICS_COMMON(obj); XICSStateClass *info = XICS_COMMON_GET_CLASS(icp); @@ -123,7 +123,7 @@ static void xics_prop_set_nr_irqs(Object *obj, Visitor *v, } static void xics_prop_get_nr_servers(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { XICSState *icp = XICS_COMMON(obj); @@ -133,7 +133,7 @@ static void xics_prop_get_nr_servers(Object *obj, Visitor *v, } static void xics_prop_set_nr_servers(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { XICSState *icp = XICS_COMMON(obj); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index e439955789..6cf2eb607d 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -570,9 +570,8 @@ Object *ich9_lpc_find(void) return o; } -static void ich9_lpc_get_sci_int(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void ich9_lpc_get_sci_int(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ICH9LPCState *lpc = ICH9_LPC_DEVICE(obj); uint32_t value = ich9_lpc_sci_irq(lpc); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 6514428265..1aa12c64d0 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -373,8 +373,8 @@ static Property pc_dimm_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static void pc_dimm_get_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { int64_t value; MemoryRegion *mr; diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 1486441d7c..888ba49a0e 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -363,8 +363,8 @@ static void pci_edu_uninit(PCIDevice *pdev) timer_del(&edu->dma_timer); } -static void edu_obj_uint64(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void edu_obj_uint64(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { uint64_t *val = opaque; diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index 562d8cc643..b53f6babad 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -53,8 +53,8 @@ static void tmp105_alarm_update(TMP105State *s) tmp105_interrupt_update(s); } -static void tmp105_get_temperature(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void tmp105_get_temperature(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { TMP105State *s = TMP105(obj); int64_t value = s->temperature * 1000 / 256; @@ -65,8 +65,8 @@ static void tmp105_get_temperature(Object *obj, Visitor *v, void *opaque, /* Units are 0.001 centigrades relative to 0 C. s->temperature is 8.8 * fixed point, so units are 1/256 centigrades. A simple ratio will do. */ -static void tmp105_set_temperature(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void tmp105_set_temperature(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { TMP105State *s = TMP105(obj); Error *local_err = NULL; diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 6d1e963fc1..8dca7c936b 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -94,8 +94,9 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } -static void isa_ne2000_get_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void isa_ne2000_get_bootindex(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { ISANE2000State *isa = ISA_NE2000(obj); NE2000State *s = &isa->ne2000; @@ -103,8 +104,9 @@ static void isa_ne2000_get_bootindex(Object *obj, Visitor *v, void *opaque, visit_type_int32(v, name, &s->c.bootindex, errp); } -static void isa_ne2000_set_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void isa_ne2000_set_bootindex(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { ISANE2000State *isa = ISA_NE2000(obj); NE2000State *s = &isa->ne2000; diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 8ff5c6b0b0..41aa66f828 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -216,7 +216,7 @@ static const VMStateDescription vmstate_i440fx = { }; static void i440fx_pcihost_get_pci_hole_start(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); @@ -226,7 +226,7 @@ static void i440fx_pcihost_get_pci_hole_start(Object *obj, Visitor *v, } static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj); @@ -236,8 +236,8 @@ static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v, } static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) + const char *name, + void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; @@ -248,7 +248,7 @@ static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, } static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 0966eb5c89..115fb8c046 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -68,7 +68,7 @@ static const char *q35_host_root_bus_path(PCIHostState *host_bridge, } static void q35_host_get_pci_hole_start(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { Q35PCIHost *s = Q35_HOST_DEVICE(obj); @@ -78,7 +78,7 @@ static void q35_host_get_pci_hole_start(Object *obj, Visitor *v, } static void q35_host_get_pci_hole_end(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { Q35PCIHost *s = Q35_HOST_DEVICE(obj); @@ -88,7 +88,7 @@ static void q35_host_get_pci_hole_end(Object *obj, Visitor *v, } static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); @@ -100,7 +100,7 @@ static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, } static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); @@ -111,9 +111,8 @@ static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v, visit_type_uint64(v, name, &w64.end, errp); } -static void q35_host_get_mmcfg_size(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void q35_host_get_mmcfg_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { PCIExpressHost *e = PCIE_HOST_BRIDGE(obj); uint32_t value = e->size; diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index fda6a95288..e40617faba 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -215,8 +215,8 @@ static uint32_t entity_sense(sPAPRDRConnector *drc, sPAPRDREntitySense *state) return RTAS_OUT_SUCCESS; } -static void prop_get_index(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_index(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj); sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); @@ -224,8 +224,8 @@ static void prop_get_index(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, &value, errp); } -static void prop_get_type(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_type(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj); sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); @@ -240,8 +240,8 @@ static char *prop_get_name(Object *obj, Error **errp) return g_strdup(drck->get_name(drc)); } -static void prop_get_entity_sense(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_entity_sense(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj); sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); @@ -251,8 +251,8 @@ static void prop_get_entity_sense(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, &value, errp); } -static void prop_get_fdt(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void prop_get_fdt(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(obj); Error *err = NULL; diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index dafbea3484..5ae0424923 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -781,8 +781,8 @@ static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data) dc->props = msd_properties; } -static void usb_msd_get_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void usb_msd_get_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { USBDevice *dev = USB_DEVICE(obj); MSDState *s = USB_STORAGE_DEV(dev); @@ -790,8 +790,8 @@ static void usb_msd_get_bootindex(Object *obj, Visitor *v, void *opaque, visit_type_int32(v, name, &s->conf.bootindex, errp); } -static void usb_msd_set_bootindex(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void usb_msd_set_bootindex(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { USBDevice *dev = USB_DEVICE(obj); MSDState *s = USB_STORAGE_DEV(dev); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index b46cb580a0..0d7033a572 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -113,8 +113,8 @@ static void balloon_stats_poll_cb(void *opaque) s->stats_vq_elem = NULL; } -static void balloon_stats_get_all(Object *obj, Visitor *v, - void *opaque, const char *name, Error **errp) +static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { Error *err = NULL; VirtIOBalloon *s = opaque; @@ -152,7 +152,7 @@ out: } static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { VirtIOBalloon *s = opaque; @@ -160,7 +160,7 @@ static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, } static void balloon_stats_set_poll_interval(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { VirtIOBalloon *s = opaque; diff --git a/include/qom/object.h b/include/qom/object.h index 3e7e99dff1..698827d948 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -290,16 +290,16 @@ typedef struct InterfaceInfo InterfaceInfo; * ObjectPropertyAccessor: * @obj: the object that owns the property * @v: the visitor that contains the property data - * @opaque: the object property opaque * @name: the name of the property + * @opaque: the object property opaque * @errp: a pointer to an Error that is filled if getting/setting fails. * * Called when trying to get/set a property. */ typedef void (ObjectPropertyAccessor)(Object *obj, Visitor *v, - void *opaque, const char *name, + void *opaque, Error **errp); /** diff --git a/memory.c b/memory.c index 1618dc8914..09041edd43 100644 --- a/memory.c +++ b/memory.c @@ -928,8 +928,8 @@ void memory_region_init(MemoryRegion *mr, } } -static void memory_region_get_addr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void memory_region_get_addr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MemoryRegion *mr = MEMORY_REGION(obj); uint64_t value = mr->addr; @@ -937,8 +937,9 @@ static void memory_region_get_addr(Object *obj, Visitor *v, void *opaque, visit_type_uint64(v, name, &value, errp); } -static void memory_region_get_container(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void memory_region_get_container(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { MemoryRegion *mr = MEMORY_REGION(obj); gchar *path = (gchar *)""; @@ -960,8 +961,9 @@ static Object *memory_region_resolve_container(Object *obj, void *opaque, return OBJECT(mr->container); } -static void memory_region_get_priority(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void memory_region_get_priority(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { MemoryRegion *mr = MEMORY_REGION(obj); int32_t value = mr->priority; @@ -976,8 +978,8 @@ static bool memory_region_get_may_overlap(Object *obj, Error **errp) return mr->may_overlap; } -static void memory_region_get_size(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void memory_region_get_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MemoryRegion *mr = MEMORY_REGION(obj); uint64_t value = memory_region_size(mr); diff --git a/net/dump.c b/net/dump.c index 60bc5ce66e..61dec9d61d 100644 --- a/net/dump.c +++ b/net/dump.c @@ -272,8 +272,8 @@ static void filter_dump_setup(NetFilterState *nf, Error **errp) net_dump_state_init(&nfds->ds, nfds->filename, nfds->maxlen, errp); } -static void filter_dump_get_maxlen(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void filter_dump_get_maxlen(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { NetFilterDumpState *nfds = FILTER_DUMP(obj); uint32_t value = nfds->maxlen; @@ -281,8 +281,8 @@ static void filter_dump_get_maxlen(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, &value, errp); } -static void filter_dump_set_maxlen(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void filter_dump_set_maxlen(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { NetFilterDumpState *nfds = FILTER_DUMP(obj); Error *local_err = NULL; diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 236d950c31..12ad2e30d4 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -133,8 +133,9 @@ static void filter_buffer_class_init(ObjectClass *oc, void *data) nfc->receive_iov = filter_buffer_receive_iov; } -static void filter_buffer_get_interval(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void filter_buffer_get_interval(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { FilterBufferState *s = FILTER_BUFFER(obj); uint32_t value = s->interval; @@ -142,8 +143,9 @@ static void filter_buffer_get_interval(Object *obj, Visitor *v, void *opaque, visit_type_uint32(v, name, &value, errp); } -static void filter_buffer_set_interval(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void filter_buffer_set_interval(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { FilterBufferState *s = FILTER_BUFFER(obj); Error *local_err = NULL; diff --git a/qom/object.c b/qom/object.c index 66cafacf9a..db40ae71f5 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1062,7 +1062,7 @@ void object_property_get(Object *obj, Visitor *v, const char *name, if (!prop->get) { error_setg(errp, QERR_PERMISSION_DENIED); } else { - prop->get(obj, v, prop->opaque, name, errp); + prop->get(obj, v, name, prop->opaque, errp); } } @@ -1077,7 +1077,7 @@ void object_property_set(Object *obj, Visitor *v, const char *name, if (!prop->set) { error_setg(errp, QERR_PERMISSION_DENIED); } else { - prop->set(obj, v, prop->opaque, name, errp); + prop->set(obj, v, name, prop->opaque, errp); } } @@ -1335,8 +1335,9 @@ Object *object_get_objects_root(void) return container_get(object_get_root(), "/objects"); } -static void object_get_child_property(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void object_get_child_property(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { Object *child = opaque; gchar *path; @@ -1404,8 +1405,9 @@ typedef struct { ObjectPropertyLinkFlags flags; } LinkProperty; -static void object_get_link_property(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void object_get_link_property(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { LinkProperty *lprop = opaque; Object **child = lprop->child; @@ -1461,8 +1463,9 @@ static Object *object_resolve_link(Object *obj, const char *name, return target; } -static void object_set_link_property(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void object_set_link_property(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { Error *local_err = NULL; LinkProperty *prop = opaque; @@ -1725,8 +1728,8 @@ typedef struct StringProperty void (*set)(Object *, const char *, Error **); } StringProperty; -static void property_get_str(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_get_str(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { StringProperty *prop = opaque; char *value; @@ -1742,8 +1745,8 @@ static void property_get_str(Object *obj, Visitor *v, void *opaque, g_free(value); } -static void property_set_str(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_set_str(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { StringProperty *prop = opaque; char *value; @@ -1817,8 +1820,8 @@ typedef struct BoolProperty void (*set)(Object *, bool, Error **); } BoolProperty; -static void property_get_bool(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_get_bool(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { BoolProperty *prop = opaque; bool value; @@ -1833,8 +1836,8 @@ static void property_get_bool(Object *obj, Visitor *v, void *opaque, visit_type_bool(v, name, &value, errp); } -static void property_set_bool(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_set_bool(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { BoolProperty *prop = opaque; bool value; @@ -1900,8 +1903,8 @@ void object_class_property_add_bool(ObjectClass *klass, const char *name, } } -static void property_get_enum(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_get_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { EnumProperty *prop = opaque; int value; @@ -1916,8 +1919,8 @@ static void property_get_enum(Object *obj, Visitor *v, void *opaque, visit_type_enum(v, name, &value, prop->strings, NULL, errp); } -static void property_set_enum(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_set_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { EnumProperty *prop = opaque; int value; @@ -1992,8 +1995,8 @@ typedef struct TMProperty { void (*get)(Object *, struct tm *, Error **); } TMProperty; -static void property_get_tm(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_get_tm(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { TMProperty *prop = opaque; Error *err = NULL; @@ -2091,33 +2094,29 @@ static char *qdev_get_type(Object *obj, Error **errp) return g_strdup(object_get_typename(obj)); } -static void property_get_uint8_ptr(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void property_get_uint8_ptr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { uint8_t value = *(uint8_t *)opaque; visit_type_uint8(v, name, &value, errp); } -static void property_get_uint16_ptr(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void property_get_uint16_ptr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { uint16_t value = *(uint16_t *)opaque; visit_type_uint16(v, name, &value, errp); } -static void property_get_uint32_ptr(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void property_get_uint32_ptr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { uint32_t value = *(uint32_t *)opaque; visit_type_uint32(v, name, &value, errp); } -static void property_get_uint64_ptr(Object *obj, Visitor *v, - void *opaque, const char *name, - Error **errp) +static void property_get_uint64_ptr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { uint64_t value = *(uint64_t *)opaque; visit_type_uint64(v, name, &value, errp); @@ -2184,16 +2183,16 @@ typedef struct { char *target_name; } AliasProperty; -static void property_get_alias(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_get_alias(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { AliasProperty *prop = opaque; object_property_get(prop->target_obj, v, prop->target_name, errp); } -static void property_set_alias(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void property_set_alias(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { AliasProperty *prop = opaque; diff --git a/target-i386/cpu.c b/target-i386/cpu.c index c9b8b16b3a..3fa14bf171 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1530,8 +1530,9 @@ static void report_unavailable_features(FeatureWord w, uint32_t mask) } } -static void x86_cpuid_version_get_family(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_version_get_family(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; @@ -1544,8 +1545,9 @@ static void x86_cpuid_version_get_family(Object *obj, Visitor *v, void *opaque, visit_type_int(v, name, &value, errp); } -static void x86_cpuid_version_set_family(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_version_set_family(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; @@ -1573,8 +1575,9 @@ static void x86_cpuid_version_set_family(Object *obj, Visitor *v, void *opaque, } } -static void x86_cpuid_version_get_model(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_version_get_model(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; @@ -1585,8 +1588,9 @@ static void x86_cpuid_version_get_model(Object *obj, Visitor *v, void *opaque, visit_type_int(v, name, &value, errp); } -static void x86_cpuid_version_set_model(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_version_set_model(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; @@ -1611,7 +1615,7 @@ static void x86_cpuid_version_set_model(Object *obj, Visitor *v, void *opaque, } static void x86_cpuid_version_get_stepping(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); @@ -1623,7 +1627,7 @@ static void x86_cpuid_version_get_stepping(Object *obj, Visitor *v, } static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v, - void *opaque, const char *name, + const char *name, void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); @@ -1719,8 +1723,8 @@ static void x86_cpuid_set_model_id(Object *obj, const char *model_id, } } -static void x86_cpuid_get_tsc_freq(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_get_tsc_freq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); int64_t value; @@ -1729,8 +1733,8 @@ static void x86_cpuid_get_tsc_freq(Object *obj, Visitor *v, void *opaque, visit_type_int(v, name, &value, errp); } -static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); const int64_t min = 0; @@ -1752,8 +1756,8 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque, cpu->env.tsc_khz = cpu->env.user_tsc_khz = value / 1000; } -static void x86_cpuid_get_apic_id(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_get_apic_id(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); int64_t value = cpu->apic_id; @@ -1761,8 +1765,8 @@ static void x86_cpuid_get_apic_id(Object *obj, Visitor *v, void *opaque, visit_type_int(v, name, &value, errp); } -static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); DeviceState *dev = DEVICE(obj); @@ -1797,8 +1801,9 @@ static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque, } /* Generic getter for "feature-words" and "filtered-features" properties */ -static void x86_cpu_get_feature_words(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_cpu_get_feature_words(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { uint32_t *array = (uint32_t *)opaque; FeatureWord w; @@ -1826,8 +1831,8 @@ static void x86_cpu_get_feature_words(Object *obj, Visitor *v, void *opaque, error_propagate(errp, err); } -static void x86_get_hv_spinlocks(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_get_hv_spinlocks(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { X86CPU *cpu = X86_CPU(obj); int64_t value = cpu->hyperv_spinlock_attempts; @@ -1835,8 +1840,8 @@ static void x86_get_hv_spinlocks(Object *obj, Visitor *v, void *opaque, visit_type_int(v, name, &value, errp); } -static void x86_set_hv_spinlocks(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) +static void x86_set_hv_spinlocks(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { const int64_t min = 0xFFF; const int64_t max = UINT_MAX; @@ -2944,22 +2949,16 @@ typedef struct BitProperty { uint32_t mask; } BitProperty; -static void x86_cpu_get_bit_prop(Object *obj, - Visitor *v, - void *opaque, - const char *name, - Error **errp) +static void x86_cpu_get_bit_prop(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { BitProperty *fp = opaque; bool value = (*fp->ptr & fp->mask) == fp->mask; visit_type_bool(v, name, &value, errp); } -static void x86_cpu_set_bit_prop(Object *obj, - Visitor *v, - void *opaque, - const char *name, - Error **errp) +static void x86_cpu_set_bit_prop(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev = DEVICE(obj); BitProperty *fp = opaque; diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 82f85f9ba2..bd0cffca23 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8035,8 +8035,8 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data) pcc->l1_icache_size = 0x10000; } -static void powerpc_get_compat(Object *obj, Visitor *v, - void *opaque, const char *name, Error **errp) +static void powerpc_get_compat(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { char *value = (char *)""; Property *prop = opaque; @@ -8063,8 +8063,8 @@ static void powerpc_get_compat(Object *obj, Visitor *v, visit_type_str(v, name, &value, errp); } -static void powerpc_set_compat(Object *obj, Visitor *v, - void *opaque, const char *name, Error **errp) +static void powerpc_set_compat(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { Error *error = NULL; char *value = NULL; diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index e728611b31..07c182338b 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -116,22 +116,16 @@ static void test_static_globalprop(void) #define TYPE_UNUSED_HOTPLUG "hotplug-type" #define TYPE_UNUSED_NOHOTPLUG "nohotplug-type" -static void prop1_accessor(Object *obj, - Visitor *v, - void *opaque, - const char *name, - Error **errp) +static void prop1_accessor(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MyType *mt = DYNAMIC_TYPE(obj); visit_type_uint32(v, name, &mt->prop1, errp); } -static void prop2_accessor(Object *obj, - Visitor *v, - void *opaque, - const char *name, - Error **errp) +static void prop2_accessor(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { MyType *mt = DYNAMIC_TYPE(obj); -- cgit v1.2.3