aboutsummaryrefslogtreecommitdiff
path: root/block/export/vduse-blk.h
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2022-05-23 16:46:09 +0800
committerKevin Wolf <kwolf@redhat.com>2022-06-24 17:07:06 +0200
commit2a2359b84407b35fe978e98b7396f2ab8c5dd8b7 (patch)
tree9ed8b268bc8db0f025db90f5307a822d5fdfb13a /block/export/vduse-blk.h
parenta6caeee8111386b2d16ee07fe817193cde7f0d2a (diff)
downloadqemu-2a2359b84407b35fe978e98b7396f2ab8c5dd8b7.zip
qemu-2a2359b84407b35fe978e98b7396f2ab8c5dd8b7.tar.gz
qemu-2a2359b84407b35fe978e98b7396f2ab8c5dd8b7.tar.bz2
vduse-blk: Implement vduse-blk export
This implements a VDUSE block backends based on the libvduse library. We can use it to export the BDSs for both VM and container (host) usage. The new command-line syntax is: $ qemu-storage-daemon \ --blockdev file,node-name=drive0,filename=test.img \ --export vduse-blk,node-name=drive0,id=vduse-export0,writable=on After the qemu-storage-daemon started, we need to use the "vdpa" command to attach the device to vDPA bus: $ vdpa dev add name vduse-export0 mgmtdev vduse Also the device must be removed via the "vdpa" command before we stop the qemu-storage-daemon. Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220523084611.91-7-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/export/vduse-blk.h')
-rw-r--r--block/export/vduse-blk.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/block/export/vduse-blk.h b/block/export/vduse-blk.h
new file mode 100644
index 0000000..c4eeb1b
--- /dev/null
+++ b/block/export/vduse-blk.h
@@ -0,0 +1,20 @@
+/*
+ * Export QEMU block device via VDUSE
+ *
+ * Copyright (C) 2022 Bytedance Inc. and/or its affiliates. All rights reserved.
+ *
+ * Author:
+ * Xie Yongji <xieyongji@bytedance.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#ifndef VDUSE_BLK_H
+#define VDUSE_BLK_H
+
+#include "block/export.h"
+
+extern const BlockExportDriver blk_exp_vduse_blk;
+
+#endif /* VDUSE_BLK_H */