block: Add blk_new_with_bs() helper
commita3aeeab557f08285c4fcf537fca575b069eb67ef
authorEric Blake <eblake@redhat.com>
Tue, 28 Apr 2020 19:26:46 +0000 (28 14:26 -0500)
committerMax Reitz <mreitz@redhat.com>
Tue, 5 May 2020 11:17:36 +0000 (5 13:17 +0200)
treec7baa354e4f6b9bd1d62f570c2da8cb84e6397c5
parent52ea799e9631ff00c230f1fed50986246149d8f2
block: Add blk_new_with_bs() helper

There are several callers that need to create a new block backend from
an existing BDS; make the task slightly easier with a common helper
routine.

Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200424190903.522087-2-eblake@redhat.com>
[mreitz: Set @ret only in error paths, see
 https://lists.nongnu.org/archive/html/qemu-block/2020-04/msg01216.html]
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200428192648.749066-2-eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
14 files changed:
block/block-backend.c
block/crypto.c
block/parallels.c
block/qcow.c
block/qcow2.c
block/qed.c
block/sheepdog.c
block/vdi.c
block/vhdx.c
block/vmdk.c
block/vpc.c
blockdev.c
blockjob.c
include/sysemu/block-backend.h