[Top][All Lists]

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

[Qemu-block] [PATCH v2 1/5] vpc: Return 0 from vpc_co_create() on succes

From: Max Reitz
Subject: [Qemu-block] [PATCH v2 1/5] vpc: Return 0 from vpc_co_create() on success
Date: Mon, 2 Sep 2019 21:33:16 +0200

blockdev_create_run() directly uses .bdrv_co_create()'s return value as
the job's return value.  Jobs must return 0 on success, not just any
nonnegative value.  Therefore, using blockdev-create for VPC images may
currently fail as the vpc driver may return a positive integer.

Because there is no point in returning a positive integer anywhere in
the block layer (all non-negative integers are generally treated as
complete success), we probably do not want to add more such cases.
Therefore, fix this problem by making the vpc driver always return 0 in
case of success.

Suggested-by: Kevin Wolf <address@hidden>
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
 block/vpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/vpc.c b/block/vpc.c
index b25aab0425..5cd3890780 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -885,6 +885,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t 
         goto fail;
+    ret = 0;
     return ret;
@@ -908,7 +909,7 @@ static int create_fixed_disk(BlockBackend *blk, uint8_t 
         return ret;
-    return ret;
+    return 0;
 static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts,

reply via email to

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