[libvirt] [PATCH v2 3/5] qemu: Add vhost-scsi string for -device parameter

2016-08-20 Thread Eric Farman
Open /dev/vhost-scsi, and record the resulting file descriptor, so that the guest has access to the host device outside of the libvirt daemon. Pass this information, along with data parsed from the XML file, to build a device string for the qemu command line. That device string will be for either

[libvirt] [PATCH v2 4/5] qemu: Allow hotplug of vhost-scsi device

2016-08-20 Thread Eric Farman
Adjust the device string that is built for vhost-scsi devices so that it can be invoked from hotplug. >From the QEMU command line, the file descriptors are expect to be numeric only. However, for hotplug, the file descriptors are expected to begin with at least one alphabetic character else this

[libvirt] [PATCH v2 5/5] tests: Introduce basic vhost-scsi test

2016-08-20 Thread Eric Farman
The qemuxml2argv test was cloned from hostdev-scsi-virtio-scsi Signed-off-by: Eric Farman Reviewed-by: Boris Fiuczynski --- .../qemuxml2argv-hostdev-scsi-vhost-scsi.args | 24

[libvirt] [PATCH v2 2/5] qemu: Introduce vhost-scsi capability

2016-08-20 Thread Eric Farman
Do all the stuff for the vhost-scsi capability in QEMU, so it's in place for our checks later. Signed-off-by: Eric Farman Reviewed-by: Boris Fiuczynski --- src/qemu/qemu_capabilities.c| 2 ++

[libvirt] [PATCH v2 0/5] Implementation of QEMU vhost-scsi

2016-08-20 Thread Eric Farman
This patch series provides a libvirt implementation of the vhost-scsi interface in QEMU. As near as I can see, this was discussed upstream in July 2014[1], and ended in a desire to replace a vhost-scsi controller in favor of a hostdev element instead[2]. There is no capability check in this

[libvirt] [PATCH v2 1/5] Introduce a "scsi_host" hostdev type

2016-08-20 Thread Eric Farman
We already have a "scsi" hostdev type, which refers to a single LUN that is passed through to a guest. But what of things where multiple LUNs are passed through via a single SCSI HBA, such as with the vhost-scsi target? Create a new hostdev type that will carry this, and its associated

[libvirt] [PATCH RFC 0/5] Remove usb address set caching

2016-08-20 Thread Tomasz Flendrich
During my work on removing addresses caching, usb addresses were added :). It should be applied on top of: https://www.redhat.com/archives/libvir-list/2016-August/msg00945.html or some small conflicts appear. I took an approach where exactly the same function is used to both calculate and

[libvirt] [PATCH RFC 1/5] Add qemuDomainUSBAddrSetCreateFromDomain

2016-08-20 Thread Tomasz Flendrich
In order to drop caching of the usb address set, a function is added that creates or recreates the usb address set, assigning addresses if necessary. --- src/qemu/qemu_domain_address.c | 39 --- src/qemu/qemu_domain_address.h | 3 +++ 2 files changed, 31

[libvirt] [PATCH RFC 4/5] remove unused virDomainUSBAddressRelease

2016-08-20 Thread Tomasz Flendrich
We no longer cache address sets, so there's no use of a function that releases addresses. --- src/conf/domain_addr.c | 30 -- src/conf/domain_addr.h | 5 - src/libvirt_private.syms | 1 - 3 files changed, 36 deletions(-) diff --git a/src/conf/domain_addr.c

[libvirt] [PATCH RFC 3/5] remove qemuDomainReleaseDeviceAddress and its uses

2016-08-20 Thread Tomasz Flendrich
There is no need to release addresses anymore, because the address sets are now recalculated. --- src/qemu/qemu_domain.c | 3 +-- src/qemu/qemu_domain.h | 2 -- src/qemu/qemu_domain_address.c | 31 ++- src/qemu/qemu_domain_address.h | 5

[libvirt] [PATCH RFC 5/5] Add a usb hotplug testcase for reattachment

2016-08-20 Thread Tomasz Flendrich
In order to test the recent changes, a testcase to attach a usb device after detaching one is added. It checks if addresses are properly reused. --- tests/qemuhotplugtest.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c

[libvirt] [PATCH RFC 2/5] qemu_hotplug: use a recalculated usb address set

2016-08-20 Thread Tomasz Flendrich
Since we now have a way of relculating the usb address set, all the places that previously used the cached set now use the recalculated one. --- src/qemu/qemu_hotplug.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git

[libvirt] [PATCH v3 2/5] Make address assignment in qemuDomainValidateDevicePCISlotsChipsets optional

2016-08-20 Thread Tomasz Flendrich
With a parameter, we can decide whether we want qemuDomainValidateDevicePCISlotsChipsets to assign new addresses, or simply verify the existing ones and reserve slots for potential future devices. The PCI address set will be recalculated instead of being cached, and during recalculation we want to

[libvirt] [PATCH v3 3/5] Reduce number of parameters to qemuDomainPCIAddressSetCreate

2016-08-20 Thread Tomasz Flendrich
We can as well generate the number of buses inside that function. Fewer parameters will be useful when recalculating the pci address set on demand. --- src/qemu/qemu_domain_address.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH v3 1/5] Move validating chipset PCI slots to qemuDomainPCIAddressSetCreate

2016-08-20 Thread Tomasz Flendrich
In order to simplify the code and make it possible to recalculate the PCI address set, I incorporated qemuDomainValidateDevicePCISlotsChipsets into qemuDomainPCIAddressSetCreate. Three functions had to be moved up to be seen in qemuDomainPCIAddressSetCreate. --- src/qemu/qemu_domain_address.c |

[libvirt] [PATCH v3 5/5] qemu: remove pciaddrs caching

2016-08-20 Thread Tomasz Flendrich
The cached pci address set is not required anymore, because the set is now being recalculated from the domain definition on demand, so the cache can be deleted. --- src/qemu/qemu_domain.c | 1 - src/qemu/qemu_domain.h | 1 - src/qemu/qemu_domain_address.c | 14 ++ 3

[libvirt] [PATCH v3 4/5] qemu_hotplug: generate pci address set on demand

2016-08-20 Thread Tomasz Flendrich
Dropping the caching of pci address set. Instead of using the cached address set, functions in qemu_hotplug.c now recalculate it on demand. --- src/qemu/qemu_domain_address.c | 8 +-- src/qemu/qemu_domain_address.h | 6 + src/qemu/qemu_hotplug.c| 50

[libvirt] [PATCH v3 0/5] Remove caching of address sets

2016-08-20 Thread Tomasz Flendrich
Link to last version (1-6 are already ACK'd) https://www.redhat.com/archives/libvir-list/2016-July/msg00917.html Changes: * qemuDomainPCIAddressSetCreate is now expanded instead of creating a completely new function. It now contains qemuDomainValidateDevicePCISlotsChipsets. * A parameter was

[libvirt] [PATCH] network: Need to free formatted addr in networkDnsmasqConfContents

2016-08-20 Thread John Ferlan
Commit id '0b6336c2' formatted the 'addr', but didn't VIR_FREE it. Found by Coverity. Signed-off-by: John Ferlan --- src/network/bridge_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index

Re: [libvirt] [PATCH v2 00/23] qemu: Add support for new vcpu hotplug and unplug

2016-08-20 Thread John Ferlan
On 08/19/2016 10:38 AM, Peter Krempa wrote: > Version 2 attempts to address feedback on v1: > - added more documentation > - fixed various typos > - fixed bugs appearing when restarting daemon > - fixed fallback code > - tested upgrade of libvirt > > Some of the patches were already pushed and

Re: [libvirt] [PATCH v2 21/23] qemu: Use mondern vcpu hotplug approach if possible

2016-08-20 Thread John Ferlan
$SUBJ: s/mondern/modern On 08/19/2016 10:38 AM, Peter Krempa wrote: > To allow unplugging the vcpus, hotplugging of vcpus on platforms which > require to plug multiple logical vcpus at once or pluging them in in s/pluging/plugging s/in in/in an/ > arbitrary order it's necessary to use the