Re: [libvirt] [PATCH v2] libvirtd: clarify the TLS conf default vaule setting

2018-01-19 Thread John Ferlan
s/vaule/value On 01/12/2018 05:33 AM, Chen Hanxiao wrote: > From: Chen Hanxiao > > As the description of daemon/libvirtd.conf, setting > key_file, cert_file or key_file will override the default value. > But if we set any one of them, we need to set all the rest of them. > > This patch clarify

[libvirt] [REBASE PATCH v2 8/9] qemu: Allow showing the dump progress for memory only dump

2018-01-19 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=916061 If the QEMU version running is new enough (based on the DUMP_COMPLETED event), then we can add a 'detach' boolean to the dump-guest-memory command in order to tell QEMU to run in a thread. This ensures that we don't lock out other commands while t

[libvirt] [REBASE PATCH v2 7/9] qemu: Add dump completed event to the capabilities

2018-01-19 Thread John Ferlan
Add the DUMP_COMPLETED check to the capabilities. This is the mechanism used to determine whether the dump-guest-memory command can support the "-detach" option and thus be able to wait on the event and allow for a query of the progress of the dump. Signed-off-by: John Ferlan --- src/qemu/qemu_c

[libvirt] [REBASE PATCH v2 4/9] qemu: Add new parameter to qemuMonitorDumpToFd

2018-01-19 Thread John Ferlan
Add a @detach parameter to the API in order allow running the QEMU code as a thread. Signed-off-by: John Ferlan --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 7 +-- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 4 +++- src/qemu/qemu_monitor_js

[libvirt] [REBASE PATCH v2 9/9] docs: Add news article for query memory-only dump processing percentage

2018-01-19 Thread John Ferlan
Signed-off-by: John Ferlan --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index b4d980624..5122c54b2 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,17 @@ + + + qemu: Allow showi

[libvirt] [REBASE PATCH v2 1/9] qemu: Add support for DUMP_COMPLETED event

2018-01-19 Thread John Ferlan
The event is fired when the domain memory only dump completes. Wire up the code to extract and send along the status. Signed-off-by: John Ferlan --- src/qemu/qemu_monitor.c | 18 ++ src/qemu/qemu_monitor.h | 19 +++ src/qemu/qemu_monitor_json.c | 31 +++

[libvirt] [REBASE PATCH v2 6/9] qemu: Introduce qemuDomainGetJobInfoDumpStats

2018-01-19 Thread John Ferlan
Add an API to allow fetching the Dump statistics for the job via the qemuDomainGetJobInfo API. Signed-off-by: John Ferlan --- src/qemu/qemu_driver.c | 56 -- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/sr

[libvirt] [REBASE PATCH v2 5/9] qemu: Introduce qemuDomainGetJobInfoMigrationStats

2018-01-19 Thread John Ferlan
Extract out the parts of qemuDomainGetJobStatsInternal that get the migration stats. We're about to add the ability to get just dump information. Signed-off-by: John Ferlan --- src/qemu/qemu_driver.c | 52 -- 1 file changed, 33 insertions(+), 19 de

[libvirt] [REBASE PATCH v2 3/9] qemu: Introduce qemuMonitor[JSON]QueryDump

2018-01-19 Thread John Ferlan
Add the query-dump API's in order to allow the dump-guest-memory to be used to monitor progress. Signed-off-by: John Ferlan --- src/qemu/qemu_monitor.c | 14 + src/qemu/qemu_monitor.h | 11 +++ src/qemu/qemu_monitor_json.c | 69

[libvirt] [REBASE PATCH v2 2/9] qemu: Introduce qemuProcessHandleDumpCompleted

2018-01-19 Thread John Ferlan
Add a couple of booleans to mark when there's a dump completion event waiting and when a dump completed event has been received. To ensure the dump completed event from a non memory-only dump doesn't cause the a dump completed event to be fired, only broadcast if there's a completion event waiting

[libvirt] [REBASE PATCH v2 0/9] Implement query-dump command

2018-01-19 Thread John Ferlan
https://www.redhat.com/archives/libvir-list/2018-January/msg00128.html Rebase the patches to 71d56a397925a1bd55d3aee30afdbdcd1a14f9a8 since 4.0.0 is released and the capabilities were adjusted. I also note fromt the archives that Michal responded to the series: https://www.redhat.com/archives/li

Re: [libvirt] [PATCH v5 00/16] Move qemu command line controller checks to qemuDomainDeviceDefValidateController* checks

2018-01-19 Thread John Ferlan
ping? Should still apply with current top. I can resend if requested. Tks, John On 01/05/2018 06:47 PM, John Ferlan wrote: > v4: https://www.redhat.com/archives/libvir-list/2017-December/msg00401.html > > Changes since v4: > > Insert patch 1 to split the qemuDomainSetSCSIControllerModel as h

Re: [libvirt] [PATCH 7/9] rpc: Alter virNetDaemonQuit processing

2018-01-19 Thread John Ferlan
On 01/19/2018 12:23 PM, John Ferlan wrote: > When virNetDaemonQuit is called from libvirtd's shutdown > handler (daemonShutdownHandler) we need to perform the quit > in multiple steps. The first part is to "request" the quit > and notify the NetServer's of the impending quit which causes > the Ne

[libvirt] [PATCH 9/9] APPLY ONLY FOR TESTING PURPOSES

2018-01-19 Thread John Ferlan
Modify GetAllStats to generate a long enough pause in order to send a SIGTERM to libvirtd while a client connection is processing. In order to "set things up": 1. In one terminal window from a local branch built using these patches using a root account run libvirtd debug, e.g.: # ./run gd

[libvirt] [PATCH 7/9] rpc: Alter virNetDaemonQuit processing

2018-01-19 Thread John Ferlan
When virNetDaemonQuit is called from libvirtd's shutdown handler (daemonShutdownHandler) we need to perform the quit in multiple steps. The first part is to "request" the quit and notify the NetServer's of the impending quit which causes the NetServers to Drain their pending queue and tell workers

[libvirt] [PATCH 8/9] docs: Add news article for libvirtd issue

2018-01-19 Thread John Ferlan
Signed-off-by: John Ferlan --- docs/news.xml | 12 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index b4d980624..18800119d 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -39,6 +39,18 @@ + + + Fix issues with

[libvirt] [PATCH 6/9] rpc: Introduce virNetServerWorkerCount

2018-01-19 Thread John Ferlan
Get a count of the number of workers for all servers that are still processing a job. Signed-off-by: John Ferlan --- src/libvirt_remote.syms | 1 + src/rpc/virnetserver.c | 26 ++ src/rpc/virnetserver.h | 2 ++ 3 files changed, 29 insertions(+) diff --git a/src/libvi

[libvirt] [PATCH 4/9] util: Introduce virThreadPoolDrain

2018-01-19 Thread John Ferlan
Create a mechanism to allow the domain/server quit code to be able to cause any pending jobs to be be purged and request current workers to quit. Signed-off-by: John Ferlan --- src/libvirt_private.syms | 1 + src/util/virthreadpool.c | 64 src/ut

[libvirt] [PATCH 5/9] rpc: Introduce virNetServerQuitRequested

2018-01-19 Thread John Ferlan
When virNetDaemonQuit is called, we need to let the NetServers know a quit is pending and a subsequent Close will tear down the environment. Signed-off-by: John Ferlan --- src/libvirt_remote.syms | 1 + src/rpc/virnetdaemon.c | 13 + src/rpc/virnetserver.c | 23 +++

[libvirt] [PATCH 3/9] netserver: Remove ServiceToggle during ServerDispose

2018-01-19 Thread John Ferlan
No sense in calling ServiceToggle for all nservices during ServiceDispose since ServerClose calls ServiceClose which removes the IOCallback that's being toggled via ServiceToggle. Signed-off-by: John Ferlan Reviewed-by: Erik Skultety --- src/rpc/virnetserver.c | 3 --- 1 file changed, 3 deletio

[libvirt] [PATCH 2/9] libvirtd: Alter refcnt processing for server program objects

2018-01-19 Thread John Ferlan
Once virNetServerProgramNew returns, the program objects have either been added to the @srv or @srvAdm list increasing the refcnt or there was an error. In either case, we can lower the refcnt from virNetServerProgramNew and set the object to NULL since it won't be used any more. The @srv or @srvA

[libvirt] [PATCH 0/9] Resolve libvirtd hang on termination with connected long running client

2018-01-19 Thread John Ferlan
RFC: https://www.redhat.com/archives/libvir-list/2018-January/msg00318.html Adjustments since RFC... Patches 1&2: No change, were already R-B'd Patch 3: Removed code as noted in code review, update commit message Patch 4: From old series removed, see below for more details Patch 9: no change NB:

[libvirt] [PATCH 1/9] libvirtd: Alter refcnt processing for domain server objects

2018-01-19 Thread John Ferlan
Once virNetDaemonAddServer returns, the @srv or @srvAdm have either been added to the @dmn list increasing the refcnt or there was an error. In either case, we can lower the refcnt from virNetServerNew, but not set to NULL. Thus "using" the hash table reference when adding programs later or allowin

Re: [libvirt] [PATCH V3] nodedev: Fix failing to parse PCI address for non-PCI network devices

2018-01-19 Thread Jim Fehlig
On 01/18/2018 02:21 AM, Erik Skultety wrote: On Wed, Jan 17, 2018 at 10:46:32AM -0700, Jim Fehlig wrote: Commit 8708ca01c added virNetDevSwitchdevFeature() to check if a network device has Switchdev capabilities. virNetDevSwitchdevFeature() attempts to retrieve the PCI device associated with the

[libvirt] [PATCH 1/4] admin: move admins server impl/dispatch into src/admin directory

2018-01-19 Thread Daniel P. Berrange
The admin server functionality is a generic concept that should be wired up into all libvirt daemons, but is currently integrated with the libvirtd code. Move it all into the src/admin directory to prepare for broader reuse. Signed-off-by: Daniel P. Berrange --- .gitignore

[libvirt] [PATCH 2/4] util: add virGetUNIXSocketPath helper

2018-01-19 Thread Daniel P. Berrange
When receiving multiple socket FDs from systemd, it is critical to know what socket address each corresponds to so we can setup the right protocols on each. Signed-off-by: Daniel P. Berrange --- src/util/virutil.c | 45 + src/util/virutil.h | 1 + 2 f

[libvirt] [PATCH 4/4] lockd: add support for admin protocol in virtlockd

2018-01-19 Thread Daniel P. Berrange
Add a virtlockd-admin-sock can serves the admin protocol for the virtlockd daemon and define a virtlockd:///{system,session} URI scheme for connecting to it. Signed-off-by: Daniel P. Berrange --- cfg.mk| 1 - src/Makefile.am | 1 + src/l

[libvirt] [PATCH 3/4] logd: add support for admin protocol in virtlogd

2018-01-19 Thread Daniel P. Berrange
Add a virtlogd-admin-sock can serves the admin protocol for the virtlogd daemon and define a virtlogd:///{system,session} URI scheme for connecting to it. Signed-off-by: Daniel P. Berrange --- src/Makefile.am | 1 + src/libvirt-admin.c | 20 -- src/l

[libvirt] [PATCH 0/4] Add admin protocol support for virtlogd/virtlockd

2018-01-19 Thread Daniel P. Berrange
The initial admin protocol support was only integrated into libvirtd. This series extracts that code so that it is reusable with all the daemons we have (and more than we'll get). Daniel P. Berrange (4): admin: move admins server impl/dispatch into src/admin directory util: add virGetUNIXSocke

Re: [libvirt] Libvirt fails to apply security context to fd/node to USB device

2018-01-19 Thread Michal Privoznik
On 01/16/2018 07:20 PM, Randy Aybar wrote: > Hi, > > > I'm attempting to attach and expose a USB device (WiFi adapter for testing) > to an LXC container with SELinux enabled. But when enabling the XML snippet, > the container fails to start with this error: > > > 2018-01-12 19:24:31.914+:

[libvirt] [PATCH] blockjob: Fix a error checking of blockjob status in some case

2018-01-19 Thread Jie Wang
offset and len can also be equal to 0 on failed if blockjob return status:"BLOCK_JOB_COMPLETED" with error:"File descriptor in bad state", this bug can be reproduced easily if you perform a async block job on read only filesystem, so it's very worthwhile for us to check 'error' in this case. --- s

[libvirt] [PATCH v2] virt-aa-helper: Set the supported features

2018-01-19 Thread Shivaprasad G Bhat
The virt-aa-helper fails to parse the xmls with the memory/cpu hotplug features or user assigned aliases. Set the features in xmlopt->config for the parsing to succeed. Signed-off-by: Shivaprasad G Bhat --- src/security/virt-aa-helper.c |8 +++- 1 file changed, 7 insertions(+), 1 deletio

Re: [libvirt] [PATCH] virt-aa-helper: Allow parsing supported features for qemu/kvm

2018-01-19 Thread Shivaprasad bhat
Thanks for the comments Michal.. On Fri, Jan 12, 2018 at 3:41 PM, Michal Privoznik wrote: > On 01/11/2018 11:09 AM, Shivaprasad G Bhat wrote: > > The virt-aa-helper fails to parse the xmls with the memory/cpu > > hotplug features or user assigned aliases. Set the features in > > xmlopt->config f

Re: [libvirt] [PATCH] cpu: Add support for al57 Intel features

2018-01-19 Thread Feng, Shaohe
On 2018年01月09日 18:40, Jiri Denemark wrote: On Mon, Jan 08, 2018 at 19:06:43 +0800, Feng, Shaohe wrote: On 2018年01月05日 02:52, John Ferlan wrote: On 12/17/2017 06:02 PM, Shaohe Feng wrote: We can start qemu with a "cpu,+la57" to set 57-bit vitrual address space. So VM can be aware that it need

[libvirt] Release of libvirt-4.0.0

2018-01-19 Thread Daniel Veillard
First release of the year ! A bit late but it is now tagged in git and signed tarball and rpms are at the usual place: ftp://libvirt.org/libvirt/ I also pushed a release of the python bindings in git and at ftp://libvirt.org/libvirt/python/ This is a relatively small release, probably

Re: [libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"

2018-01-19 Thread Michal Privoznik
On 01/19/2018 02:11 PM, Ján Tomko wrote: > On Fri, Jan 19, 2018 at 02:00:44PM +0100, Michal Privoznik wrote: >> This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1. >> >> Problem is that we need mon->lastError to be set because it's >> used all over the place. Also, there's nothing wrong w

[libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"

2018-01-19 Thread Michal Privoznik
This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1. Problem is that we need mon->lastError to be set because it's used all over the place. Also, there's nothing wrong with reporting error if one occurred. I mean, if there's a thread executing an API and which currently is talking on moni

Re: [libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"

2018-01-19 Thread Ján Tomko
On Fri, Jan 19, 2018 at 02:00:44PM +0100, Michal Privoznik wrote: This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1. Problem is that we need mon->lastError to be set because it's used all over the place. Also, there's nothing wrong with reporting error if one occurred. I mean, if ther

[libvirt] [PATCH] qemu: Expose rx/tx_queue_size in qemu.conf too

2018-01-19 Thread Michal Privoznik
In 2074ef6cd4a2 and c56cdf259 (and friends) we've added two attributes to virtio NICs: rx_queue_size and tx_queue_size. However, sysadmins might want to set these on per-host basis but don't necessarily have an access to domain XML (e.g. because they are generated by some other app). So let's expos

Re: [libvirt] [PATCH] qemu: Don't send any monitor commands afer SHUTDOWN event

2018-01-19 Thread Michal Privoznik
On 01/19/2018 10:55 AM, Ján Tomko wrote: > On Fri, Jan 19, 2018 at 10:02:45AM +0100, Michal Privoznik wrote: >> After aeda1b8c56dc5 we tried to stop reporting I/O errors on >> expected monitor HUP. We've achieved that by not setting >> mon->lastError once we've received SHUTDOWN event. However, thi

Re: [libvirt] [PATCH] qemu: Don't send any monitor commands afer SHUTDOWN event

2018-01-19 Thread Ján Tomko
On Fri, Jan 19, 2018 at 10:02:45AM +0100, Michal Privoznik wrote: After aeda1b8c56dc5 we tried to stop reporting I/O errors on expected monitor HUP. We've achieved that by not setting mon->lastError once we've received SHUTDOWN event. However, this makes us to deadlock in case there's thread that

Re: [libvirt] [PATCH] qemu: Fix crash in offline migration

2018-01-19 Thread Pavel Hrdina
On Fri, Jan 19, 2018 at 10:46:49AM +0100, Jiri Denemark wrote: > When migrating a shutoff domain (i.e., offline migration), we have no > statistics to report and thus jobInfo will be NULL in > qemuMigrationFinish. > > Broken by me in v3.10.0-183-ge8784e7868. > > https://bugzilla.redhat.com/show_b

[libvirt] [PATCH] qemu: Fix crash in offline migration

2018-01-19 Thread Jiri Denemark
When migrating a shutoff domain (i.e., offline migration), we have no statistics to report and thus jobInfo will be NULL in qemuMigrationFinish. Broken by me in v3.10.0-183-ge8784e7868. https://bugzilla.redhat.com/show_bug.cgi?id=1536351 Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration

[libvirt] [PATCH] qemu: Don't send any monitor commands afer SHUTDOWN event

2018-01-19 Thread Michal Privoznik
After aeda1b8c56dc5 we tried to stop reporting I/O errors on expected monitor HUP. We've achieved that by not setting mon->lastError once we've received SHUTDOWN event. However, this makes us to deadlock in case there's thread that enters the monitor after the event is received. The problem is, we'