qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, jlarrew@linux.vnet.ibm.com,
	anthony@codemonkey.ws, fred.konrad@greensocs.com
Subject: Re: [Qemu-devel] [PATCH RFT 1/5] virtio-blk-dataplane: Improve error reporting
Date: Mon, 29 Jul 2013 22:19:37 +0200	[thread overview]
Message-ID: <51F6CE59.70708@suse.de> (raw)
In-Reply-To: <20130610113909.GB32662@stefanha-thinkpad.redhat.com>

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 <afaerber@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 <stefanha@redhat.com>
> Acked-by: Stefan Hajnoczi <stefanha@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

  reply	other threads:[~2013-07-29 20:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 18:18 [Qemu-devel] [PATCH RFT 0/5] QOM realize for virtio Andreas Färber
2013-06-07 18:18 ` [Qemu-devel] [PATCH RFT 1/5] virtio-blk-dataplane: Improve error reporting Andreas Färber
2013-06-10 11:39   ` Stefan Hajnoczi
2013-07-29 20:19     ` Andreas Färber [this message]
2013-06-07 18:18 ` [Qemu-devel] [PATCH RFT 2/5] virtio: Convert VirtioDevice to QOM realize/unrealize Andreas Färber
2013-06-08  2:22   ` Peter Crosthwaite
2013-06-08  9:55     ` Andreas Färber
2013-06-08 12:32       ` Peter Crosthwaite
2013-06-10  2:08         ` Anthony Liguori
2013-06-10  6:30           ` Michael S. Tsirkin
2013-06-12  9:15           ` Andreas Färber
2013-06-13  1:48             ` Peter Crosthwaite
2013-06-18  9:57             ` Peter Crosthwaite
2013-06-09 10:36   ` Michael S. Tsirkin
2013-06-07 18:18 ` [Qemu-devel] [PATCH RFT 3/5] virtio-console: QOM'ify VirtConsole Andreas Färber
2013-06-07 18:18 ` [Qemu-devel] [PATCH RFT 4/5] virtio-console: Use exitfn for virtserialport, too Andreas Färber
2013-07-29 23:25   ` Andreas Färber
2013-06-07 18:19 ` [Qemu-devel] [PATCH RFT 5/5] virtio-serial-port: Convert to QOM realize/unrealize Andreas Färber
2013-06-09 10:39 ` [Qemu-devel] [PATCH RFT 0/5] QOM realize for virtio Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F6CE59.70708@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=fred.konrad@greensocs.com \
    --cc=jlarrew@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).