Re: [libvirt] [PATCH 2/2] qemu: cold-unplug of sound

2019-11-14 Thread Cole Robinson
On 10/15/19 2:41 AM, Jidong Xia wrote: > With this patch users can cold unplug some sound devices. > use "virsh detach-device vm sound.xml --config" command. > I reviewed and pushed patch #1 Some comments below > Signed-off-by: Jidong Xia > --- > src/conf/domain_conf.c | 61 >

Re: [libvirt] [PATCH 01/12] libxl: do not use G_REGEX_EXTENDED

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:42 +0100, Ján Tomko wrote: > This flag is not needed to use extended regular expression syntax > with GRegex and it makes GRegex ignore whitespace in the regex. > > Remove the unintended usage, even though it should not matter in this > case. > > Signed-off-by: Ján

Re: [libvirt] [PATCH 12/12] tests: use GRegex in vboxsnapshotxmltest

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:53 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > tests/vboxsnapshotxmltest.c | 20 > 1 file changed, 8 insertions(+), 12 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH] libxl: Fix lock manager lock ordering

2019-11-14 Thread Cole Robinson
On 10/14/19 5:39 PM, Jim Fehlig wrote: > The ordering of lock manager locks in the libxl driver has a flaw that was > uncovered by a migration error path. In the perform phase of migration, the > source host calls virDomainLockProcessPause to release the lock before > sending the VM to the

[libvirt] [PATCH 2/3] Use g_mkdtemp instead of mkdtemp

2019-11-14 Thread Ján Tomko
Prefer the GLib version to the one from gnulib. Signed-off-by: Ján Tomko --- src/qemu/qemu_process.c | 2 +- tests/fdstreamtest.c | 2 +- tests/qemuhotplugtest.c | 2 +- tests/qemumemlocktest.c | 2 +- tests/qemumonitortestutils.c | 2 +- tests/qemuxml2argvtest.c | 2

Re: [libvirt] [PATCH v2 3/5] util: file: Use more obvious logic in virFindFileInPath

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 02:29:20PM +0100, Peter Krempa wrote: Make it more obvious that the function will return NULL if the file is not executable and stop reusing variables. Signed-off-by: Peter Krempa --- v2: - fixed logic to do the same as it did before - rewrote commit message to

[libvirt] [PATCH 3/3] syntax-check: prefer g_mkstemp_full and g_mkdtemp

2019-11-14 Thread Ján Tomko
Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 74d0d5f6d4..7d1ac4dbfc 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@

[libvirt] [PATCH 0/3] Prefer g_mkstemp_full and g_mkdtemp (glib chronicles)

2019-11-14 Thread Ján Tomko
Remove the dependency on three more gnulib modules: mkdtemp mkostemp mkostemps Note: this series is not affiliated with the kill-a-gnulib-module-a-day initiative Ján Tomko (3): Use g_mkstemp_full instead of mkostemp(s) Use g_mkdtemp instead of mkdtemp syntax-check:

[libvirt] [PATCH 1/3] Use g_mkstemp_full instead of mkostemp(s)

2019-11-14 Thread Ján Tomko
With g_mkstemp_full, there is no need to distinguish between mkostemp and mkostemps (no suffix vs. a suffix of a fixed length), because the GLib function looks for the XX pattern everywhere in the string. Use S_IRUSR | S_IWUSR for the permissions and do not pass O_RDWR in flags since it's

Re: [libvirt] [PATCH 02/12] remove unused regex.h includes

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:43 +0100, Ján Tomko wrote: > The code using regexes got moved, but the include stayed. > > Signed-off-by: Ján Tomko > --- > src/libxl/libxl_driver.c | 1 - > src/storage/storage_util.c | 1 - > src/util/viriscsi.c| 2 -- > src/util/virnetdevtap.c| 1 -

Re: [libvirt] [PATCH v2 0/2] a few cleanups in qemu_hotplug.c

2019-11-14 Thread Cole Robinson
On 10/17/19 11:44 AM, Daniel Henrique Barboza wrote: > There is not much to do regarding cleanup and g_auto* in this > file. Here's a couple of simple fixes I've found. > > > changes from v1: > - added a new patch to remove unused cleanup labels > > > v1:

Re: [libvirt] [PATCH v3 6/6] remote/rpc: Use virNetServerGetProgram() to determine the program

2019-11-14 Thread Marc Hartmayer
On Thu, Nov 14, 2019 at 09:20 AM +0100, Pavel Hrdina wrote: > On Wed, Nov 13, 2019 at 07:12:34PM +0100, Marc Hartmayer wrote: >> On Wed, Nov 13, 2019 at 09:52 AM +0100, Pavel Hrdina >> wrote: >> > On Fri, Nov 01, 2019 at 06:35:48PM +0100, Marc Hartmayer wrote: >> >> Use virNetServerGetProgram()

Re: [libvirt] [PATCH 07/12] storage: use GRegex virStorageBackendLogicalParseVolExtents

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 13:14:33 +0100, Ján Tomko wrote: > On Thu, Nov 14, 2019 at 08:11:46AM +0100, Peter Krempa wrote: > > On Wed, Nov 13, 2019 at 16:48:48 +0100, Ján Tomko wrote: > > > Using GRegex simplifies the code since g_match_info_fetch will > > > copy the matched substring for us. > > >

Re: [libvirt] [PATCH] qemu: Warn verbosely if using old loader:nvram pairs

2019-11-14 Thread Michal Privoznik
On 11/13/19 7:59 PM, Jim Fehlig wrote: On 11/13/19 9:20 AM, Michal Privoznik wrote: On 11/12/19 11:17 PM, Jim Fehlig wrote: On 11/11/19 9:42 AM, Michal Privoznik wrote: There are two ways for specifying loader:nvram pairs:     1) --with-loader-nvram configure option     2) nvram variable

Re: [libvirt] [PATCH 05/12] libxl: use GRegex in xenParseSxprVifRate

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:46 +0100, Ján Tomko wrote: > Use GRegex from GLib instead of regcomp. > > Signed-off-by: Ján Tomko > --- > src/libxl/xen_common.c | 20 +++- > 1 file changed, 7 insertions(+), 13 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list

Re: [libvirt] [PATCH v2 3/3] virt-aa-helper: drop pointer checks in get_files

2019-11-14 Thread Cole Robinson
On 11/14/19 6:20 AM, Christian Ehrhardt wrote: > It was mentioned that the pointers in loops like: > for (i = 0; i < ctl->def->nserials; i++) > if (ctl->def->serials[i] ... > will always be !NULL or we would have a much more serious problem. > > Simplify the if chains in get_files by

[libvirt] [PATCH 2/4] cpu_conf: Don't format empty model for host-model CPUs

2019-11-14 Thread Jiri Denemark
Most likely for historical reasons our CPU def formatting code is happily adding useless for host-model CPUs. We can just drop it. Signed-off-by: Jiri Denemark --- src/conf/cpu_conf.c | 16 +--- .../cputestdata/ppc64-host+guest-compat-none.xml | 4 +---

[libvirt] [PATCH] virhostuptime: Wrap virHostGetBootTimeProcfs() call in an ifdef

2019-11-14 Thread Michal Privoznik
The virHostGetBootTimeProcfs() function is defined only for Linux and therefore it's only call should also be done if we're on Linux. Signed-off-by: Michal Privoznik --- Pushed under trivial rule. src/util/virhostuptime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[libvirt] [PATCH 0/4] qemu: Use host-model CPU on s390 by default

2019-11-14 Thread Jiri Denemark
On s390 machines host-passthrough and host-model CPUs result in the same guest ABI (with QEMU new enough to be able to tell us what "host" CPU is expanded to, which was implemented around 2.9.0). So instead of using host-passthrough CPU when there's no CPU specified in a domain XML we can safely

[libvirt] [PATCH 3/4] cpu_s390: Don't check match attribute for host-model CPUs

2019-11-14 Thread Jiri Denemark
The match attribute is only relevant for custom mode CPUs. Reporting failure when match == 'minimum' regardless on CPU mode can cause unexpected failures. We should only report the error for custom CPUs. In fact, calling virCPUs390Update on a custom mode CPU should always report an error as

[libvirt] [PATCH 1/4] cpu_conf: Fix default value for CPU match attribute

2019-11-14 Thread Jiri Denemark
Commit v0.8.4-66-g95ff6b18ec (9 years ago) changed the default value for the cpu/@match attribute to 'exact' in a rather complicated way. It did so only if subelement was present and set -1 otherwise (which is not expected to ever happen). Thus the following two equivalent XML elements:

[libvirt] [PATCH 4/4] qemu: Use host-model CPU on s390 by default

2019-11-14 Thread Jiri Denemark
On s390 machines host-passthrough and host-model CPUs result in the same guest ABI (with QEMU new enough to be able to tell us what "host" CPU is expanded to, which was implemented around 2.9.0). So instead of using host-passthrough CPU when there's no CPU specified in a domain XML we can safely

Re: [libvirt] [tck PATCH 3/3] hooks: Use internal variable holding the state of the libvirtd service

2019-11-14 Thread Daniel P . Berrangé
On Tue, Nov 12, 2019 at 04:10:20PM +0100, Erik Skultety wrote: > Rather than assuming the existence of the 'service' command, use the > object variable holding the current state of the libvirtd service which > got populated right after we performed the tested action on the service. > --- >

Re: [libvirt] [PATCH 09/12] util: use GRegex for virLogRegex

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:50 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > src/util/virlog.c | 15 +-- > 1 file changed, 5 insertions(+), 10 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 10/12] util: use GRegex in virStringSearch

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:51 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > src/util/virstring.c | 31 ++- > 1 file changed, 14 insertions(+), 17 deletions(-) > > diff --git a/src/util/virstring.c b/src/util/virstring.c > index 283cf8c8d8..3da793c87a

Re: [libvirt] [PATCH v2 0/3] use virStringParseYesNo helper

2019-11-14 Thread Cole Robinson
On 10/16/19 11:19 PM, Mao Zhongyi wrote: > A function virStringParseYesNo was added to convert > string 'yes' to true and 'no' to false, so use this > helper to replace 'STREQ(.*, \"yes\")' and > 'STREQ(.*, \"no\")' as it allows us to drop several > repetitive if-then-else string->bool conversion

Re: [libvirt] [PATCH 06/12] libxl: remove 'ret' from xenParseSxprVifRate

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:47 +0100, Ján Tomko wrote: > Now that the cleanup section is empty, the ret variable is no longer > necessary. > > Signed-off-by: Ján Tomko > --- > src/libxl/xen_common.c | 10 +++--- > 1 file changed, 3 insertions(+), 7 deletions(-) Reviewed-by: Peter Krempa

Re: [libvirt] [PATCH v2 1/4] replace use of gnulib snprintf by g_snprintf

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 17:33:24 +0100, Pavel Hrdina wrote: > Glib implementation follows the ISO C99 standard so it's safe to replace > the gnulib implementation. > > Signed-off-by: Pavel Hrdina > --- > > changes in v2: > - don't replace snprintf in tools/virt-login-shell.c Reviewed-by:

Re: [libvirt] [PATCH] docs: mention lifted vCPUs restriction for esx

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 01:57:34PM +0100, Pino Toscano wrote: It was lifted with c92b6023e8eb670e01571e299a85e9da9bd4844c. Signed-off-by: Pino Toscano --- docs/drvesx.html.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Ján Tomko and pushed Jano signature.asc

Re: [libvirt] [PATCH 03/12] libxl: use GRegex in libxlGetAutoballoonConf

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:44 +0100, Ján Tomko wrote: > Replace the use of regcomp with GRegex. > > Signed-off-by: Ján Tomko > --- > src/libxl/libxl_conf.c | 20 +++- > 1 file changed, 7 insertions(+), 13 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list

Re: [libvirt] [PATCH 11/12] util: use GRegex in virStringMatch

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:52 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > src/util/virstring.c | 22 -- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff --git a/src/util/virstring.c b/src/util/virstring.c > index 3da793c87a..6add2278d8 100644 >

[libvirt] [PATCH v2 3/5] util: file: Use more obvious logic in virFindFileInPath

2019-11-14 Thread Peter Krempa
Make it more obvious that the function will return NULL if the file is not executable and stop reusing variables. Signed-off-by: Peter Krempa --- v2: - fixed logic to do the same as it did before - rewrote commit message to accomodate change src/util/virfile.c | 18 +++--- 1 file

Re: [libvirt] [PATCH] qemu: Warn verbosely if using old loader:nvram pairs

2019-11-14 Thread Daniel P . Berrangé
On Thu, Nov 14, 2019 at 03:26:33PM +0100, Michal Privoznik wrote: > On 11/13/19 7:59 PM, Jim Fehlig wrote: > > On 11/13/19 9:20 AM, Michal Privoznik wrote: > > > On 11/12/19 11:17 PM, Jim Fehlig wrote: > > > > On 11/11/19 9:42 AM, Michal Privoznik wrote: > > > > > There are two ways for specifying

Re: [libvirt] [PATCH 04/12] libxl: use g_autofree in xenParseSxprVifRate

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:45 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > src/libxl/xen_common.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 08/12] util: use GRegex in virCommandRunRegex

2019-11-14 Thread Peter Krempa
On Wed, Nov 13, 2019 at 16:48:49 +0100, Ján Tomko wrote: > This saves us from allocating vars upfront, since GLib deals with > that for us. > > Signed-off-by: Ján Tomko > --- > src/util/vircommand.c | 37 + > 1 file changed, 13 insertions(+), 24 deletions(-)

Re: [libvirt] [PATCH 1/3] Use g_mkstemp_full instead of mkostemp(s)

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 14:48:04 +0100, Ján Tomko wrote: > With g_mkstemp_full, there is no need to distinguish between > mkostemp and mkostemps (no suffix vs. a suffix of a fixed length), > because the GLib function looks for the XX pattern everywhere > in the string. > > Use S_IRUSR |

Re: [libvirt] [PATCH 3/3] syntax-check: prefer g_mkstemp_full and g_mkdtemp

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 14:48:06 +0100, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > build-aux/syntax-check.mk | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) Reviewed-by: Peter Krempa -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH v4 3/7] remote: Save reference to program in daemonClientEventCallback

2019-11-14 Thread Marc Hartmayer
As a result, you can later determine during the callback which program was used. This makes it easier to refactor the code in the future and is less prone to error. Signed-off-by: Marc Hartmayer Reviewed-by: Pavel Hrdina --- src/remote/remote_daemon_dispatch.c | 108

[libvirt] [PATCH v4 5/7] rpc: Introduce virNetServerGetProgramLocked helper function

2019-11-14 Thread Marc Hartmayer
This patch introduces virNetServerGetProgramLocked. It's a function to determine which program has to be used for a given @msg. This function will be reused in the next patch. Signed-off-by: Marc Hartmayer Reviewed-by: Pavel Hrdina --- src/rpc/virnetserver.c | 28 +---

Re: [libvirt] [PATCH 1/3] Use g_mkstemp_full instead of mkostemp(s)

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 05:37:26PM +0100, Peter Krempa wrote: On Thu, Nov 14, 2019 at 14:48:04 +0100, Ján Tomko wrote: With g_mkstemp_full, there is no need to distinguish between mkostemp and mkostemps (no suffix vs. a suffix of a fixed length), because the GLib function looks for the XX

Re: [libvirt] [PATCH v3] Add API to change qemu agent response timeout

2019-11-14 Thread Michal Prívozník
On 11/13/19 11:06 PM, Jonathon Jongsma wrote: > Some layered products such as oVirt have requested a way to avoid being > blocked by guest agent commands when querying a loaded vm. For example, > many guest agent commands are polled periodically to monitor changes, > and rather than blocking the

Re: [libvirt] [PATCH 2/3] Use g_mkdtemp instead of mkdtemp

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 14:48:05 +0100, Ján Tomko wrote: > Prefer the GLib version to the one from gnulib. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_process.c | 2 +- > tests/fdstreamtest.c | 2 +- > tests/qemuhotplugtest.c | 2 +- > tests/qemumemlocktest.c | 2

Re: [libvirt] [PATCH v3 0/9] Enable ramfb parameter for mediated devices

2019-11-14 Thread Cole Robinson
On 10/18/19 11:30 AM, Jonathon Jongsma wrote: > This is the third version of a patch series that adds support for a boot > display for mediated vgpu devices using the 'ramfb' parameter. This version > fixes a bunch of test failures that I had inadvertently introduced in the last > series. It also

[libvirt] [PATCH v4 7/7] remote/rpc: Use virNetServerGetProgram() to determine the program

2019-11-14 Thread Marc Hartmayer
Use virNetServerGetProgram() to determine the virNetServerProgram instead of using hard coded global variables. This allows us to remove the global variables @remoteProgram and @qemuProgram as they're now no longer necessary. Signed-off-by: Marc Hartmayer --- src/libvirt_remote.syms

[libvirt] [PATCH v4 1/7] rpc: use the return value of virObjectRef directly

2019-11-14 Thread Marc Hartmayer
Use the return value of virObjectRef directly. This way, it's easier for another reader to identify the reason why the additional reference is required. Signed-off-by: Marc Hartmayer Reviewed-by: John Ferlan Reviewed-by: Pavel Hrdina --- src/rpc/virnetserver.c | 3 +-- 1 file changed, 1

[libvirt] [PATCH v4 4/7] remote: Use domainClientEventCallbacks for remoteReplayConnectionClosedEvent

2019-11-14 Thread Marc Hartmayer
This allows us later to get rid of another usage of the global variable `remoteProgram`. Signed-off-by: Marc Hartmayer Reviewed-by: Pavel Hrdina --- src/remote/remote_daemon_dispatch.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH v4 0/7] Fix virConnectRegisterCloseCallback and get rid of global variables

2019-11-14 Thread Marc Hartmayer
The second patch of this patch series fixes the behavior of virConnectRegisterCloseCallback. The subsequent patches remove the need to have the global variables 'qemuProgram' and 'remoteProgram' in libvirtd.[ch]. They only work in combination with the fixed behavior of

[libvirt] [PATCH v4 6/7] remote: shrink the critical sections

2019-11-14 Thread Marc Hartmayer
To free the structs and save the error, it is not necessary to hold @priv->lock, therefore move these parts after the mutex unlock. Signed-off-by: Marc Hartmayer --- src/remote/remote_daemon_dispatch.c | 32 ++--- 1 file changed, 16 insertions(+), 16 deletions(-) diff

[libvirt] [PATCH] spec: Remove build-time list of edk2 firmwares

2019-11-14 Thread Jim Fehlig
Fedora now advertises supported firmwares via descriptor files. Since the upstream spec file assumes recent Fedora, remove the build-time list of firmwares, which can produce a warning after commit 75597f022a. Signed-off-by: Jim Fehlig --- libvirt.spec.in | 29 - 1

[libvirt] [PATCH v4 2/7] virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no connectRegisterCloseCallback

2019-11-14 Thread Marc Hartmayer
The commit 'close callback: move it to driver' (88f09b75eb99) moved the responsibility for the close callback to the driver. But if the driver doesn't support the connectRegisterCloseCallback API this function does nothing, even no unsupported error report. This behavior may lead to problems, for

Re: [libvirt] [PATCH] lxc: Fix 'domblkstat' error with attached disk devices.

2019-11-14 Thread Cole Robinson
On 10/20/19 11:54 PM, jcfara...@gmail.com wrote: > From: Julio Faracco > I think if you set your gitconfig correctly, you can avoid this 'From:' showing up. I have: [sendemail] from = "Cole Robinson " [user] name = Cole Robinson email = crobi...@redhat.com > LXC was not working

Re: [libvirt] [PATCH v3 0/9] Enable ramfb parameter for mediated devices

2019-11-14 Thread Cole Robinson
On 11/14/19 11:40 AM, Cole Robinson wrote: > On 10/18/19 11:30 AM, Jonathon Jongsma wrote: >> This is the third version of a patch series that adds support for a boot >> display for mediated vgpu devices using the 'ramfb' parameter. This version >> fixes a bunch of test failures that I had

Re: [libvirt] [ruby PATCH] Fix default values for node_cpu_stats() and node_memory_stats()

2019-11-14 Thread Cole Robinson
On 10/22/19 11:47 AM, Stefano Garzarella wrote: > ruby_libvirt_value_to_int() returns 0 if the optional value is > not defined, but in node_cpu_stats() and node_memory_stats() > the default value of cpuNum and cellNum is -1. > I know nothing about ruby or the libvirt bindings, but what you

Re: [libvirt] [PATCH 6/7] conf: add hypervisor agnostic, domain start-time, validation function for NetDef

2019-11-14 Thread Cole Robinson
On 10/22/19 9:24 PM, Laine Stump wrote: > devices (virDomainNetDef) are a bit different from other > types of devices in that their actual type may come from a network (in > the form of a port connection), and that doesn't happen until the > domain is started. This means that any validation of an

[libvirt] [PATCH v3 2/4] conf: report errors when parsing video resolution

2019-11-14 Thread Jonathon Jongsma
The current code doesn't properly handle errors when parsing a video device's resolution. We were returning a NULL structure for the case where 'x' or 'y' were missing. But for the other error cases, we were logging an error (virReportError()), but still returning an under-specified structure.

[libvirt] [PATCH v3 3/4] conf: report errors when parsing video acceleration

2019-11-14 Thread Jonathon Jongsma
Since this function is now only called when an 'acceleration' element is present in the xml, any failure to parse the element will be considered an error. Previously, we detected some types of errors, but we would only log an error (virReportError()), but still return a partially-specified accel

[libvirt] [PATCH v3 1/4] conf: iterate video model children in parent function

2019-11-14 Thread Jonathon Jongsma
Previously, we were passing the video "model" node to the "acceleration" and "resolution" parsing functions and requiring them to iterate over the children to discover and parse the appropriate node. It makes more sense to move this responsibility up to the parent function and just pass these

[libvirt] [PATCH v3 0/4] Fix up some issues from x and y resolution patches

2019-11-14 Thread Jonathon Jongsma
This is the third version of this patch series after a review from Cole. The main changes to this version of the patch series are: - several patches have been pushed upstream (and therefore dropped from this series - The iteration over child nodes was moved up to the caller due to a

[libvirt] [PATCH v3 4/4] conf: validate video resolution

2019-11-14 Thread Jonathon Jongsma
Ensure that both x and y are non-zero when resolution is specified for a video device. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c0f20c928f..54d6ae297e 100644 ---

[libvirt] [PATCH] news: mention 'ramfb' mdev attribute

2019-11-14 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- docs/news.xml | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index c362bf3a15..046314ef78 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -53,6 +53,19 @@ which were introduced in QEMU 4.2.0.

[libvirt] [PATCH 0/3] A few more Coverity patches

2019-11-14 Thread John Ferlan
Finally got Coverity to build with the recent build env changes. With doing that Coverity re-examines everything and bridge_driver generated a couple of longer term things. The virFileRewrite is from more recent changes. John Ferlan (3): util: Remove unnecessary check in virFileRewrite

[libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-14 Thread John Ferlan
We go through the trouble of checking {old|new}Bandwidth[->in] and storing the result in local @old_floor and @new_floor, but then we don't use them. Instead we make derefs to the longer name. This caused Coverity to note dereferencing newBandwidth->in without first checking @newBandwidth like was

[libvirt] [PATCH 3/3] network: Check for QOS before blindly using it

2019-11-14 Thread John Ferlan
If networkAllocatePort calls networkPlugBandwidth eventually the port->bandwidth would be passed to virNetDevBandwidthPlug which requires that the parameter is non-NULL. Coverity additionally notes that since (!port->bandwidth) is checked earlier in the networkAllocatePort method that the

[libvirt] [PATCH 1/3] util: Remove unnecessary check in virFileRewrite

2019-11-14 Thread John Ferlan
Since g_strdup_printf will abort, we know @newfile won't be NULL. Found by Coverity Signed-off-by: John Ferlan --- src/util/virfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index cb6cfc0fe7..fca7ff9d35 100644 ---

Re: [libvirt] [patch 1/1] virt-aa-helper: Add support for smartcard host-certificates

2019-11-14 Thread Cole Robinson
On 10/24/19 4:57 AM, Arnaud Patard wrote: > When emulating smartcard with host certificates, qemu needs to > be able to read the certificates files, which is denied by apparmor. > Add necessary code to add the smartcard certificates related directory > to the apparmor profile. > > This code

Re: [libvirt] [PATCH 0/5] Introduce the support of Intel RDT-MBM

2019-11-14 Thread Wang Huaqiang
Hi Han, Thanks for your kind reminder. I haven't used the 'virsh dommemstat' command for reporting the domain vcpus' memory bandwidth usage over host.  What I implemented is add a new option '--memory' under command 'virsh domstats'. Reason for such kind of implementation is I haven't

Re: [libvirt] [PATCH v3 6/6] remote/rpc: Use virNetServerGetProgram() to determine the program

2019-11-14 Thread Pavel Hrdina
On Wed, Nov 13, 2019 at 07:12:34PM +0100, Marc Hartmayer wrote: > On Wed, Nov 13, 2019 at 09:52 AM +0100, Pavel Hrdina > wrote: > > On Fri, Nov 01, 2019 at 06:35:48PM +0100, Marc Hartmayer wrote: > >> Use virNetServerGetProgram() to determine the virNetServerProgram > >> instead of using hard

Re: [libvirt] [PATCH Rust 3/4] libvirt-rust: stream: automated lint

2019-11-14 Thread Sahid Orentino Ferdjaoui
On Tue, Nov 12, 2019 at 02:44:44PM -0700, Zixing Liu wrote: > * used rustfmt to clean up the code > > Signed-off-by: Zixing Liu > --- > src/stream.rs | 97 +-- > 1 file changed, 56 insertions(+), 41 deletions(-) NACK, We don't have any rules for

Re: [libvirt] [PATCH Rust 4/4] libvirt-rust: use reference instead of moving

2019-11-14 Thread Sahid Orentino Ferdjaoui
On Tue, Nov 12, 2019 at 02:44:45PM -0700, Zixing Liu wrote: > Signed-off-by: Zixing Liu > --- > src/domain.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Sahid Orentino Ferdjaoui > > diff --git a/src/domain.rs b/src/domain.rs > index acb9e6e..4d4f593 100644 > ---

Re: [libvirt] [PATCH 1/5] rpc: use virStringSplit instead of strsep

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 11:43:29AM +0100, Peter Krempa wrote: When parsing allowed authentication methods for the native ssh lib trasnports we used strsep. Since we have virStringSplit helper let's use that one. Signed-off-by: Peter Krempa --- src/rpc/virnetsocket.c | 28

Re: [libvirt] [PATCH 2/5] util: file: Use g_autofree in virFindFileInPath

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 11:43:30AM +0100, Peter Krempa wrote: Simplify the final lookup loop by freeing memory automatically and thus being able to directly return the result. Signed-off-by: Peter Krempa --- src/util/virfile.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-)

Re: [libvirt] [PATCH 3/5] util: file: Simplify logic of shortuct cases in virFindFileInPath

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 11:43:31AM +0100, Peter Krempa wrote: Combine the terms in the two sets of nested conditionals an don't reuse a variable for a more obvious control flow. Signed-off-by: Peter Krempa --- src/util/virfile.c | 16 ++-- 1 file changed, 6 insertions(+), 10

Re: [libvirt] [PATCH 4/5] util: file: Replace use of 'strsep' with virStringSplit

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 11:43:32AM +0100, Peter Krempa wrote: Use our helper instead of the gnulib one. Signed-off-by: Peter Krempa --- src/util/virfile.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP

Re: [libvirt] [PATCH 5/5] gnulib: Remove use of 'strsep' module

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 11:43:33AM +0100, Peter Krempa wrote: We don't use strsep any more. Signed-off-by: Peter Krempa --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list

Re: [libvirt] [PATCH 4/8] conf: domaincaps: Add 'iothreads' to the features section

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:22PM +0100, Peter Krempa wrote: Historically iothreads were the first feature and thus didn't have it's own section. Add them to for consistency with other features. I'm not convinced duplicating this is a good idea - apps looking into the element for iothread

Re: [libvirt] [PATCH 1/8] conf: domaincaps: Replace FORMAT_SINGLE macro by a function

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:19PM +0100, Peter Krempa wrote: Introduce qemuDomainCapsFeatureFormatSimple which does exactly the same thing but it's a function. Signed-off-by: Peter Krempa --- src/conf/domain_capabilities.c | 27 --- 1 file changed, 16 insertions(+), 11

Re: [libvirt] [PATCH 2/8] conf: domaincaps: Extract formatting of the subelement

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:20PM +0100, Peter Krempa wrote: Extract it to virDomainCapsFormatFeatures so that the main function does not get so bloated over time. Signed-off-by: Peter Krempa --- src/conf/domain_capabilities.c | 28 ++-- 1 file changed, 18

Re: [libvirt] [PATCH 3/8] conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:21PM +0100, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/conf/domain_capabilities.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing

Re: [libvirt] [PATCH 5/8] domcaps: Add function for initializing domain caps as unsupported

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:23PM +0100, Peter Krempa wrote: For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 6/8] qemu: domcaps: Initialize all features

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:24PM +0100, Peter Krempa wrote: While the qemu driver currently implements all domain capability features, we should initialize all features using the helper similarly to how we do it in drivers which don't support any. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 7/8] domaincaps: Store domain capability features in an array

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:25PM +0100, Peter Krempa wrote: Declare the capabilities as enum values and store them in an array. This makes adding new features more straightforward and simplifies the formatter which now doesn't require changing. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 4/8] conf: domaincaps: Add 'iothreads' to the features section

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 12:55:40 +0100, Ján Tomko wrote: > On Wed, Nov 13, 2019 at 05:05:22PM +0100, Peter Krempa wrote: > > Historically iothreads were the first feature and thus didn't have it's > > own section. Add them to for consistency with other features. > > > > I'm not convinced

Re: [libvirt] [PATCH 3/5] util: file: Simplify logic of shortuct cases in virFindFileInPath

2019-11-14 Thread Peter Krempa
On Thu, Nov 14, 2019 at 12:51:57 +0100, Ján Tomko wrote: > On Thu, Nov 14, 2019 at 11:43:31AM +0100, Peter Krempa wrote: > > Combine the terms in the two sets of nested conditionals an don't reuse > > a variable for a more obvious control flow. > > > > Signed-off-by: Peter Krempa > > --- > >

Re: [libvirt] [PATCH 8/8] qemu: domcaps: Simplify adding new domaincaps based on qemu caps

2019-11-14 Thread Ján Tomko
On Wed, Nov 13, 2019 at 05:05:26PM +0100, Peter Krempa wrote: Add a helper which converts qemu emulator capabilities to the domain capability XML. This will simplify future additions of new features. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 39

Re: [libvirt] [PATCH 07/12] storage: use GRegex virStorageBackendLogicalParseVolExtents

2019-11-14 Thread Ján Tomko
On Thu, Nov 14, 2019 at 08:11:46AM +0100, Peter Krempa wrote: On Wed, Nov 13, 2019 at 16:48:48 +0100, Ján Tomko wrote: Using GRegex simplifies the code since g_match_info_fetch will copy the matched substring for us. Signed-off-by: Ján Tomko --- src/storage/storage_backend_logical.c | 49

[libvirt] [PATCH v2 2/3] virt-aa-helper: testcase for shmem devices

2019-11-14 Thread Christian Ehrhardt
Adding build time self tests for basic (deprecated), doorbell and plain mode. Reviewed-by: Cole Robinson Signed-off-by: Christian Ehrhardt --- tests/virt-aa-helper-test | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test

Re: [libvirt] [PATCH 1/5] rpc: use virStringSplit instead of strsep

2019-11-14 Thread Pavel Hrdina
On Thu, Nov 14, 2019 at 11:43:29AM +0100, Peter Krempa wrote: > When parsing allowed authentication methods for the native ssh lib > trasnports we used strsep. Since we have virStringSplit helper let's use s/trasnports/transports/ > that one. > > Signed-off-by: Peter Krempa > --- >

Re: [libvirt] [PATCH 0/4] apparmor fixes triggered by multi disk snapshots

2019-11-14 Thread Christian Ehrhardt
On Thu, Nov 14, 2019 at 1:23 AM Cole Robinson wrote: > > On 10/16/19 10:27 AM, Christian Ehrhardt wrote: > > Hi, > > the bugs [1][2] that made me debug into this actually only need the > > last patch (one line), but while coming along I found several > > opportunities for minor improvements of

Re: [libvirt] [PATCH 2/5] util: file: Use g_autofree in virFindFileInPath

2019-11-14 Thread Pavel Hrdina
On Thu, Nov 14, 2019 at 11:43:30AM +0100, Peter Krempa wrote: > Simplify the final lookup loop by freeing memory automatically and thus > being able to directly return the result. > > Signed-off-by: Peter Krempa > --- > src/util/virfile.c | 11 --- > 1 file changed, 4 insertions(+), 7

Re: [libvirt] [PATCH 3/5] util: file: Simplify logic of shortuct cases in virFindFileInPath

2019-11-14 Thread Pavel Hrdina
On Thu, Nov 14, 2019 at 11:43:31AM +0100, Peter Krempa wrote: > Combine the terms in the two sets of nested conditionals an don't reuse > a variable for a more obvious control flow. > > Signed-off-by: Peter Krempa > --- > src/util/virfile.c | 16 ++-- > 1 file changed, 6

Re: [libvirt] [PATCH 4/5] util: file: Replace use of 'strsep' with virStringSplit

2019-11-14 Thread Pavel Hrdina
On Thu, Nov 14, 2019 at 11:43:32AM +0100, Peter Krempa wrote: > Use our helper instead of the gnulib one. > > Signed-off-by: Peter Krempa > --- > src/util/virfile.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-) Reviewed-by: Pavel Hrdina signature.asc Description:

[libvirt] [PATCH 4/4] bootstrap.conf: remove usage of setenv and unsetenv gnulib modules

2019-11-14 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- bootstrap.conf| 2 -- build-aux/syntax-check.mk | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4c784487e2..0f75600a2e 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -70,7 +70,6 @@

[libvirt] [PATCH 3/4] syntax-check: forbid usage of setenv and unsetenv

2019-11-14 Thread Pavel Hrdina
--- build-aux/syntax-check.mk | 11 +++ 1 file changed, 11 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 1c46928ac7..710ac1c949 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1169,6 +1169,14 @@

[libvirt] [PATCH 1/4] replace use of gnulib setenv by g_setenv

2019-11-14 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/security/virt-aa-helper.c | 4 ++-- src/vbox/vbox_XPCOMCGlue.c | 2 +- tests/libxlxml2domconfigtest.c | 4 ++-- tests/lxcxml2xmltest.c | 2 +- tests/qemudomaincheckpointxml2xmltest.c | 2 +-

[libvirt] [PATCH 0/4] replace setenv and unsetenv by Glib functions (kill-a-gnulib-module-a-day initiative)

2019-11-14 Thread Pavel Hrdina
Pavel Hrdina (4): replace use of gnulib setenv by g_setenv replace use of gnulib unsetenv by g_unsetenv syntax-check: forbid usage of setenv and unsetenv bootstrap.conf: remove usage of setenv and unsetenv gnulib modules bootstrap.conf | 2 --

[libvirt] [PATCH 2/4] replace use of gnulib unsetenv by g_unsetenv

2019-11-14 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/virsystemd.c | 4 ++-- src/vbox/vbox_XPCOMCGlue.c | 2 +- tests/qemusecuritytest.c | 2 +- tests/qemuxml2argvtest.c | 10 +- tests/testutils.c | 2 +- tests/testutilsqemu.c | 2 +- tests/vircgrouptest.c | 8

[libvirt] [PATCH 1/5] rpc: use virStringSplit instead of strsep

2019-11-14 Thread Peter Krempa
When parsing allowed authentication methods for the native ssh lib trasnports we used strsep. Since we have virStringSplit helper let's use that one. Signed-off-by: Peter Krempa --- src/rpc/virnetsocket.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff

[libvirt] [PATCH 3/5] util: file: Simplify logic of shortuct cases in virFindFileInPath

2019-11-14 Thread Peter Krempa
Combine the terms in the two sets of nested conditionals an don't reuse a variable for a more obvious control flow. Signed-off-by: Peter Krempa --- src/util/virfile.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c

[libvirt] [PATCH 2/5] util: file: Use g_autofree in virFindFileInPath

2019-11-14 Thread Peter Krempa
Simplify the final lookup loop by freeing memory automatically and thus being able to directly return the result. Signed-off-by: Peter Krempa --- src/util/virfile.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index

[libvirt] [PATCH 0/5] PATCH 0/8] Remove use of 'strsep' gnulib module (kill-a-gnulib-module-a-day initiative)

2019-11-14 Thread Peter Krempa
Peter Krempa (5): rpc: use virStringSplit instead of strsep util: file: Use g_autofree in virFindFileInPath util: file: Simplify logic of shortuct cases in virFindFileInPath util: file: Replace use of 'strsep' with virStringSplit gnulib: Remove use of 'strsep' module bootstrap.conf

  1   2   >