On Thu, Aug 19, 2021 at 12:25:01PM +0200, Hanna Reitz wrote:
This post explains when FUSE block exports are useful, how they work,
and that it is fun to export an image file on its own path so it looks
like your image file (in whatever format it was) is a raw image now.
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
You can also find this patch here:
https://gitlab.com/hreitz/qemu-web fuse-blkexport-v1
My first patch to qemu-web, so I hope I am not doing anything overly
stupid here (adding SVGs with extremely long lines comes to mind)...
---
...
+
+Besides attaching guest devices to block nodes, you can also export them for
+users outside of qemu, for example via NBD. Say you have a QMP channel open
for
+the QEMU instance above, then you could do this:
+```json
+{
+ "execute": "nbd-server-start",
+ "arguments": {
+ "addr": {
+ "type": "inet",
+ "data": {
+ "host": "localhost",
+ "port": "10809"
+ }
+ }
+ }
+}
Rather than using a TCP port, is it worth mentioning that you can use
a Unix socket? If the point of this is local access to the disk
contents, that feels a bit lighter weight.
+{
+ "execute": "block-export-add",
+ "arguments": {
+ "type": "nbd",
+ "id": "fmt-node-export",
+ "node-name": "fmt-node",
+ "name": "guest-disk"
+ }
This defaults to a readonly image; you may want to include
"writable":true in the JSON, especially if the purpose is to show how
to modify guest-visible contents of an at-rest disk image.