qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFT 1/5] virtio-blk-dataplane: Improve error rep


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH RFT 1/5] virtio-blk-dataplane: Improve error reporting
Date: Mon, 29 Jul 2013 22:19:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

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 <address@hidden>
>> ---
>>  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 <address@hidden>
> Acked-by: Stefan Hajnoczi <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]