[libvirt] [PATCH]: file backed usb massstorage #4

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


On Fri, Aug 08, 2008 at 02:07:49PM +0200, Jim Meyering wrote:
> Guido Günther <agx at sigxcpu.org> wrote:
[..snip..] 
> > +static int qemudDomainAttachUsbMassstorageDevice(virDomainPtr dom, virDomainDeviceDefPtr dev)
> > +{
> > +    struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
> > +    virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
> 
> This should handle the case in which vm == NULL.
> Otherwise, qemudMonitorCommand will dereference NULL.
> ...
The function gets called from qemudDomainAttachDevice which does the
same call to virDomainFindbyUUid and checks for vm == NULL already but
you're right: better safe than sorry.

[..snip..] 
> Please add a newline and split the long line:
> 
>   /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi \
>     -boot c -hda /dev/HostVG/QEMUGuest1 -usbdevice disk:/tmp/usbdisk.img \
>     -net none -serial none -parallel none -usb
I'd rather not since this breaks the testcase, it compares the exact
output. 

New patches attached. Patches apply on top of the hostdev patches.
 -- Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-usbmass-use-files-as-usbdisks.patch
Type: text/x-diff
Size: 6707 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/7bc9b210/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-usbmass-allow-usb-as-target-dist-type-in-libvirt.rn.patch
Type: text/x-diff
Size: 659 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/7bc9b210/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-usbmass-testcase-for-file-src.patch
Type: text/x-diff
Size: 2991 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080808/7bc9b210/attachment-0005.bin>


More information about the libvir-list mailing list