All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [SeaBIOS] [PATCH] Support for booting from virtio disks
Date: Sun, 9 May 2010 19:47:18 +0300	[thread overview]
Message-ID: <20100509164718.GA4497@redhat.com> (raw)
In-Reply-To: <z2ofbd9d3991005090931k3b6c247fu9eb4007d18465eda@mail.gmail.com>

On Sun, May 09, 2010 at 05:31:16PM +0100, Stefan Hajnoczi wrote:
> On Sun, May 9, 2010 at 4:23 PM, Gleb Natapov <gleb@redhat.com> 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.
> 
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.

> > +        char *desc = malloc_tmphigh(MAXDESCSIZE);
> > +        struct virtiodrive_s *vdrive_g = malloc_fseg(sizeof(*vdrive_g));
> > +        struct vring_virtqueue *vq = malloc_low(sizeof(*vq));
> > +        if (!vdrive_g || !desc || !vq) {
> > +            warn_noalloc();
> > +            return;
> > +        }
> [...]
> > +        if (vp_find_vq(ioaddr, 0, vdrive_g->vq) < 0 ) {
> > +            free(vdrive_g);
> > +            dprintf(1, "fail to find vq for virtio-blk %x:%x\n",
> > +                    pci_bdf_to_bus (bdf), pci_bdf_to_dev(bdf));
> > +            continue;
> > +        }
> 
> Are desc, vdrive_g, and/or vq getting leaked on error?
> 
vdrive_g is freed, but desc and vq are leaked. Will fix. Thanks!

--
			Gleb.

WARNING: multiple messages have this Message-ID (diff)
From: Gleb Natapov <gleb@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: seabios@seabios.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] Re: [SeaBIOS] [PATCH] Support for booting from virtio disks
Date: Sun, 9 May 2010 19:47:18 +0300	[thread overview]
Message-ID: <20100509164718.GA4497@redhat.com> (raw)
In-Reply-To: <z2ofbd9d3991005090931k3b6c247fu9eb4007d18465eda@mail.gmail.com>

On Sun, May 09, 2010 at 05:31:16PM +0100, Stefan Hajnoczi wrote:
> On Sun, May 9, 2010 at 4:23 PM, Gleb Natapov <gleb@redhat.com> 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.
> 
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.

> > +        char *desc = malloc_tmphigh(MAXDESCSIZE);
> > +        struct virtiodrive_s *vdrive_g = malloc_fseg(sizeof(*vdrive_g));
> > +        struct vring_virtqueue *vq = malloc_low(sizeof(*vq));
> > +        if (!vdrive_g || !desc || !vq) {
> > +            warn_noalloc();
> > +            return;
> > +        }
> [...]
> > +        if (vp_find_vq(ioaddr, 0, vdrive_g->vq) < 0 ) {
> > +            free(vdrive_g);
> > +            dprintf(1, "fail to find vq for virtio-blk %x:%x\n",
> > +                    pci_bdf_to_bus (bdf), pci_bdf_to_dev(bdf));
> > +            continue;
> > +        }
> 
> Are desc, vdrive_g, and/or vq getting leaked on error?
> 
vdrive_g is freed, but desc and vq are leaked. Will fix. Thanks!

--
			Gleb.

  reply	other threads:[~2010-05-09 16:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 15:23 [PATCH] Support for booting from virtio disks Gleb Natapov
2010-05-09 15:23 ` [Qemu-devel] " Gleb Natapov
2010-05-09 16:31 ` [SeaBIOS] " Stefan Hajnoczi
2010-05-09 16:31   ` [Qemu-devel] " Stefan Hajnoczi
2010-05-09 16:47   ` Gleb Natapov [this message]
2010-05-09 16:47     ` Gleb Natapov
2010-05-10  2:51 ` Kevin O'Connor
2010-05-10  2:51   ` [Qemu-devel] " Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100509164718.GA4497@redhat.com \
    --to=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.