From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynxsv-0001cX-IB for qemu-devel@nongnu.org; Thu, 30 Apr 2015 19:28:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ynxsu-00066i-EL for qemu-devel@nongnu.org; Thu, 30 Apr 2015 19:28:49 -0400 From: Don Slutz Message-ID: <5542BAA2.3060802@Verizon.com> Date: Thu, 30 Apr 2015 19:28:34 -0400 MIME-Version: 1.0 References: <1430418196-8691-1-git-send-email-dslutz@verizon.com> <55427F5A.5090608@redhat.com> <20150430201534.GB3545@noname.redhat.com> In-Reply-To: <20150430201534.GB3545@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Eric Blake Cc: Paolo Bonzini , qemu block , "qemu-devel@nongnu.org" , "Slutz, Donald Christopher" On 04/30/15 16:15, Kevin Wolf wrote: > Am 30.04.2015 um 21:15 hat Eric Blake geschrieben: >> [adding qemu-block] >> >> On 04/30/2015 12:23 PM, Don Slutz wrote: >>> ~/qemu/out/master/x86_64-softmmu/qemu-system-x86_64 -h | head >>> QEMU emulator version 2.3.50, Copyright (c) 2003-2008 Fabrice >>> Bellard usage: qemu-system-x86_64 [options] [disk_image] >>> >>> 'disk_image' is a raw hard disk image for IDE hard disk 0 >>> >>> Standard options: ... >>> >>> Signed-off-by: Don Slutz --- vl.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> Reviewed-by: Eric Blake >> >> Without this, qemu will try to probe formats. It is arguably is >> more convenient when using the shorthand of supplying a disk >> image to let qemu pick the format; but as the --help text says >> the image is raw, it's better to be explicit and avoid probing. >> Besides, we can always use longhand to specify actual format >> and/or probing if we don't like the shorthand. > > I don't think you can take an outdated help text as a justification > for breaking backwards compatibility. > Is this a hard no, soft no, or TBD? The following is what prompted this: WARNING: Image format was not specified for '/dev/etherd/e500.1' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. which I would say also breaks backwards compatibility. However I do agree that this is the "right" change to have done. However there currently is no way to specify that the 'disk_image' is raw. Also the old options (-hda, -hdb, -hdc, and -hdd) all have similar issues. So do you want a more complex patch that allows the format to be specified? Only for 'disk_image'? Include -hd* ? Change the help message also? -Don Slutz > Kevin > >>> >>> diff --git a/vl.c b/vl.c index 74c2681..93e674f 100644 --- >>> a/vl.c +++ b/vl.c @@ -1084,6 +1084,7 @@ static int >>> cleanup_add_fd(QemuOpts *opts, void *opaque) /* QEMU Block >>> devices */ >>> >>> #define HD_OPTS "media=disk" +#define HD_OPTS_RAW >>> "media=disk,format=raw" #define CDROM_OPTS "media=cdrom" >>> #define FD_OPTS "" #define PFLASH_OPTS "" @@ -2862,7 +2863,7 @@ >>> int main(int argc, char **argv, char **envp) if (optind >= >>> argc) break; if (argv[optind][0] != '-') { - >>> hda_opts = drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS); + >>> hda_opts = drive_add(IF_DEFAULT, 0, argv[optind++], >>> HD_OPTS_RAW); } else { const QEMUOption *popt; >>> >>> >> >> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt >> virtualization library http://libvirt.org >> > >