Re: [libvirt] [PATCH]: hostdev passthrough support take #3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guido Günther <agx@xxxxxxxxxxx> wrote:
> attached is version three of the hostdev passthrough patch. It adds:
>
> * code to format the XML for output
> * RelaxNG schema update
> * testcases

ACK, modulo the details below.

>>From cfcfc85accdcc7be7a5fbfd2c8dde435646d5ab2 Mon Sep 17 00:00:00 2001
> From: Guido Guenther <agx@xxxxxxxxxxx>
> Date: Fri, 25 Jul 2008 15:18:16 -0400
> Subject: [PATCH] hostdev: pass host devices to the guest
...
> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> index 7fe3903..ef4e158 100644
> --- a/src/qemu_driver.c
> +++ b/src/qemu_driver.c
> @@ -2951,12 +2951,83 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
>      return 0;
>  }
>
> +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.

...
>>From 6fd13e2faa49eadf2db4a7e4a3a28192b4c61622 Mon Sep 17 00:00:00 2001
> From: Guido Guenther <agx@xxxxxxxxxxx>
> Date: Thu, 7 Aug 2008 14:25:50 +0200
> Subject: [PATCH] hostdev: add testcases
...
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
> new file mode 100644
> index 0000000..0b89999
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
> @@ -0,0 +1 @@
> +/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:014.006
> \ No newline at end of file

> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
> new file mode 100644
> index 0000000..b993ae5
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
> @@ -0,0 +1 @@
> +/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:0204:6025
> \ No newline at end of file

Please split the long lines and add a newline at EOF.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]