Re: [libvirt] [PATCH 3/4] qemu: monitor: Add vcpu state information to monitor data

2016-09-13 Thread Dou Liyang
At 09/14/2016 11:35 AM, Peter Krempa wrote: On Wed, Sep 14, 2016 at 10:26:51 +0800, Dou Liyang wrote: Hi Peter, At 09/14/2016 12:27 AM, Peter Krempa wrote: Return whether a vcpu entry is hotpluggable or online so that upper layers don't have to infer the information from other data.

Re: [libvirt] [PATCH 3/4] qemu: monitor: Add vcpu state information to monitor data

2016-09-13 Thread Peter Krempa
On Wed, Sep 14, 2016 at 10:26:51 +0800, Dou Liyang wrote: > Hi Peter, > > At 09/14/2016 12:27 AM, Peter Krempa wrote: > > Return whether a vcpu entry is hotpluggable or online so that upper > > layers don't have to infer the information from other data. > > > > Advantage is that this code can be

Re: [libvirt] [PATCH 3/4] qemu: monitor: Add vcpu state information to monitor data

2016-09-13 Thread Dou Liyang
Hi Peter, At 09/14/2016 12:27 AM, Peter Krempa wrote: Return whether a vcpu entry is hotpluggable or online so that upper layers don't have to infer the information from other data. Advantage is that this code can be tested by unit tests. --- src/qemu/qemu_monitor.c

Re: [libvirt] AC_HEADER_MAJOR vs. glibc 2.25(-to-be)

2016-09-13 Thread Eric Blake
On 09/13/2016 05:31 PM, Eric Blake wrote: [hit send too soon] > Okay, I have confirmed that this prime-the-cache idea DOES work, using > libvirt.git commit 419bc8cf (one commit prior to d53fa838 which > installed a hack into libvirt to force the use of -Werror for the > duration of

Re: [libvirt] AC_HEADER_MAJOR vs. glibc 2.25(-to-be)

2016-09-13 Thread Eric Blake
[adding libvirt list, as this is what sparked my investigations so far today] On 09/13/2016 04:36 PM, Eric Blake wrote: > One other possibility that distros can do is to prime a config.site > file, with $ac_cv_header_sys_types_h_makedev=no, to forcefully bypass > the configure check that is

Re: [libvirt] [PATCH] qemu: fix libvirtd crash in migration after vm shutdown

2016-09-13 Thread John Ferlan
something weird with your email client and adding extra 's everywhere... Plaintext is your friend as much as 'git send-email'... On 08/01/2016 10:20 PM, weifuqiang wrote: > [PATCH] qemu: fix libvirtd crash in migration after vm shutdown > > > > > > If we shutdown a guest, then migrate it

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

2016-09-13 Thread Eric Farman
On 09/13/2016 04:49 PM, John Ferlan wrote: [...] I took a peek at the v1, but suffice to say didn't follow it that closely since there's a number of changes in v2 related to patch ordering. You could get 3 different opinions on that matter too! Hopefully a consensus before too long. :)

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

2016-09-13 Thread John Ferlan
[...] >>> diff --git a/src/util/virscsi.c b/src/util/virscsi.c >>> index 4843367..290b692 100644 >>> --- a/src/util/virscsi.c >>> +++ b/src/util/virscsi.c >>> @@ -105,6 +105,32 @@ virSCSIDeviceGetAdapterId(const char *adapter, >>> return -1; >>> } >>> +int >>> +virSCSIOpenVhost(int

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

2016-09-13 Thread John Ferlan
[...] >>> >> I took a peek at the v1, but suffice to say didn't follow it that >> closely since there's a number of changes in v2 related to patch >> ordering. You could get 3 different opinions on that matter too! > > Hopefully a consensus before too long. :) > yeah - v1 was lots of little

Re: [libvirt] [PATCH 10/41] testutilsqemu: Helpers for changing host CPU and arch

2016-09-13 Thread Jiri Denemark
On Mon, Aug 29, 2016 at 12:45:03 -0400, John Ferlan wrote: > > > On 08/12/2016 09:33 AM, Jiri Denemark wrote: > > Changing a host architecture or a CPU is not as easy as assigning a new > > value to the appropriate element in virCaps since there is a relation > > between the CPU and host

Re: [libvirt] [PATCH] storage_backend_rbd: continue searching when failing in rbd_diff_iterate

2016-09-13 Thread John Ferlan
On 09/05/2016 11:45 PM, Chen Hanxiao wrote: > From: Chen Hanxiao > > We try to find a snapshot that had no different between > the current state of RBD image. > If we failed in rbd_diff_iterate, just continue for the > next search iteration. > > Signed-off-by: Chen

Re: [libvirt] [PATCH 03/41] qemu: Use virDomainCapsCPUModels for cpuDefinitions

2016-09-13 Thread Jiri Denemark
On Mon, Aug 29, 2016 at 12:32:34 -0400, John Ferlan wrote: ... > > -size_t virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, > > -char ***names) > > +int > > +virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, > > + char

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

2016-09-13 Thread Eric Farman
On 09/12/2016 06:10 PM, John Ferlan wrote: On 09/06/2016 08:58 AM, Eric Farman wrote: 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

Re: [libvirt] [PATCH 02/41] domcaps: Add support for listing supported CPU models

2016-09-13 Thread Jiri Denemark
On Mon, Aug 29, 2016 at 12:31:44 -0400, John Ferlan wrote: > > +int > > +virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, > > + char **name) > > +{ > > +if (VIR_RESIZE_N(cpuModels->models, cpuModels->alloc, > > +

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

2016-09-13 Thread Eric Farman
On 09/12/2016 05:34 PM, John Ferlan wrote: On 09/06/2016 08:58 AM, Eric Farman wrote: 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

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Eric Blake
On 09/13/2016 06:02 AM, Michal Privoznik wrote: >> So, just to make it crystal clear, is this what you're saying? >> >> ready | initial C/R |fudged C/R > > Oh, This should have been C/E instead of C/R. Current/End. 'e' and 'r' > keys are just too close to each other :-) > >>

[libvirt] [PATCH 1/4] qemu: monitor: Use a more obvious iterator name

2016-09-13 Thread Peter Krempa
The algorithm that matches data from query-cpus and query-hotpluggable-cpus is quite complex. Start using descriptive iterator names to avoid confusion. --- src/qemu/qemu_monitor.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git

[libvirt] [PATCH 3/4] qemu: monitor: Add vcpu state information to monitor data

2016-09-13 Thread Peter Krempa
Return whether a vcpu entry is hotpluggable or online so that upper layers don't have to infer the information from other data. Advantage is that this code can be tested by unit tests. --- src/qemu/qemu_monitor.c| 11 + src/qemu/qemu_monitor.h

[libvirt] [PATCH 0/4] Fix incorrect vcpu data refresh on daemon restart after vcpu hotplug

2016-09-13 Thread Peter Krempa
See patches 3 and 4 for explanation. Peter Krempa (4): qemu: monitor: Use a more obvious iterator name qemu: monitor: qemuMonitorGetCPUInfoHotplug: Add iterator 'anycpu' qemu: monitor: Add vcpu state information to monitor data qemu: domain: Don't infer vcpu state src/qemu/qemu_domain.c

[libvirt] [PATCH 2/4] qemu: monitor: qemuMonitorGetCPUInfoHotplug: Add iterator 'anycpu'

2016-09-13 Thread Peter Krempa
Add separate iterator for iterating all the entries --- src/qemu/qemu_monitor.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index b8da637..4489997 100644 --- a/src/qemu/qemu_monitor.c +++

[libvirt] [PATCH 4/4] qemu: domain: Don't infer vcpu state

2016-09-13 Thread Peter Krempa
Use the state information (online, hotpluggable) provided by the monitor code rather than trying to infer it. This fixes a issue where on architectures that require hotplug of multiple threads at once the sub-cores would get updated as offline on daemon restart thus creating an invalid

Re: [libvirt] [PATCH 2/4] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Michal Privoznik
On 13.09.2016 16:11, Erik Skultety wrote: > On 13/09/16 14:30, Michal Privoznik wrote: >> On 12.09.2016 10:20, Erik Skultety wrote: >>> Change the logic in a way, so that VSH_CMD_FLAG_ALIAS behaves similarly to >>> how VSH_OT_ALIAS for command options, i.e. there is no need for code >>>

Re: [libvirt] [PATCH] qemu_driver: pass path of compress prog directly

2016-09-13 Thread John Ferlan
On 08/27/2016 03:13 AM, Chen Hanxiao wrote: > From: Chen Hanxiao > > We check compress prog in qemuCompressProgramAvailable, > then check it again in virExec. > > This path will pass compress prog's path directly. > > Signed-off-by: Chen Hanxiao

Re: [libvirt] [PATCHv5 00/13] qemu: allow disabling certain virtio revisions

2016-09-13 Thread Laine Stump
On 09/13/2016 10:43 AM, Cornelia Huck wrote: [I've browsed through the thread a bit, but as I'm not a libvirt developer I may be missing some basic things] On Wed, 7 Sep 2016 16:34:17 -0400 Laine Stump wrote: On 09/07/2016 03:38 PM, Sascha Silbe wrote: Dear Laine, Laine

[libvirt] [PATCH 0/2] Fix vcpu hotplug with memoryless NUMA nodes

2016-09-13 Thread Peter Krempa
See patch 2. Peter Krempa (2): util: numa: Remove impossible error handling numa: Rename virNumaGetHostNodeset and make it return only nodes with memory src/libvirt_private.syms | 2 +- src/qemu/qemu_cgroup.c | 4 ++-- src/util/virnuma.c | 18 +++---

[libvirt] [PATCH v2 2/3] virt-admin: Add some command aliases to provide syntax sugar over ugly commands

2016-09-13 Thread Erik Skultety
Make use of the new recently introduced alias handling for virt-admin srv-* commands. Signed-off-by: Erik Skultety --- tools/virt-admin.c | 24 1 file changed, 24 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index

[libvirt] [PATCH v2 1/3] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Erik Skultety
Change the logic in a way, so that VSH_CMD_FLAG_ALIAS behaves similarly to how VSH_OT_ALIAS for command options, i.e. there is no need for code duplication for the alias and the aliased command structures. Along with that change, switch any existing VSH_CMD_FLAG_ALIAS occurrences to this new

[libvirt] [PATCH 2/2] numa: Rename virNumaGetHostNodeset and make it return only nodes with memory

2016-09-13 Thread Peter Krempa
Name it virNumaGetHostMemoryNodeset and return only NUMA nodes which have memory installed. This is necessary as the kernel is not very happy to set the memory cgroup setting for nodes which do not have any memory. This would break vcpu hotplug with following message on such configruation:

[libvirt] [PATCH v2 0/3] Introduce aliases for virt-admin's srv-* commands

2016-09-13 Thread Erik Skultety
the original version: https://www.redhat.com/archives/libvir-list/2016-September/msg00312.html since v1: - tweaked the virsh-self-test so that it also checks the aliased commands instead of skipping them (since there was a good reason for that before the changes this series

[libvirt] [PATCH v2 3/3] virt-admin: Replace the (now) aliases with new command names in the man page

2016-09-13 Thread Erik Skultety
Since the old command names are being shadowed by the new ones in the code as well as in the help messages, update the man page accordingly. Signed-off-by: Erik Skultety --- tools/virt-admin.pod | 30 +++--- 1 file changed, 15 insertions(+), 15

[libvirt] [PATCH 1/2] util: numa: Remove impossible error handling

2016-09-13 Thread Peter Krempa
The code guarantees that virBitmapSetBit won't be called with out of range values. Just ignore the return value and remove dead error handling. --- src/util/virnuma.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index

Re: [libvirt] [PATCHv5 00/13] qemu: allow disabling certain virtio revisions

2016-09-13 Thread Cornelia Huck
[I've browsed through the thread a bit, but as I'm not a libvirt developer I may be missing some basic things] On Wed, 7 Sep 2016 16:34:17 -0400 Laine Stump wrote: > On 09/07/2016 03:38 PM, Sascha Silbe wrote: > > Dear Laine, > > > > Laine Stump writes: > > >

Re: [libvirt] [PATCH] configure: Check for major() more strictly

2016-09-13 Thread Daniel P. Berrange
On Tue, Sep 13, 2016 at 04:31:45PM +0200, Michal Privoznik wrote: > Thing is, in f3f15cc24 I'm trying to adapt libvirt to the newest > glibc where major()/minor()/makedev() are moved from sys/types.h > to sys/sysmacros.h. However, my commit back then expect autoconf > to be fixed too as we already

[libvirt] [PATCH] configure: Check for major() more strictly

2016-09-13 Thread Michal Privoznik
Thing is, in f3f15cc24 I'm trying to adapt libvirt to the newest glibc where major()/minor()/makedev() are moved from sys/types.h to sys/sysmacros.h. However, my commit back then expect autoconf to be fixed too as we already use AC_HEADER_MAJOR to determine which header file the functions are in,

Re: [libvirt] [PATCH 2/4] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Erik Skultety
On 13/09/16 14:30, Michal Privoznik wrote: > On 12.09.2016 10:20, Erik Skultety wrote: >> Change the logic in a way, so that VSH_CMD_FLAG_ALIAS behaves similarly to >> how VSH_OT_ALIAS for command options, i.e. there is no need for code >> duplication >> for the alias and the aliased command

Re: [libvirt] [PATCH 1/4] tests: fix incorrect status handling by virsh-self-test

2016-09-13 Thread Michal Privoznik
On 12.09.2016 10:20, Erik Skultety wrote: > The virsh-self-test script compared the test's return code with 1 and only if > the return code matched this value then the test was marked as failed. Problem > is that SIGSEGV returns 139 (or 11 to be precise, since shell reserves the MSB > for abnormal

Re: [libvirt] [PATCH 2/4] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Michal Privoznik
On 12.09.2016 10:20, Erik Skultety wrote: > Change the logic in a way, so that VSH_CMD_FLAG_ALIAS behaves similarly to > how VSH_OT_ALIAS for command options, i.e. there is no need for code > duplication > for the alias and the aliased command structures. Along with that change, > switch any

Re: [libvirt] [PATCH 4/4] virt-admin: Replace the (now) aliases with new command names in the man page

2016-09-13 Thread Michal Privoznik
On 12.09.2016 10:20, Erik Skultety wrote: > Since the old command names are being shadowed by the new ones in the code as > well as in the help messages, update the man page accordingly. > > Signed-off-by: Erik Skultety > --- > tools/virt-admin.pod | 30

Re: [libvirt] qemu: migration: shall we abort migration while the guest is rebooting?

2016-09-13 Thread Zhangbo (Oscar)
Ping As REBOOT is concerned with both qemu and libvirtd, it's not atomic job, thus, it maybe not just qemu's bug. Maybe libvirtd should also send RESET qmp command after migration, what do you think of that? We've tried to send fakeReboot to dest side to fix this problem, it seems to have

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Michal Privoznik
On 13.09.2016 11:52, Michal Privoznik wrote: > On 12.09.2016 21:19, Eric Blake wrote: >> On 09/09/2016 04:30 PM, John Ferlan wrote: >> +/* Fix job completeness reporting. If cur == end mgmt + * applications think job is completed. Except when both cur + * and end

[libvirt] [PATCH] qemu: Add missing 'p' to qemuCgrouEmulatorAllNodesRestore

2016-09-13 Thread Peter Krempa
--- Pushed as trivial. src/qemu/qemu_cgroup.c | 6 +++--- src/qemu/qemu_cgroup.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index e2b5bab..fe94613 100644

Re: [libvirt] [PATCH] Make sure sys/types.h is included after sys/sysmacros.h

2016-09-13 Thread Daniel P. Berrange
On Mon, Sep 12, 2016 at 05:15:53PM +0200, Michal Privoznik wrote: > On 12.09.2016 16:54, Daniel P. Berrange wrote: > > On Tue, Sep 06, 2016 at 03:46:59PM +0200, Michal Privoznik wrote: > >> In the latest glibc, major() and minor() functions are marked as > >> deprecated (glibc commit dbab6577): >

Re: [libvirt] [PATCH 2/2] virDomainGetBlockJobInfo: Fix corner case when qemu reports no info

2016-09-13 Thread Michal Privoznik
On 12.09.2016 21:19, Eric Blake wrote: > On 09/09/2016 04:30 PM, John Ferlan wrote: > >>> >>> +/* Fix job completeness reporting. If cur == end mgmt >>> + * applications think job is completed. Except when both cur >>> + * and end are zero, in which case qemu hasn't started the >>>

Re: [libvirt] [PATCH 1/3] qemu: cgroup: Extract temporary relaxing of cgroup setting for vcpu hotplug

2016-09-13 Thread Boris Fiuczynski
On 09/07/2016 02:04 PM, Peter Krempa wrote: When hot-adding vcpus qemu needs to allocate some structures in the DMA zone which may be outside of the numa pinning. Extract the code doing this in a set of helpers so that it can be reused. --- src/qemu/qemu_cgroup.c | 90

Re: [libvirt] [PATCH 0/3] add option to keep nvram file on undefine

2016-09-13 Thread Michal Privoznik
On 12.09.2016 10:20, Michal Privoznik wrote: > On 27.05.2016 10:05, Nikolay Shirokovskiy wrote: >> There is already a patch [1] on this topic with a different approach - keep >> nvram file by default. There is also some discussion there. To sum up keeping >> nvram on undefine could be useful in