Am 10.06.2013 13:39, schrieb Stefan Hajnoczi: > On Fri, Jun 07, 2013 at 08:18:56PM +0200, Andreas Färber wrote: >> Return an Error so that it can be propagated later. >> >> Signed-off-by: Andreas Färber <afaer...@suse.de> >> --- >> hw/block/dataplane/virtio-blk.c | 25 +++++++++++++------------ >> hw/block/dataplane/virtio-blk.h | 5 +++-- >> hw/block/virtio-blk.c | 8 +++++++- >> 3 files changed, 23 insertions(+), 15 deletions(-) > > Tested-by: Stefan Hajnoczi <stefa...@redhat.com> > Acked-by: Stefan Hajnoczi <stefa...@redhat.com>
Needs some more trivial changes since today. Andreas diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index ae82aea..fed9231 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -421,8 +421,9 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIO BlkConf *blk, * block jobs that can conflict. */ if (bdrv_in_use(blk->conf.bs)) { - error_report("cannot start dataplane thread while device is in use"); - return false; + error_setg(errp, + "cannot start dataplane thread while device is in use"); + return; } fd = raw_get_aio_fd(blk->conf.bs); diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 14f292b..5fb006d 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -638,6 +638,7 @@ static void virtio_blk_migration_state_changed(Notifier *notifier, void *data) VirtIOBlock *s = container_of(notifier, VirtIOBlock, migration_state_notifier); MigrationState *mig = data; + Error *err = NULL; if (migration_in_setup(mig)) { if (!s->dataplane) { @@ -652,7 +653,11 @@ static void virtio_blk_migration_state_changed(Notifier *notifier, void *data) } bdrv_drain_all(); /* complete in-flight non-dataplane requests */ virtio_blk_data_plane_create(VIRTIO_DEVICE(s), &s->blk, - &s->dataplane); + &s->dataplane, &err); + if (err != NULL) { + error_report("%s", error_get_pretty(err)); + error_free(err); + } } } #endif /* CONFIG_VIRTIO_BLK_DATA_PLANE */ -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg