qom: Swap 'name' next to visitor in ObjectPropertyAccessor

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 <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Eric Blake 2016-01-29 06:48:55 -07:00 committed by Markus Armbruster
parent 51e72bc1dd
commit d7bce9999d
28 changed files with 278 additions and 287 deletions

View file

@ -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);

View file

@ -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;