aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.texi
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-03-19 11:20:20 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-15 14:29:20 -0500
commite6b636779b51c97e67694be740ee972c52460c59 (patch)
tree132813125593e7128b06d88fc88f27530599a430 /qemu-nbd.texi
parent0ca5aa4f4c4a8bcc73988dd52a536241d35e5223 (diff)
Add -f FMT / --format FMT arg to qemu-nbd
Currently the qemu-nbd program will auto-detect the format of any disk it is given. This behaviour is known to be insecure. For example, if qemu-nbd initially exposes a 'raw' file to an unprivileged app, and that app runs 'qemu-img create -f qcow2 -o backing_file=/etc/shadow /dev/nbd0' then the next time the app is started, the qemu-nbd will now detect it as a 'qcow2' file and expose /etc/shadow to the unprivileged app. The only way to avoid this is to explicitly tell qemu-nbd what disk format to use on the command line, completely disabling auto-detection. This patch adds a '-f' / '--format' arg for this purpose, mirroring what is already available via qemu-img and qemu commands. qemu-nbd --format raw -p 9000 evil.img will now always use raw, regardless of what format 'evil.img' looks like it contains Signed-off-by: Daniel P. Berrange <berrange@redhat.com> [Use errx, not err. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-nbd.texi')
-rw-r--r--qemu-nbd.texi2
1 files changed, 2 insertions, 0 deletions
diff --git a/qemu-nbd.texi b/qemu-nbd.texi
index 5f3f3e3276..6055ec693b 100644
--- a/qemu-nbd.texi
+++ b/qemu-nbd.texi
@@ -45,6 +45,8 @@ Export QEMU disk image using NBD protocol.
disconnect the specified device
@item -e, --shared=@var{num}
device can be shared by @var{num} clients (default @samp{1})
+@item -f, --format=@var{fmt}
+ force block driver for format @var{fmt} instead of auto-detecting
@item -t, --persistent
don't exit on the last connection
@item -v, --verbose