From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: [SeaBIOS] [PATCH] Support for booting from virtio disks Date: Sun, 9 May 2010 17:31:16 +0100 Message-ID: References: <20100509152349.GF24787@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mail-vw0-f46.google.com ([209.85.212.46]:43292 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366Ab0EIQbX convert rfc822-to-8bit (ORCPT ); Sun, 9 May 2010 12:31:23 -0400 Received: by vws3 with SMTP id 3so897005vws.19 for ; Sun, 09 May 2010 09:31:22 -0700 (PDT) In-Reply-To: <20100509152349.GF24787@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > + =A0 =A0 =A0 =A0char *desc =3D malloc_tmphigh(MAXDESCSIZE); > + =A0 =A0 =A0 =A0struct virtiodrive_s *vdrive_g =3D malloc_fseg(sizeo= f(*vdrive_g)); > + =A0 =A0 =A0 =A0struct vring_virtqueue *vq =3D malloc_low(sizeof(*vq= )); > + =A0 =A0 =A0 =A0if (!vdrive_g || !desc || !vq) { > + =A0 =A0 =A0 =A0 =A0 =A0warn_noalloc(); > + =A0 =A0 =A0 =A0 =A0 =A0return; > + =A0 =A0 =A0 =A0} [...] > + =A0 =A0 =A0 =A0if (vp_find_vq(ioaddr, 0, vdrive_g->vq) < 0 ) { > + =A0 =A0 =A0 =A0 =A0 =A0free(vdrive_g); > + =A0 =A0 =A0 =A0 =A0 =A0dprintf(1, "fail to find vq for virtio-blk %= x:%x\n", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_bdf_to_bus (bdf), pci_bd= f_to_dev(bdf)); > + =A0 =A0 =A0 =A0 =A0 =A0continue; > + =A0 =A0 =A0 =A0} Are desc, vdrive_g, and/or vq getting leaked on error? Stefan