Skip to content

Commit

Permalink
virtio: add virtio_bus_get_dev_path.
Browse files Browse the repository at this point in the history
This adds virtio_bus_get_dev_path to fix migration id string which is wrong
since the virtio refactoring.

Signed-off-by: KONRAD Frederic <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Cc: mdroth <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
konrad-fred authored and Anthony Liguori committed May 16, 2013
1 parent c49fdf1 commit 6d46895
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hw/virtio/virtio-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d46895

Please sign in to comment.