qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.
@ 2013-05-16 17:06 fred.konrad
  2013-05-16 19:07 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.' mdroth
  2013-05-22 22:58 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: fred.konrad @ 2013-05-16 17:06 UTC (permalink / raw)
  To: qemu-devel, aliguori
  Cc: cornelia.huck, pbonzini, mark.burton, mdroth, fred.konrad

From: KONRAD Frederic <fred.konrad@greensocs.com>

This adds virtio_bus_get_dev_path to fix migration id string which is wrong
since the virtio refactoring.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: mdroth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-bus.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
index aab72ff..ea2e11a 100644
--- a/hw/virtio/virtio-bus.c
+++ b/hw/virtio/virtio-bus.c
@@ -154,12 +154,26 @@ void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config)
     }
 }
 
+static char *virtio_bus_get_dev_path(DeviceState *dev)
+{
+    BusState *bus = qdev_get_parent_bus(dev);
+    DeviceState *proxy = DEVICE(bus->parent);
+    return qdev_get_dev_path(proxy);
+}
+
+static void virtio_bus_class_init(ObjectClass *klass, void *data)
+{
+    BusClass *bus_class = BUS_CLASS(klass);
+    bus_class->get_dev_path = virtio_bus_get_dev_path;
+}
+
 static const TypeInfo virtio_bus_info = {
     .name = TYPE_VIRTIO_BUS,
     .parent = TYPE_BUS,
     .instance_size = sizeof(VirtioBusState),
     .abstract = true,
     .class_size = sizeof(VirtioBusClass),
+    .class_init = virtio_bus_class_init
 };
 
 static void virtio_register_types(void)
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.'
  2013-05-16 17:06 [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path fred.konrad
@ 2013-05-16 19:07 ` mdroth
  2013-05-22 22:58 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: mdroth @ 2013-05-16 19:07 UTC (permalink / raw)
  To: fred.konrad; +Cc: cornelia.huck, pbonzini, aliguori, mark.burton, qemu-devel

On Thu, May 16, 2013 at 07:06:07PM +0200, fred.konrad@greensocs.com wrote:
> From: KONRAD Frederic <fred.konrad@greensocs.com>
> 
> This adds virtio_bus_get_dev_path to fix migration id string which is wrong
> since the virtio refactoring.
> 
> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Cc: mdroth <mdroth@linux.vnet.ibm.com>

Re-tested the failure scenario with this patch applied and this does
seem to resolve the issue. For reference, the configuration was v1.4.0
<-> 1.5.0-rc2+fix using the following options:

x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios -M
pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd
boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive
file=disk1.img,if=virtio -drive file=disk2.img,if=virtio -device
virtio-net-pci,netdev=net0 -netdev user,id=net0

Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>

> ---
>  hw/virtio/virtio-bus.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
> index aab72ff..ea2e11a 100644
> --- a/hw/virtio/virtio-bus.c
> +++ b/hw/virtio/virtio-bus.c
> @@ -154,12 +154,26 @@ void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config)
>      }
>  }
> 
> +static char *virtio_bus_get_dev_path(DeviceState *dev)
> +{
> +    BusState *bus = qdev_get_parent_bus(dev);
> +    DeviceState *proxy = DEVICE(bus->parent);
> +    return qdev_get_dev_path(proxy);
> +}
> +
> +static void virtio_bus_class_init(ObjectClass *klass, void *data)
> +{
> +    BusClass *bus_class = BUS_CLASS(klass);
> +    bus_class->get_dev_path = virtio_bus_get_dev_path;
> +}
> +
>  static const TypeInfo virtio_bus_info = {
>      .name = TYPE_VIRTIO_BUS,
>      .parent = TYPE_BUS,
>      .instance_size = sizeof(VirtioBusState),
>      .abstract = true,
>      .class_size = sizeof(VirtioBusClass),
> +    .class_init = virtio_bus_class_init
>  };
> 
>  static void virtio_register_types(void)
> -- 
> 1.7.11.7
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.
  2013-05-16 17:06 [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path fred.konrad
  2013-05-16 19:07 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.' mdroth
@ 2013-05-22 22:58 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2013-05-22 22:58 UTC (permalink / raw)
  To: fred.konrad, qemu-devel, aliguori
  Cc: mark.burton, mdroth, cornelia.huck, pbonzini

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-22 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16 17:06 [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path fred.konrad
2013-05-16 19:07 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path.' mdroth
2013-05-22 22:58 ` [Qemu-devel] [PATCH for-1.5] virtio: add virtio_bus_get_dev_path Anthony Liguori

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).