aboutsummaryrefslogtreecommitdiff
path: root/nbd.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-11-18 12:21:17 +0100
committerKevin Wolf <kwolf@redhat.com>2014-12-10 10:31:12 +0100
commite140177d9cd067050004be6f725c3a0750ccdd94 (patch)
tree9a156f5a71cc68af5ccd152449a7840256692223 /nbd.c
parent2c28b21f7c97ae4e2082536f36e97b1337e3d195 (diff)
nbd: Change external interface to BlockBackend
Substitute BlockDriverState by BlockBackend in every globally visible function provided by nbd. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1416309679-333-5-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'nbd.c')
-rw-r--r--nbd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nbd.c b/nbd.c
index a7bce45117..3fd57433b9 100644
--- a/nbd.c
+++ b/nbd.c
@@ -19,6 +19,7 @@
#include "block/nbd.h"
#include "block/block.h"
#include "block/block_int.h"
+#include "sysemu/block-backend.h"
#include "block/coroutine.h"
@@ -957,10 +958,10 @@ static void bs_aio_detach(void *opaque)
exp->ctx = NULL;
}
-NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset,
- off_t size, uint32_t nbdflags,
- void (*close)(NBDExport *))
+NBDExport *nbd_export_new(BlockBackend *blk, off_t dev_offset, off_t size,
+ uint32_t nbdflags, void (*close)(NBDExport *))
{
+ BlockDriverState *bs = blk_bs(blk);
NBDExport *exp = g_malloc0(sizeof(NBDExport));
exp->refcount = 1;
QTAILQ_INIT(&exp->clients);
@@ -1056,9 +1057,9 @@ void nbd_export_put(NBDExport *exp)
}
}
-BlockDriverState *nbd_export_get_blockdev(NBDExport *exp)
+BlockBackend *nbd_export_get_blockdev(NBDExport *exp)
{
- return exp->bs;
+ return exp->bs->blk;
}
void nbd_export_close_all(void)