* [Qemu-devel] [PATCH] 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.
@ 2013-08-19 18:33 Mike Day
2013-08-19 18:47 ` Peter Maydell
2013-08-19 19:25 ` Eric Blake
0 siblings, 2 replies; 5+ messages in thread
From: Mike Day @ 2013-08-19 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: Mike Day, Paolo Bonzini
These patches apply to Paolo Bonzini's rcu tree:
https://github.com/bonzini/qemu/tree/rcu
commit 781e47bf1693a80b84eec298a6a1c7b29ab2c135
Signed-off-by: Mike Day <ncmike@ncultra.org>
---
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(-)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index ebcb52a..46d8c27 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -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);
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index c995d5d..22caf14 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -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);
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index 63f9912..307e076 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -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);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] 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.
2013-08-19 18:33 [Qemu-devel] [PATCH] 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 Mike Day
@ 2013-08-19 18:47 ` Peter Maydell
2013-08-19 18:57 ` Mike Day
2013-08-19 19:25 ` Eric Blake
1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2013-08-19 18:47 UTC (permalink / raw)
To: Mike Day; +Cc: Paolo Bonzini, qemu-devel
On 19 August 2013 19:33, Mike Day <ncmike@ncultra.org> wrote:
> These patches apply to Paolo Bonzini's rcu tree:
>
> https://github.com/bonzini/qemu/tree/rcu
> commit 781e47bf1693a80b84eec298a6a1c7b29ab2c135
>
> Signed-off-by: Mike Day <ncmike@ncultra.org>
> ---
> 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(-)
>
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index ebcb52a..46d8c27 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -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?
> if (s->migration_blocker) {
> migrate_del_blocker(s->migration_blocker);
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index c995d5d..22caf14 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -87,7 +87,6 @@ shpc_error:
> bridge_error:
> return err;
> }
> -
Stray blank line change.
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] 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.
2013-08-19 18:47 ` Peter Maydell
@ 2013-08-19 18:57 ` Mike Day
2013-08-19 20:00 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Mike Day @ 2013-08-19 18:57 UTC (permalink / raw)
To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel
Peter Maydell <peter.maydell@linaro.org> writes:
> On 19 August 2013 19:33, Mike Day <ncmike@ncultra.org> wrote:
>> These patches apply to Paolo Bonzini's rcu tree:
>>
>> https://github.com/bonzini/qemu/tree/rcu
>> commit 781e47bf1693a80b84eec298a6a1c7b29ab2c135
>>
>> Signed-off-by: Mike Day <ncmike@ncultra.org>
>> ---
>> 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(-)
>>
>> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
>> index ebcb52a..46d8c27 100644
>> --- a/hw/misc/ivshmem.c
>> +++ b/hw/misc/ivshmem.c
>> @@ -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?
Yes, correct, but Paolo hasn't previously submitted this specific change
code afaik.
>> if (s->migration_blocker) {
>> migrate_del_blocker(s->migration_blocker);
>> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
>> index c995d5d..22caf14 100644
>> --- a/hw/pci-bridge/pci_bridge_dev.c
>> +++ b/hw/pci-bridge/pci_bridge_dev.c
>> @@ -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
--
Mike Day | + 1 919 371-8786 | ncmike@ncultra.org
"Endurance is a Virtue"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] 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.
2013-08-19 18:33 [Qemu-devel] [PATCH] 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 Mike Day
2013-08-19 18:47 ` Peter Maydell
@ 2013-08-19 19:25 ` Eric Blake
1 sibling, 0 replies; 5+ messages in thread
From: Eric Blake @ 2013-08-19 19:25 UTC (permalink / raw)
To: Mike Day; +Cc: Paolo Bonzini, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] 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.
2013-08-19 18:57 ` Mike Day
@ 2013-08-19 20:00 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-08-19 20:00 UTC (permalink / raw)
To: Mike Day; +Cc: Peter Maydell, qemu-devel
Il 19/08/2013 20:57, Mike Day ha scritto:
>>> >> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
>>> >> index ebcb52a..46d8c27 100644
>>> >> --- a/hw/misc/ivshmem.c
>>> >> +++ b/hw/misc/ivshmem.c
>>> >> @@ -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?
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-19 20:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 18:33 [Qemu-devel] [PATCH] 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 Mike Day
2013-08-19 18:47 ` Peter Maydell
2013-08-19 18:57 ` Mike Day
2013-08-19 20:00 ` Paolo Bonzini
2013-08-19 19:25 ` Eric Blake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).