Re: kvm-87: qemu-img creates raw file with wrong size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Regards,

Anthony Liguori

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux