diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-05-16 19:06:07 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-16 14:18:38 -0500 |
commit | 6d46895b51103fa26c97ee0e0d895c004e9594d7 (patch) | |
tree | b9e9d76edbdb0c478b66a4e077ed8b74f174676f /hw/virtio | |
parent | c49fdf137f0ff74804e421f157297ab0ded5d012 (diff) |
virtio: add virtio_bus_get_dev_path.
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>
Message-id: 1368723967-21050-1-git-send-email-fred.konrad@greensocs.com
Cc: mdroth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/virtio-bus.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index aab72ffb42..ea2e11ae95 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) |