[SeaBIOS] [PATCH] Support for booting from virtio disks

Stefan Hajnoczi stefanha at gmail.com
Sun May 9 18:31:16 CEST 2010


On Sun, May 9, 2010 at 4:23 PM, Gleb Natapov <gleb at 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.

> +        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?

Stefan



More information about the SeaBIOS mailing list