From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4747] Add image format option in monitor for removable media
Date: Wed, 18 Jun 2008 22:10:02 +0000 [thread overview]
Message-ID: <E1K95qs-0007oC-L1@cvs.savannah.gnu.org> (raw)
Revision: 4747
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4747
Author: aurel32
Date: 2008-06-18 22:10:01 +0000 (Wed, 18 Jun 2008)
Log Message:
-----------
Add image format option in monitor for removable media
(Chris Wright)
CVE-2008-1945
Modified Paths:
--------------
trunk/monitor.c
Modified: trunk/monitor.c
===================================================================
--- trunk/monitor.c 2008-06-18 09:32:32 UTC (rev 4746)
+++ trunk/monitor.c 2008-06-18 22:10:01 UTC (rev 4747)
@@ -396,18 +396,26 @@
eject_device(bs, force);
}
-static void do_change_block(const char *device, const char *filename)
+static void do_change_block(const char *device, const char *filename, const char *fmt)
{
BlockDriverState *bs;
+ BlockDriver *drv = NULL;
bs = bdrv_find(device);
if (!bs) {
term_printf("device not found\n");
return;
}
+ if (fmt) {
+ drv = bdrv_find_format(fmt);
+ if (!drv) {
+ term_printf("invalid format %s\n", fmt);
+ return;
+ }
+ }
if (eject_device(bs, 0) < 0)
return;
- bdrv_open(bs, filename, 0);
+ bdrv_open2(bs, filename, 0, drv);
qemu_key_check(bs, filename);
}
@@ -426,12 +434,12 @@
}
}
-static void do_change(const char *device, const char *target)
+static void do_change(const char *device, const char *target, const char *fmt)
{
if (strcmp(device, "vnc") == 0) {
do_change_vnc(target);
} else {
- do_change_block(device, target);
+ do_change_block(device, target, fmt);
}
}
@@ -1339,8 +1347,8 @@
"", "quit the emulator" },
{ "eject", "-fB", do_eject,
"[-f] device", "eject a removable medium (use -f to force it)" },
- { "change", "BF", do_change,
- "device filename", "change a removable medium" },
+ { "change", "BFs?", do_change,
+ "device filename [format]", "change a removable medium, optional format" },
{ "screendump", "F", do_screen_dump,
"filename", "save screen into PPM image 'filename'" },
{ "logfile", "F", do_logfile,
reply other threads:[~2008-06-18 22:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1K95qs-0007oC-L1@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).