From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OB9f4-0006qD-Tr for qemu-devel@nongnu.org; Sun, 09 May 2010 12:47:27 -0400 Received: from [140.186.70.92] (port=40924 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OB9f3-0006pb-Hs for qemu-devel@nongnu.org; Sun, 09 May 2010 12:47:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OB9f1-0008Ad-TP for qemu-devel@nongnu.org; Sun, 09 May 2010 12:47:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22229) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OB9f1-0008AR-Hm for qemu-devel@nongnu.org; Sun, 09 May 2010 12:47:23 -0400 Date: Sun, 9 May 2010 19:47:18 +0300 From: Gleb Natapov Message-ID: <20100509164718.GA4497@redhat.com> References: <20100509152349.GF24787@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Subject: [Qemu-devel] Re: [SeaBIOS] [PATCH] Support for booting from virtio disks List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org On Sun, May 09, 2010 at 05:31:16PM +0100, Stefan Hajnoczi wrote: > On Sun, May 9, 2010 at 4:23 PM, Gleb Natapov wrote: > Neat! I believe SeaBIOS will see virtio-blk devices as harddisks and > not attempt to boot ISOs? Many existing OS installers probably cannot > boot from virtio-blk, but in the longer term folks might like to get > rid of ATAPI CD-ROMs in their VMs. >=20 The patch assumes that all virtio-blk devices are disks and it can boot =66rom any of virtio-blk disks if there is more then one. I am not sure CDROM can be attached via virtio-blk interface. > > + =9A =9A =9A =9Achar *desc =3D malloc_tmphigh(MAXDESCSIZE); > > + =9A =9A =9A =9Astruct virtiodrive_s *vdrive_g =3D malloc_fseg(sizeof(= *vdrive_g)); > > + =9A =9A =9A =9Astruct vring_virtqueue *vq =3D malloc_low(sizeof(*vq)); > > + =9A =9A =9A =9Aif (!vdrive_g || !desc || !vq) { > > + =9A =9A =9A =9A =9A =9Awarn_noalloc(); > > + =9A =9A =9A =9A =9A =9Areturn; > > + =9A =9A =9A =9A} > [...] > > + =9A =9A =9A =9Aif (vp_find_vq(ioaddr, 0, vdrive_g->vq) < 0 ) { > > + =9A =9A =9A =9A =9A =9Afree(vdrive_g); > > + =9A =9A =9A =9A =9A =9Adprintf(1, "fail to find vq for virtio-blk %x:= %x\n", > > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Apci_bdf_to_bus (bdf), pci_bdf_= to_dev(bdf)); > > + =9A =9A =9A =9A =9A =9Acontinue; > > + =9A =9A =9A =9A} >=20 > Are desc, vdrive_g, and/or vq getting leaked on error? >=20 vdrive_g is freed, but desc and vq are leaked. Will fix. Thanks! -- Gleb.