All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: mirror - insure that errp is not NULL
@ 2014-02-12 19:46 Jeff Cody
  2014-02-12 19:55 ` Eric Blake
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jeff Cody @ 2014-02-12 19:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, famz, armbru, stefanha

When starting a block job, commit_active_start() relies on whether *errp
is set by mirror_start_job.  This allows it to determine if the mirror
job start failed, so that it can clean up any changes to open flags from
the bdrv_reopen().  If errp is NULL, then it will not be able to
determine if mirror_start_job failed or not.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 block/mirror.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/mirror.c b/block/mirror.c
index 2a43334..41bb83c 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -634,6 +634,8 @@ void commit_active_start(BlockDriverState *bs, BlockDriverState *base,
     int64_t length, base_length;
     int orig_base_flags;
 
+    assert(errp != NULL);
+
     orig_base_flags = bdrv_get_flags(base);
 
     if (bdrv_reopen(base, bs->open_flags, errp)) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-14 15:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 19:46 [Qemu-devel] [PATCH] block: mirror - insure that errp is not NULL Jeff Cody
2014-02-12 19:55 ` Eric Blake
2014-02-13  6:43   ` Markus Armbruster
2014-02-13  6:40 ` Markus Armbruster
2014-02-13  6:46   ` Fam Zheng
2014-02-13  8:41 ` Kevin Wolf
2014-02-14 15:14   ` Stefan Hajnoczi
2014-02-14 15:17 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.