Daniel P. Berrange e6b636779b 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>
2013-04-15 14:29:20 -05:00
2013-04-15 10:18:05 +02:00
2013-04-12 14:33:20 +02:00
2012-12-19 08:29:06 +01:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-04 00:28:37 +02:00
2013-03-26 16:16:43 -05:00
2013-03-26 16:16:43 -05:00
2013-03-26 16:16:43 -05:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-13 19:39:59 +00:00
2012-09-07 09:02:44 +03:00
2012-11-01 13:10:06 +01:00
2013-02-21 16:17:31 -06:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2012-05-14 07:27:24 +02:00
2008-10-12 17:54:42 +00:00
2013-03-23 14:25:41 +00:00
2013-02-16 14:50:59 +01:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-02-21 16:17:31 -06:00
2011-12-09 11:25:22 +00:00
2013-03-11 13:32:03 +01:00
2013-02-22 21:21:10 +01:00
2011-12-11 17:50:43 -06:00
2013-02-15 17:40:56 -06:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team
Description
No description provided
Readme 431 MiB
Languages
C 82.9%
C++ 6.4%
Python 3.2%
Dylan 2.9%
Shell 1.6%
Other 2.8%