On Tue, Jun 12, 2018 at 05:51:02PM -0600, Bruce Rogers wrote: > Provide monitor naming of xen disks, including associating an > attached dev_id for a BlockBackend which has legacy_dev set. > Currently, only xen disks have legacy_dev set to true. > > Signed-off-by: Bruce Rogers <brog...@suse.com> > --- > block/block-backend.c | 5 ++++- > hw/block/xen_disk.c | 15 +++++++++++++++ > include/hw/xen/xen.h | 2 ++ > stubs/xen-common.c | 5 +++++ > 4 files changed, 26 insertions(+), 1 deletion(-) > > diff --git a/block/block-backend.c b/block/block-backend.c > index d55c328736..db39dfe867 100644 > --- a/block/block-backend.c > +++ b/block/block-backend.c > @@ -23,6 +23,7 @@ > #include "qemu/option.h" > #include "trace.h" > #include "migration/misc.h" > +#include "hw/xen/xen.h" > > /* Number of coroutines to reserve per attached device model */ > #define COROUTINE_POOL_RESERVATION 64 > @@ -895,7 +896,9 @@ char *blk_get_attached_dev_id(BlockBackend *blk) > { > DeviceState *dev; > > - assert(!blk->legacy_dev); > + if (blk->legacy_dev) { > + return xen_blk_get_attached_dev_id(blk->dev); > + } > dev = blk->dev; > > if (!dev) {
Hi Bruce, Thanks for your patches! But I don't think that the right way to go. We probably needs to qdevifie xen_disk instead. This is point out by the numerous TODO about "qdevified", and this very old mail: https://lists.nongnu.org/archive/html/qemu-devel/2016-09/msg07902.html Thanks, -- Anthony PERARD