From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: kvm-87: qemu-img creates raw file with wrong size Date: Mon, 13 Jul 2009 16:40:31 -0500 Message-ID: <4A5BA9CF.9000205@codemonkey.ws> References: <4A5BA908.7080003@vuser.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: KVM list To: Randy Smith Return-path: Received: from mail-qy0-f192.google.com ([209.85.221.192]:59288 "EHLO mail-qy0-f192.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbZGMVkg (ORCPT ); Mon, 13 Jul 2009 17:40:36 -0400 Received: by qyk30 with SMTP id 30so995734qyk.33 for ; Mon, 13 Jul 2009 14:40:34 -0700 (PDT) In-Reply-To: <4A5BA908.7080003@vuser.org> Sender: kvm-owner@vger.kernel.org List-ID: 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