.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "QEMU-STORAGE-DAEMON" "1" "Nov 22, 2024" "9.1.2" "QEMU" .SH NAME qemu-storage-daemon \- QEMU storage daemon .SH SYNOPSIS .sp \fBqemu\-storage\-daemon\fP [options] .SH DESCRIPTION .sp \fBqemu\-storage\-daemon\fP provides disk image functionality from QEMU, \fBqemu\-img\fP, and \fBqemu\-nbd\fP in a long\-running process controlled via QMP commands without running a virtual machine. It can export disk images, run block job operations, and perform other disk\-related operations. The daemon is controlled via a QMP monitor and initial configuration from the command\-line. .sp The daemon offers the following subset of QEMU features: .INDENT 0.0 .IP \(bu 2 Block nodes .IP \(bu 2 Block jobs .IP \(bu 2 Block exports .IP \(bu 2 Throttle groups .IP \(bu 2 Character devices .IP \(bu 2 Crypto and secrets .IP \(bu 2 QMP .IP \(bu 2 IOThreads .UNINDENT .sp Commands can be sent over a QEMU Monitor Protocol (QMP) connection. See the \fBqemu\-storage\-daemon\-qmp\-ref(7)\fP manual page for a description of the commands. .sp The daemon runs until it is stopped using the \fBquit\fP QMP command or SIGINT/SIGHUP/SIGTERM. .sp \fBWarning:\fP Never modify images in use by a running virtual machine or any other process; this may destroy the image. Also, be aware that querying an image that is being modified by another process may encounter inconsistent state. .SH OPTIONS .sp Standard options: .INDENT 0.0 .TP .B \-h, \-\-help Display help and exit .UNINDENT .INDENT 0.0 .TP .B \-V, \-\-version Display version information and exit .UNINDENT .INDENT 0.0 .TP .B \-T, \-\-trace [[enable=]PATTERN][,events=FILE][,file=FILE] Specify tracing options. .sp \fB[enable=]PATTERN\fP .INDENT 7.0 .INDENT 3.5 Immediately enable events matching \fIPATTERN\fP (either event name or a globbing pattern). This option is only available if QEMU has been compiled with the \fBsimple\fP, \fBlog\fP or \fBftrace\fP tracing backend. To specify multiple events or patterns, specify the \fB\-trace\fP option multiple times. .sp Use \fB\-trace help\fP to print a list of names of trace points. .UNINDENT .UNINDENT .sp \fBevents=FILE\fP .INDENT 7.0 .INDENT 3.5 Immediately enable events listed in \fIFILE\fP\&. The file must contain one event name (as listed in the \fBtrace\-events\-all\fP file) per line; globbing patterns are accepted too. This option is only available if QEMU has been compiled with the \fBsimple\fP, \fBlog\fP or \fBftrace\fP tracing backend. .UNINDENT .UNINDENT .sp \fBfile=FILE\fP .INDENT 7.0 .INDENT 3.5 Log output traces to \fIFILE\fP\&. This option is only available if QEMU has been compiled with the \fBsimple\fP tracing backend. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-blockdev BLOCKDEVDEF is a block node definition. See the \fBqemu(1)\fP manual page for a description of block node properties and the \fBqemu\-block\-drivers(7)\fP manual page for a description of driver\-specific parameters. .UNINDENT .INDENT 0.0 .TP .B \-\-chardev CHARDEVDEF is a character device definition. See the \fBqemu(1)\fP manual page for a description of character device properties. A common character device definition configures a UNIX domain socket: .INDENT 7.0 .INDENT 3.5 .sp .EX \-\-chardev socket,id=char1,path=/var/run/qsd\-qmp.sock,server=on,wait=off .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-export [type=]nbd,id=,node\-name=[,name=][,writable=on|off][,bitmap=] .TP .B \-\-export [type=]vhost\-user\-blk,id=,node\-name=,addr.type=unix,addr.path=[,writable=on|off][,logical\-block\-size=][,num\-queues=] .TP .B \-\-export [type=]vhost\-user\-blk,id=,node\-name=,addr.type=fd,addr.str=[,writable=on|off][,logical\-block\-size=][,num\-queues=] .TP .B \-\-export [type=]fuse,id=,node\-name=,mountpoint=[,growable=on|off][,writable=on|off][,allow\-other=on|off|auto] .TP .B \-\-export [type=]vduse\-blk,id=,node\-name=,name=[,writable=on|off][,num\-queues=][,queue\-size=][,logical\-block\-size=][,serial=] is a block export definition. \fBnode\-name\fP is the block node that should be exported. \fBwritable\fP determines whether or not the export allows write requests for modifying data (the default is off). .sp The \fBnbd\fP export type requires \fB\-\-nbd\-server\fP (see below). \fBname\fP is the NBD export name (if not specified, it defaults to the given \fBnode\-name\fP). \fBbitmap\fP is the name of a dirty bitmap reachable from the block node, so the NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata context name \(dqqemu:dirty\-bitmap:BITMAP\(dq to inspect the bitmap. .sp The \fBvhost\-user\-blk\fP export type takes a vhost\-user socket address on which it accept incoming connections. Both \fBaddr.type=unix,addr.path=\fP for UNIX domain sockets and \fBaddr.type=fd,addr.str=\fP for file descriptor passing are supported. \fBlogical\-block\-size\fP sets the logical block size in bytes (the default is 512). \fBnum\-queues\fP sets the number of virtqueues (the default is 1). .sp The \fBfuse\fP export type takes a mount point, which must be a regular file, on which to export the given block node. That file will not be changed, it will just appear to have the block node\(aqs content while the export is active (very much like mounting a filesystem on a directory does not change what the directory contains, it only shows a different content while the filesystem is mounted). Consequently, applications that have opened the given file before the export became active will continue to see its original content. If \fBgrowable\fP is set, writes after the end of the exported file will grow the block node to fit. The \fBallow\-other\fP option controls whether users other than the user running the process will be allowed to access the export. Note that enabling this option as a non\-root user requires enabling the user_allow_other option in the global fuse.conf configuration file. Setting \fBallow\-other\fP to auto (the default) will try enabling this option, and on error fall back to disabling it. .sp The \fBvduse\-blk\fP export type takes a \fBname\fP (must be unique across the host) to create the VDUSE device. \fBnum\-queues\fP sets the number of virtqueues (the default is 1). \fBqueue\-size\fP sets the virtqueue descriptor table size (the default is 256). .sp The instantiated VDUSE device must then be added to the vDPA bus using the vdpa(8) command from the iproute2 project: .INDENT 7.0 .INDENT 3.5 .sp .EX # vdpa dev add name mgmtdev vduse .EE .UNINDENT .UNINDENT .sp The device can be removed from the vDPA bus later as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX # vdpa dev del .EE .UNINDENT .UNINDENT .sp For more information about attaching vDPA devices to the host with virtio_vdpa.ko or attaching them to guests with vhost_vdpa.ko, see \X'tty: link https://vdpa-dev.gitlab.io/'\fI\%https://vdpa\-dev.gitlab.io/\fP\X'tty: link'\&. .sp For more information about VDUSE, see \X'tty: link https://docs.kernel.org/userspace-api/vduse.html'\fI\%https://docs.kernel.org/userspace\-api/vduse.html\fP\X'tty: link'\&. .UNINDENT .INDENT 0.0 .TP .B \-\-monitor MONITORDEF is a QMP monitor definition. See the \fBqemu(1)\fP manual page for a description of QMP monitor properties. A common QMP monitor definition configures a monitor on character device \fBchar1\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \-\-monitor chardev=char1 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-nbd\-server addr.type=inet,addr.host=,addr.port=[,tls\-creds=][,tls\-authz=][,max\-connections=] .TP .B \-\-nbd\-server addr.type=unix,addr.path=[,tls\-creds=][,tls\-authz=][,max\-connections=] .TP .B \-\-nbd\-server addr.type=fd,addr.str=[,tls\-creds=][,tls\-authz=][,max\-connections=] is a server for NBD exports. Both TCP and UNIX domain sockets are supported. A listen socket can be provided via file descriptor passing (see Examples below). TLS encryption can be configured using \fB\-\-object\fP tls\-creds\-* and authz\-* secrets (see below). .sp To configure an NBD server on UNIX domain socket path \fB/var/run/qsd\-nbd.sock\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \-\-nbd\-server addr.type=unix,addr.path=/var/run/qsd\-nbd.sock .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-object help .TP .B \-\-object ,help .TP .B \-\-object [,=...] is a QEMU user creatable object definition. List object types with \fBhelp\fP\&. List object properties with \fB,help\fP\&. See the \fBqemu(1)\fP manual page for a description of the object properties. .UNINDENT .INDENT 0.0 .TP .B \-\-pidfile PATH is the path to a file where the daemon writes its pid. This allows scripts to stop the daemon by sending a signal: .INDENT 7.0 .INDENT 3.5 .sp .EX $ kill \-SIGTERM $(\fP and \fB\-\-export type=vhost\-user\-blk,addr.type=fd,addr.str=\fP options. .sp Export raw image file \fBdisk.img\fP over NBD UNIX domain socket \fBnbd.sock\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ qemu\-storage\-daemon \e \-\-blockdev driver=file,node\-name=disk,filename=disk.img \e \-\-nbd\-server addr.type=unix,addr.path=nbd.sock \e \-\-export type=nbd,id=export,node\-name=disk,writable=on .EE .UNINDENT .UNINDENT .sp Export a qcow2 image file \fBdisk.qcow2\fP as a vhost\-user\-blk device over UNIX domain socket \fBvhost\-user\-blk.sock\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ qemu\-storage\-daemon \e \-\-blockdev driver=file,node\-name=file,filename=disk.qcow2 \e \-\-blockdev driver=qcow2,node\-name=qcow2,file=file \e \-\-export type=vhost\-user\-blk,id=export,addr.type=unix,addr.path=vhost\-user\-blk.sock,node\-name=qcow2 .EE .UNINDENT .UNINDENT .sp Export a qcow2 image file \fBdisk.qcow2\fP via FUSE on itself, so the disk image file will then appear as a raw image: .INDENT 0.0 .INDENT 3.5 .sp .EX $ qemu\-storage\-daemon \e \-\-blockdev driver=file,node\-name=file,filename=disk.qcow2 \e \-\-blockdev driver=qcow2,node\-name=qcow2,file=file \e \-\-export type=fuse,id=export,node\-name=qcow2,mountpoint=disk.qcow2,writable=on .EE .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBqemu(1)\fP, \fBqemu\-block\-drivers(7)\fP, \fBqemu\-storage\-daemon\-qmp\-ref(7)\fP .SH COPYRIGHT 2024, The QEMU Project Developers .\" Generated by docutils manpage writer. .