From b57e4de079d90caca05fed5b45aeb642c6c29aa0 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 Sep 2020 17:26:52 +0200 Subject: qemu-nbd: Use raw block driver for --offset Instead of implementing qemu-nbd --offset in the NBD code, just put a raw block node with the requested offset on top of the user image and rely on that doing the job. This does not only simplify the nbd_export_new() interface and bring it closer to the set of options that the nbd-server-add QMP command offers, but in fact it also eliminates a potential source for bugs in the NBD code which previously had to add the offset manually in all relevant places. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200924152717.287415-7-kwolf@redhat.com> Acked-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/block/nbd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/block/nbd.h b/include/block/nbd.h index 7698453..451f399 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -331,8 +331,8 @@ typedef struct NBDExport NBDExport; typedef struct NBDClient NBDClient; BlockExport *nbd_export_create(BlockExportOptions *exp_args, Error **errp); -NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, - uint64_t size, const char *name, const char *desc, +NBDExport *nbd_export_new(BlockDriverState *bs, + const char *name, const char *desc, const char *bitmap, bool readonly, bool shared, void (*close)(NBDExport *), bool writethrough, BlockBackend *on_eject_blk, Error **errp); -- cgit v1.1