]> Git Repo - qemu.git/commitdiff
vpc: Return 0 from vpc_co_create() on success
authorMax Reitz <[email protected]>
Mon, 2 Sep 2019 19:33:16 +0000 (21:33 +0200)
committerKevin Wolf <[email protected]>
Tue, 10 Sep 2019 06:58:43 +0000 (08:58 +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 <[email protected]>
Cc: [email protected]
Signed-off-by: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/vpc.c

index b25aab042544906533c757b35ceb082f7464d6ea..5cd38907808b0a7d877713708b96d420fda0b9ca 100644 (file)
@@ -885,6 +885,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
         goto fail;
     }
 
+    ret = 0;
  fail:
     return ret;
 }
@@ -908,7 +909,7 @@ static int create_fixed_disk(BlockBackend *blk, uint8_t *buf,
         return ret;
     }
 
-    return ret;
+    return 0;
 }
 
 static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts,
This page took 0.029133 seconds and 4 git commands to generate.