From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] block: Let blockdev-create return 0 on success
Date: Fri, 23 Aug 2019 20:47:32 +0200 [thread overview]
Message-ID: <20190823184733.18929-2-mreitz@redhat.com> (raw)
In-Reply-To: <20190823184733.18929-1-mreitz@redhat.com>
Block drivers should let their .bdrv_co_create() implementation return a
non-negative value to indicate success. However, jobs should return
exactly 0. Thus, we need to translate positive return values to 0 in
blockdev_create_run().
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/create.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/create.c b/block/create.c
index 1bd00ed5f8..4b23672e1b 100644
--- a/block/create.c
+++ b/block/create.c
@@ -48,7 +48,8 @@ static int coroutine_fn blockdev_create_run(Job *job, Error **errp)
qapi_free_BlockdevCreateOptions(s->opts);
- return ret;
+ /* Jobs must return 0 to indicate success */
+ return ret < 0 ? ret : 0;
}
static const JobDriver blockdev_create_job_driver = {
--
2.21.0
next prev parent reply other threads:[~2019-08-23 19:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 18:47 [Qemu-devel] [PATCH 0/2] block: Let blockdev-create return 0 on success Max Reitz
2019-08-23 18:47 ` Max Reitz [this message]
2019-08-23 18:47 ` [Qemu-devel] [PATCH 2/2] iotests: Test blockdev-create for vpc Max Reitz
2019-08-27 21:15 ` John Snow
2019-08-27 21:15 ` [Qemu-devel] [PATCH 0/2] block: Let blockdev-create return 0 on success John Snow
2019-09-02 13:32 ` Kevin Wolf
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=20190823184733.18929-2-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).