Fixup some dynamic casts in the Qemu device tree to correspond to the QOM type-checking system. These patches change from using Linux kernel style upcasts to typesafe object oriented casts with runtime checking semantics.
PATCH 1/1 Fixup some dynamic casts in the Qemu device tree to correspond to the QOM type-checking system. These patches change from using Linux kernel style upcasts to typesafe object oriented casts with runtime checking semantics.
These patches apply to Paolo Bonzini's rcu tree:
https://github.com/bonzini/qemu/tree/rcu
commit 781e47bf1693a80b84eec298a6a1c7b29ab2c135
--- hw/misc/ivshmem.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 6 +++--- hw/pci/pci_bridge.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
hw/misc/ivshmem.c +1 -1
@@ -789,7 +789,7 @@ static void pci_ivshmem_uninit(PCIDevice *dev)static void pci_ivshmem_instance_finalize (Object *obj) { -IVShmemState *s =IVSHMEM (dev); +IVShmemState *s =IVSHMEM (obj);if (s->migration_blocker) {migrate_del_blocker (s->migration_blocker);
hw/pci-bridge/pci_bridge_dev.c +3 -3
@@ -87,7 +87,6 @@ shpc_error: bridge_error:return err; } -static void pci_bridge_dev_exitfn (PCIDevice *dev) {PCIBridgeDev *bridge_dev =PCI_BRIDGE_DEV (dev);
@@ -102,8 +101,9 @@ static void pci_bridge_dev_exitfn(PCIDevice *dev)static void pci_bridge_dev_instance_finalize (Object *obj) {PCIDevice *dev =PCI_DEVICE (obj); -PCIBridge *br =DO_UPCAST (PCIBridge, dev, dev); -PCIBridgeDev *bridge_dev =DO_UPCAST (PCIBridgeDev, bridge, br); +PCIBridge *br =PCI_BRIDGE (dev); +PCIBridgeDev *bridge_dev =PCI_BRIDGE_DEV (br); +shpc_free (dev);memory_region_destroy (&bridge_dev->bar);pci_bridge_free (dev);
hw/pci/pci_bridge.c +1 -1
@@ -391,7 +391,7 @@ void pci_bridge_exitfn(PCIDevice *pci_dev)void pci_bridge_free (PCIDevice *pci_dev) { -PCIBridge *s =DO_UPCAST (PCIBridge, dev, pci_dev); +PCIBridge *s =PCI_BRIDGE (pci_dev);pci_bridge_region_cleanup (s, s->windows);memory_region_destroy (&s->address_space_mem);memory_region_destroy (&s->address_space_io);
Signature · 1 line
1.8.3.1
Quoted 17 lines · Mike Day
These patches apply to Paolo Bonzini's rcu tree:
https://github.com/bonzini/qemu/tree/rcu
commit781e47bf1693a80b84eec298a6a1c7b29ab2c135Signed-off-by Mike Day <[email protected]>--- hw/misc/ivshmem.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 6 +++--- hw/pci/pci_bridge.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)hw/misc/ivshmem.c +0
-0
hw/misc/ivshmem.c static void pci_ivshmem_uninit(PCIDevice *dev) · line 792
Quoted 5 lines
hw/misc/ivshmem.c +1
-1@@ -789,7 +789,7 @@ static void pci_ivshmem_uninit(PCIDevice *dev)static void pci_ivshmem_instance_finalize (Object *obj) { -IVShmemState *s =IVSHMEM (dev); +IVShmemState *s =IVSHMEM (obj);
This should have been a flat-out compiler error, right?
hw/pci-bridge/pci_bridge_dev.c shpc_error: · line 90
Quoted 11 lines
hw/misc/ivshmem.c +0
-0if (s->migration_blocker) {migrate_del_blocker (s->migration_blocker);hw/pci-bridge/pci_bridge_dev.c +0
-1@@ -87,7 +87,6 @@ shpc_error: bridge_error:return err; } -
Stray blank line change.
thanks
-- PMM
Quoted 19 lines · Peter Maydell
Quoted 18 lines · Mike Day
These patches apply to Paolo Bonzini's rcu tree:
https://github.com/bonzini/qemu/tree/rcu
commit781e47bf1693a80b84eec298a6a1c7b29ab2c135Signed-off-by Mike Day <[email protected]>--- hw/misc/ivshmem.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 6 +++--- hw/pci/pci_bridge.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)hw/misc/ivshmem.c +0
-0@@ -789,7 +789,7 @@ static void pci_ivshmem_uninit(PCIDevice *dev)
Quoted 6 lines
hw/misc/ivshmem.c static void pci_ivshmem_uninit(PCIDevice *dev) · line 792
Quoted 4 lines
hw/misc/ivshmem.c +1
-1static void pci_ivshmem_instance_finalize (Object *obj) { -IVShmemState *s =IVSHMEM (dev); +IVShmemState *s =IVSHMEM (obj);This should have been a flat-out compiler error, right?
Yes, correct, but Paolo hasn't previously submitted this specific change code afaik.
Quoted 5 lines
Quoted 5 lines
hw/misc/ivshmem.c +0
-0if (s->migration_blocker) {migrate_del_blocker (s->migration_blocker);hw/pci-bridge/pci_bridge_dev.c +0
-1--- a/hw/pci-bridge/pci_bridge_dev.c
Quoted 8 lines
hw/pci-bridge/pci_bridge_dev.c shpc_error: · line 90
Quoted 6 lines
+++
b/hw/pci-bridge/pci_bridge_dev.chw/pci-bridge/pci_bridge_dev.c +0
-1@@ -87,7 +87,6 @@ shpc_error: bridge_error:return err; } -Stray blank line change.
Thanks - and git just found it for me too. Apologies.
Mike
Signature · 2 lines
Mike Day | + 1 919 371-8786 | [email protected] "Endurance is a Virtue"
Il 19/08/2013 20:57, Mike Day ha scritto:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
hw/misc/ivshmem.c +0
-0@@ -789,7 +789,7 @@ static void pci_ivshmem_uninit(PCIDevice *dev)
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
hw/misc/ivshmem.c static void pci_ivshmem_uninit(PCIDevice *dev) · line 792
Quoted 4 lines
hw/misc/ivshmem.c +1
-1static void pci_ivshmem_instance_finalize (Object *obj) { -IVShmemState *s =IVSHMEM (dev); +IVShmemState *s =IVSHMEM (obj);This should have been a flat-out compiler error, right?
Yes, correct, but Paolo hasn't previously submitted this specific change code afaik.
Yes, it's just a conflict resolution pasto.
I squashed the changes into the branch.
Paolo
On 08/19/2013 12:33 PM, Mike Day wrote:
Your subject line is atrociously long. Please put a blank line between the summary (ca. 60 characters or less) and the rest of your commit message. 'git shortlog -30' will give you a hint on typical summary naming.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org