From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [SeaBIOS] [PATCH] Support for booting from virtio disks Date: Sun, 9 May 2010 19:47:18 +0300 Message-ID: <20100509164718.GA4497@redhat.com> References: <20100509152349.GF24787@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org To: Stefan Hajnoczi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753727Ab0EIQrf convert rfc822-to-8bit (ORCPT ); Sun, 9 May 2010 12:47:35 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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 canno= t > 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 from 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(siz= eof(*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.