[libvirt] [PATCH] util: Resolve resource leak

2017-10-11 Thread John Ferlan
Need to free @groups in the parent on success similar to other APIs (virFile*) which use virGetGroupList and virFork. Reported by Coverity. Signed-off-by: John Ferlan --- src/util/vircommand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/vircommand.c

Re: [libvirt] [PATCH 0/7] x86: Rework KVM-defaults compat code, enable kvm_pv_unhalt by default

2017-10-11 Thread Waiman Long
On 10/10/2017 03:41 PM, Eduardo Habkost wrote: > On Tue, Oct 10, 2017 at 02:07:25PM -0400, Waiman Long wrote: >> On 10/10/2017 11:50 AM, Eduardo Habkost wrote: Yes. Another possibility is to enable it when there is >1 NUMA node in the guest. We generally don't do this kind of magic but

Re: [libvirt] [PATCH 1/4] qemu: Separate CPU updating code from qemuProcessReconnect

2017-10-11 Thread Marc Hartmayer
On Wed, Oct 11, 2017 at 12:11 PM +0200, Jiri Denemark wrote: > The new function is called qemuProcessRefreshCPU. > > Signed-off-by: Jiri Denemark > --- > src/qemu/qemu_process.c | 66 > - > 1 file

Re: [libvirt] [question]Why libvirt bind all devices with same vendor id and device id to vfio-pci driver, and only unbind devices used by VMs to original driver?

2017-10-11 Thread Laine Stump
On 10/09/2017 10:57 AM, Alex Williamson wrote: > On Mon, 9 Oct 2017 09:28:27 + > "Wuzongyong (Euler Dept)" wrote: > >> Hi, >> >> As the title says, I thought that it's a bit unreasonable and inconsistent >> to unbind devices assigned to VMs to original driver >> and

[libvirt] [PATCH v5 2/6] nodedev: udev: Convert udev private data to a lockable object

2017-10-11 Thread Erik Skultety
Since there's going to be a worker thread which needs to have some data protected by a lock, the whole code would just simply get unnecessary complex, since two sets of locks would be necessary, driver lock (for udev monitor and event handle) and a mutex protecting thread-local data. Given the

[libvirt] [PATCH v5 1/6] nodedev: Introduce udevEventMonitorSanityCheck helper function

2017-10-11 Thread Erik Skultety
We need to perform a sanity check on the udev monitor before every use so that we know nothing has changed in the meantime. The reason for moving the code to a separate helper is to enhance readability and shift the focus on the important stuff within the udevEventHandleCallback handler.

[libvirt] [PATCH v5 5/6] util: Introduce virFileWaitForExists

2017-10-11 Thread Erik Skultety
Since we have a number of places where we workaround timing issues with devices, attributes (files in general) not being available at the time of processing them by calling usleep in a loop for a fixed number of tries, we could as well have a utility function that would do that. Therefore we won't

[libvirt] [PATCH v5 6/6] nodedev: Work around the uevent race by hooking up virFileWaitForAccess

2017-10-11 Thread Erik Skultety
If we find ourselves in the situation that the 'add' uevent has been fired earlier than the sysfs tree for a device was created, we should use the best-effort approach and give kernel some predetermined amount of time, thus waiting for the attributes to be ready rather than discarding the device

[libvirt] [PATCH v5 4/6] udev: Convert udevEventHandleThread to an actual thread routine

2017-10-11 Thread Erik Skultety
Adjust udevEventHandleThread to be a proper thread routine running in an infinite loop handling devices. The handler thread pulls all available data from the udev monitor and only then waits until a wakeup signal for new incoming data has been emitted by udevEventHandleCallback. Signed-off-by:

[libvirt] [PATCH v5 3/6] udev: Split udevEventHandleCallback in two functions

2017-10-11 Thread Erik Skultety
This patch splits udevEventHandleCallback in two (introduces udevEventHandleThread) in order to be later able to refactor the latter to actually become a normal thread which will wait some time for the kernel to create the whole sysfs tree for a device as we cannot do that in the event loop

[libvirt] [PATCH v5 0/6] Work around the kernel mdev uevent race in nodedev

2017-10-11 Thread Erik Skultety
v4: https://www.redhat.com/archives/libvir-list/2017-September/msg00532.html Since v4: - fixed the reviewer's notes in 1/7 - dropped the original 2/7 because of converting the udev private data into a lockable object - current 2/6 is a new patch reworking our current locking approach of the udev

Re: [libvirt] [PATCH 1/2] qemu: reserve PCI addresses for implicit i440fx devices

2017-10-11 Thread Andrea Bolognani
On Wed, 2017-10-11 at 14:45 +0200, Ján Tomko wrote: > > I think it would make more sense to reserve the address for these > > devices in qemuDomainCollectPCIAddress() directly, along with the > > other ones, eg. squash in the following diff: > > > > -- 8< -- 8< -- 8<

Re: [libvirt] [PATCH 1/2] qemu: reserve PCI addresses for implicit i440fx devices

2017-10-11 Thread Ján Tomko
On Wed, Oct 11, 2017 at 01:14:58PM +0200, Andrea Bolognani wrote: On Tue, 2017-09-26 at 13:05 +0200, Ján Tomko wrote: @@ -1429,15 +1429,24 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, cont->info.addr.pci.slot = 1; cont->info.addr.pci.function

Re: [libvirt] [PATCH 1/2] qemu: reserve PCI addresses for implicit i440fx devices

2017-10-11 Thread Andrea Bolognani
On Tue, 2017-09-26 at 13:05 +0200, Ján Tomko wrote: > @@ -1429,15 +1429,24 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr > def, > cont->info.addr.pci.slot = 1; > cont->info.addr.pci.function = 2; > } > +} else { > +/*

Re: [libvirt] [PATCH] maint: update to latest gnulib

2017-10-11 Thread Michal Privoznik
On 10/10/2017 02:15 AM, Daniel P. Berrange wrote: > This pulls in the fix for getopt tests on Fedora >= 28 / glibc > 2.26.0 > > Signed-off-by: Daniel P. Berrange > --- > .gnulib | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/.gnulib b/.gnulib >

[libvirt] [PATCH 3/4] qemu: Filter CPU features when using host CPU

2017-10-11 Thread Jiri Denemark
The host CPU definition from host capabilities may contain features unknown to QEMU. Thus whenever we want to use this CPU definition, we have to filter the unknown features. https://bugzilla.redhat.com/show_bug.cgi?id=1495171 Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 0/4] qemu: Fix CPU model broken by older libvirt

2017-10-11 Thread Jiri Denemark
When libvirt older than 3.9.0 reconnected to a running domain started by old libvirt it could have messed up the expansion of host-model by adding features QEMU does not support (such as cmt). This series fixes the reconnection code and adds a hack which fixes CPU definitions which were broken by

[libvirt] [PATCH 1/4] qemu: Separate CPU updating code from qemuProcessReconnect

2017-10-11 Thread Jiri Denemark
The new function is called qemuProcessRefreshCPU. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 66 - 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_process.c

[libvirt] [PATCH 2/4] conf: Introduce virCPUDefFindFeature

2017-10-11 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/conf/cpu_conf.c | 40 +++- src/conf/cpu_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/conf/cpu_conf.c

[libvirt] [PATCH 4/4] qemu: Fix CPU model broken by older libvirt

2017-10-11 Thread Jiri Denemark
When libvirt older than 3.9.0 reconnected to a running domain started by old libvirt it could have messed up the expansion of host-model by adding features QEMU does not support (such as cmt). Thus whenever we reconnect to a running domain, revert to an active snapshot, or restore a saved domain

Re: [libvirt] [PATCH go-xml] Add support for memory device element

2017-10-11 Thread Daniel P. Berrange
On Wed, Oct 11, 2017 at 10:25:02AM +0800, zhenwei.pi wrote: > Support model, access and target. > Add Marshal/Unmarshal mothed for memory device. > Add test code for device list in full domain. > > Signed-off-by: zhenwei.pi > --- > domain.go | 29

[libvirt] [libvirt-jenkins-ci PATCH 1/2] ansible: Use systemd module

2017-10-11 Thread Andrea Bolognani
Using the module is preferable to calling systemctl(1) directly because it's better integrated into Ansible (eg. the task will be marked as "ok" instead of "changed" when the service has already been enabled) and allows us to perform service activation in a single step instead of two.

[libvirt] [libvirt-jenkins-ci PATCH 0/2] ansible: Improve service management

2017-10-11 Thread Andrea Bolognani
Rely on built-in functionality instead of reinventing the wheel. Andrea Bolognani (2): ansible: Use systemd module ansible: Use built-in init system detection ansible/tasks/jenkins.yml | 34 +++--- 1 file changed, 7 insertions(+), 27 deletions(-) -- 2.13.6 --

[libvirt] [libvirt-jenkins-ci PATCH 2/2] ansible: Use built-in init system detection

2017-10-11 Thread Andrea Bolognani
Ansible already exposes the type of init system in use through the ansible_service_mgr fact, so we can drop our own detection. Signed-off-by: Andrea Bolognani --- ansible/tasks/jenkins.yml | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff

Re: [libvirt] [PATCH v2] qemu: Don't crash when parsing command line lacking -M

2017-10-11 Thread Andrea Bolognani
On Tue, 2017-10-10 at 14:15 -0400, John Ferlan wrote: > [...] > > while scanning > > > +} else if (STREQ(arg, "-M") || > > + STREQ(arg, "-machine")) { > > +// This option has already been processed before entering this > > +// loop, so we