Message ID | 92f126f40907131448o2700bd4di258064c4249eaa06@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Jul 13, 2009, at 2:48 PM, Randall Smith wrote: > On Mon, Jul 13, 2009 at 3:40 PM, Anthony > Liguori<anthony@codemonkey.ws> wrote: >> Randy Smith wrote: >>> >>> Greetings, >>> >>> Running `qemu-img create -f raw file.raw 1000` creates a 512 byte >>> file >>> rather than the 1000K file the docs imply. >>> >>> From the help message: >>> " >>> 'size' is the disk image size in kilobytes. Optional suffixes >>> 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) >>> are >>> supported any 'k' or 'K' is ignored >>> " >>> >>> Did the default change or is there bug with the create? >>> >> >> No suffix assumes bytes. It truncates to the nearest sector which >> is why >> you see a 512 byte file. If you did `qemu-img create -f raw >> file.raw 1024` >> you would see a file of 1024 bytes. >> >> Not sure if the docs is wrong or this behavior changed. Patch >> either way >> would be appreciated/accepted. > > It looks like the behavior changed. The ubuntu-vm-builder depended on > 'size' defaulting to kilobytes and the help message printed when > qemu-img is run claims that it should default to kilobytes. > > Here's a patch that updates the help message. It doesn't matter to me > if the behavior changed here but as long as the docs match what's > really happening. > > --- qemu-img.c.orig 2009-07-13 15:42:49.000000000 -0600 > +++ qemu-img.c 2009-07-13 15:43:11.000000000 -0600 > @@ -78,7 +78,7 @@ > " content as the input's base image, however the path, > image format, etc may\n" > " differ\n" > " 'fmt' is the disk image format. It is guessed > automatically in most cases\n" > - " 'size' is the disk image size in kilobytes. Optional > suffixes\n" > + " 'size' is the disk image size in bytes. Optional > suffixes\n" > " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * > 1024 * 1024) are\n" > " supported any 'k' or 'K' is ignored\n" > " 'output_filename' is the destination disk image > filename\n" The help message is still incorrect. The 'k' or 'K' suffix is supported also and not ignored like the message says. Lynn Kerby -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- qemu-img.c.orig 2009-07-13 15:42:49.000000000 -0600 +++ qemu-img.c 2009-07-13 15:43:11.000000000 -0600 @@ -78,7 +78,7 @@ " content as the input's base image, however the path, image format, etc may\n" " differ\n" " 'fmt' is the disk image format. It is guessed automatically in most cases\n" - " 'size' is the disk image size in kilobytes. Optional suffixes\n" + " 'size' is the disk image size in bytes. Optional suffixes\n" " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 *