From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtJtK-0005ue-V9 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:18:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtJtJ-0005BP-8H for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:18:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtJtJ-0005BK-1R for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:18:01 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0AFI0ED021020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jan 2013 10:18:00 -0500 Message-ID: <50EEDBA4.4070302@redhat.com> Date: Thu, 10 Jan 2013 16:17:56 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1357828767-2327-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1357828767-2327-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: do not probe zero-sized disks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 10.01.2013 15:39, schrieb Paolo Bonzini: > A blank CD or DVD is visible as a zero-sized disks. Probing such > disks will lead to an EIO and a failure to start the VM. Treating > them as raw is a better solution. > > Signed-off-by: Paolo Bonzini > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block.c b/block.c > index c05875f..b9da10e 100644 > --- a/block.c > +++ b/block.c > @@ -532,7 +532,7 @@ static int find_image_format(const char *filename, BlockDriver **pdrv) > } > > /* Return the raw BlockDriver * to scsi-generic devices or empty drives */ > - if (bs->sg || !bdrv_is_inserted(bs)) { > + if (bs->sg || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) { > bdrv_delete(bs); > drv = bdrv_find_format("raw"); > if (!drv) { > Thanks, rebased and applied to the block branch. Kevin