[libvirt] [PATCH]: hostdev passthrough support take #4

Guido Günther agx at sigxcpu.org
Fri Aug 8 14:05:10 UTC 2008


On Fri, Aug 08, 2008 at 02:30:15PM +0200, Jim Meyering wrote:
> Guido Günther <agx at sigxcpu.org> wrote:
[..snip..] 
> > +static int qemudDomainAttachCdromDevice(virDomainPtr dom,
> > +                                        virDomainDeviceDefPtr dev)
> > +{
> > +    struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
> > +    virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
> > +    virDomainDiskDefPtr disk;
> > +
> > +    disk = vm->def->disks;
> 
> Check for vm == NULL before dereferencing it.
> 
> ...
> > +static int qemudDomainAttachHostDevice(virDomainPtr dom, virDomainDeviceDefPtr dev)
> > +{
> > +    struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
> > +    virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
> ...
> > +    if (qemudMonitorCommand(driver, vm, cmd, &reply) < 0) {
> 
> Likewise.
The same applies here: qemudDomainAttachDevice checked that already, but
again - better safe than sorry. Updated patches attached.
 -- Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-hostdev-pass-host-devices-to-the-guest.patch
Type: text/x-diff
Size: 22817 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/6db24eec/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-hostdev-add-RNG-schema.patch
Type: text/x-diff
Size: 2363 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/6db24eec/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-hostdev-add-testcases.patch
Type: text/x-diff
Size: 4894 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/6db24eec/attachment-0005.bin>


More information about the libvir-list mailing list