[libvirt] [PATCH] conf: Introduce virDomainDefCputuneValidate helper

2019-03-13 Thread Suyang Chen
move all the def->cputune 'period must be in range' and 'quota must be in range' errors into two macros and called in virDomainDefCputuneValidate function and have it called from virDomainDefValidateInternal function Reason: Two macros maybe easier to debug and change in the future Solve the

[libvirt] [PATCH] snapshots: More clarification about REDEFINE

2019-03-13 Thread Eric Blake
Based on recent list questions about the proposed addition of virDomainCheckpointCreateXML(REDEFINE), it is worth adding some clarification to the existing snapshot redefine documentation that is serving as the basis for checkpoints. Normal snapshot creation requires very few elements from the

Re: [libvirt] [PATCH v5 02/20] qemu: clean up qemuDomainRemoveInactiveCommon

2019-03-13 Thread Eric Blake
On 3/12/19 12:59 PM, John Ferlan wrote: > > > On 3/7/19 12:47 AM, Eric Blake wrote: >> Use VIR_AUTOFREE and saner formatting. No semantic change. >> >> Signed-off-by: Eric Blake >> --- >> src/qemu/qemu_domain.c | 13 + >> 1 file changed, 5 insertions(+), 8 deletions(-) >> > >

Re: [libvirt] [PATCH v5 03/20] backup: Document nuances between different state capture APIs

2019-03-13 Thread Eric Blake
On 3/12/19 12:59 PM, John Ferlan wrote: > > > On 3/7/19 12:47 AM, Eric Blake wrote: >> Upcoming patches will add support for incremental backups via >> a new API; but first, we need a landing page that gives an >> overview of capturing various pieces of guest state, and which >> APIs are best

Re: [libvirt] [PATCH 1/4] conf: Add a new 'xenbus' controller type

2019-03-13 Thread Eric Blake
On 3/8/19 5:05 PM, Jim Fehlig wrote: > xenbus is virtual controller (akin to virtio controllers) for Xen > paravirtual devices. Although all Xen VMs have a xenbus, it has > never been modeled in libvirt, or in Xen native VM config format > for that matter. > > Recently there have been requests to

[libvirt] [PATCH] docs: Consistent spacing in *GetXMLDesc functions

2019-03-13 Thread Eric Blake
We copy-and-paste a lot of our docs, as evidenced by the number of *GetXMLDesc() functions which had the same unusual indentation and missing capital in the second sentence of the returns paragraph. Signed-off-by: Eric Blake --- Pushing under the trivial rule. src/libvirt-domain-snapshot.c |

[libvirt] [PATCH] news: Document recent snapshot topological flag

2019-03-13 Thread Eric Blake
A new API flag is news-worthy. Signed-off-by: Eric Blake --- I'll probably push this one as trivial in 24 hours, if it does not get a review sooner. docs/news.xml | 12 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 896700fa97..1973a0096d

[libvirt] [PATCH] news: Add entry describing support for Xen's max grant frames

2019-03-13 Thread Jim Fehlig
Signed-off-by: Jim Fehlig --- docs/news.xml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 896700fa97..f437a3f455 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -82,6 +82,16 @@ chooses. + + +

[libvirt] [PATCH 0/2] Remove --enable-test-coverage, promote 'make coverage'

2019-03-13 Thread Cole Robinson
This is my follow up to my message here: https://www.redhat.com/archives/libvir-list/2019-February/msg01213.html This removes our custom ./configure --enable-test-coverage and 'make cov' targets in favor of gnulib's 'make coverage' which IMO is much simpler to use. See the mail above for full

[libvirt] [PATCH 1/2] configure: Remove --enable-test-coverage

2019-03-13 Thread Cole Robinson
We provide a custom configure option --enable-test-coverage and 'make cov' target to generate code coverage reports. However gnulib already provides a 'make coverage' which 'just works' and doesn't require a special configure option. This drops our custom implementation in favor of 'make

[libvirt] [PATCH 2/2] docs: hacking: Add 'Code coverage reports' section

2019-03-13 Thread Cole Robinson
Signed-off-by: Cole Robinson --- docs/hacking.html.in | 29 + 1 file changed, 29 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index f99d143b7b..56608fbc9e 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1412,5 +1412,34 @@

[libvirt] [PATCH 8/8] Don't define abs_* variables ourselves

2019-03-13 Thread Andrea Bolognani
Apparently this was necessary in the past because old versions of autoconf/automake didn't make them available, but these days all of the platforms we target include recent enough autotools - as evidenced by the fact that, for example, we already use abs_top_srcdir in tools/ despite the fact that

[libvirt] [PATCH 4/8] tests: Don't define TEST_DRIVER_DIR

2019-03-13 Thread Andrea Bolognani
It's no longer used anywhere. Signed-off-by: Andrea Bolognani --- tests/Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index adbe2f3d5e..237336d648 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -63,9 +63,6 @@ DRIVERLIB_LDFLAGS

[libvirt] [PATCH 6/8] Fix names for abs_top_{src, build}dir variables

2019-03-13 Thread Andrea Bolognani
According to the official documentation for autoconf[1], the correct names for these variables are abs_top_{src,build}dir rather than abs_top{src,build}dir; in fact, we're already using the correct names in various places, so let's just make everything nice and consistent. [1]

[libvirt] [PATCH 7/8] tests: Don't redefine variables for TESTS_ENVIRONMENT

2019-03-13 Thread Andrea Bolognani
We already have code that defines all abs_* variables at the top of tests/Makefile.am, so there is no point in redefining them a second time (using a slightly different shell incantation to boot). Signed-off-by: Andrea Bolognani --- tests/Makefile.am | 16 1 file changed, 4

[libvirt] [PATCH 3/8] tests: Don't use TEST_DRIVER_DIR in virTestCaptureProgramExecChild()

2019-03-13 Thread Andrea Bolognani
TEST_DRIVER_DIR is defined as "$(top_builddir)/src/.libs"; however, as of commit bc6e206322ae, virDriverLoadModule() will search (the absolute version of) that directory automatically, which means passing it through the environment is no longer necessary. Signed-off-by: Andrea Bolognani ---

[libvirt] [PATCH 1/8] tests: Drop CONFIG_HEADER from TESTS_ENVIRONMENT

2019-03-13 Thread Andrea Bolognani
It's no longer used as of commit a9694a8e183e. Signed-off-by: Andrea Bolognani --- tests/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a7f1b39a5e..52a64c9eb1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -486,7 +486,6 @@

[libvirt] [PATCH 5/8] tests: Stop looking for abs_top_srcdir in the environment

2019-03-13 Thread Andrea Bolognani
This code snippet has clearly been cargo-culted, and all its instances can be safely dropped seeing as 1) a much better way to handle the scenario in C programs would be to pass the value via the preprocessor, and 2) the value is actually not used anywhere after being defined. Signed-off-by:

[libvirt] [PATCH 2/8] tests: Drop LIBVIRT_DRIVER_DIR from TESTS_ENVIRONMENT

2019-03-13 Thread Andrea Bolognani
LIBVIRT_DRIVER_DIR is defined as (what is for all intents and purposes equivalent to) "$(abs_top_builddir)/src/.libs"; however, as of commit bc6e206322ae, virDriverLoadModule() will search that directory automatically, which means passing it through the environment is no longer necessary.

[libvirt] [PATCH 0/8] Remove some unnecessary compatibility stuff

2019-03-13 Thread Andrea Bolognani
Andrea Bolognani (8): tests: Drop CONFIG_HEADER from TESTS_ENVIRONMENT tests: Drop LIBVIRT_DRIVER_DIR from TESTS_ENVIRONMENT tests: Don't use TEST_DRIVER_DIR in virTestCaptureProgramExecChild() tests: Don't define TEST_DRIVER_DIR tests: Stop looking for abs_top_srcdir in the environment

Re: [libvirt] [PATCH v2] test: storage: Fill in default vol types for every pool

2019-03-13 Thread Andrea Bolognani
On Fri, 2019-03-08 at 12:43 -0500, Cole Robinson wrote: > static int > testStorageVolumeTypeForPool(int pooltype) > { > -switch (pooltype) { > -case VIR_STORAGE_POOL_DIR: > -case VIR_STORAGE_POOL_FS: > -case VIR_STORAGE_POOL_NETFS: > -return

[libvirt] [PATCH] network: avoid trying to create global firewall rules if unprivileged

2019-03-13 Thread Daniel P . Berrangé
The unprivileged libvirtd does not have permission to create firewall rules, or bridge devices, or do anything to the host network in general. Historically we still activate the network driver though and let the network start API call fail. The startup code path which reloads firewall rules on

[libvirt] [PATCH v2 00/11] conf: partial net model enum conversion

2019-03-13 Thread Cole Robinson
v1 here: https://www.redhat.com/archives/libvir-list/2019-January/msg00763.html Changes since v1: - patch #7, case insensitive model input comparison - Add xml2xml testing - compile tested on freebsd12.0 This series partially converts the net->model value from a string to an enum. We wrap the

[libvirt] [PATCH v2 06/11] bhyve: convert to net model enum

2019-03-13 Thread Cole Robinson
The bhyve driver only works with the virtio and e1000 models, which we already have in the enum. Some error reporting is slightly downgraded to avoid some subtle usage of modelstr Signed-off-by: Cole Robinson --- src/bhyve/bhyve_command.c | 15 ---

[libvirt] [PATCH v2 10/11] vbox: Convert to net enum model

2019-03-13 Thread Cole Robinson
Convert the vbox driver to net model enum, which requires adding enum values for Am79C970A, Am79C973, 82540EM, 82545EM, 82543GC. We preserve the same casing that vbox historically used for these model names. Remove the now unused virDomainNetStrcaseeqModelString Signed-off-by: Cole Robinson ---

[libvirt] [PATCH v2 09/11] vmx: convert to net model enum

2019-03-13 Thread Cole Robinson
Convert the vmware/vmx driver to net model enum, which requires adding enum values for vlance, vmxnet, vmxnet2, and vmxnet3. Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 4 src/conf/domain_conf.h | 4 src/vmx/vmx.c | 52

[libvirt] [PATCH v2 11/11] conf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING

2019-03-13 Thread Cole Robinson
This requires drivers to opt in to handle the raw modelstr network model, all others will error if a passed in XML value is not in the model enum. Enable this feature for libxl/xen/xm and qemu drivers Signed-off-by: Cole Robinson --- src/conf/domain_conf.c| 9 +

[libvirt] [PATCH v2 08/11] conf: Make net model enum compare case insensitive

2019-03-13 Thread Cole Robinson
vbox and vmx drivers do net case insensitive net model comparisons, so for example 'VMXNET3' and 'vmxnet3' and 'VmxNeT3' in the XML will translate to the same driver configuration. To convert these drivers to use net model enum, we will need to do case insensitive comparisons as well. Essentially

[libvirt] [PATCH v2 02/11] conf: net: Add wrapper functions for value

2019-03-13 Thread Cole Robinson
To ease converting the net->model value to an enum, add the wrapper functions: virDomainNetGetModelString virDomainNetSetModelString virDomainNetStreqModelString virDomainNetStrcaseeqModelString Signed-off-by: Cole Robinson --- src/bhyve/bhyve_command.c | 8

[libvirt] [PATCH v2 07/11] qemu: Partially convert to net model enum

2019-03-13 Thread Cole Robinson
This converts the qemu driver to the net model enum, for all the model values that we have hardcoded for various checks, which adds e1000e, virtio-transitional, virtio-non-transitional, usb-net, spapr-vlan, lan9118, smc91c111 Because the qemu driver has historically also allowed the raw model

[libvirt] [PATCH v2 05/11] vz: convert to net model enum

2019-03-13 Thread Cole Robinson
The vz driver only handles three models: virtio, e1000, and rtl8139. Add enum values for those models, and convert the vz driver to handling net->model natively Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 3 +++ src/conf/domain_conf.h | 3 +++ src/vz/vz_driver.c | 7 +++

[libvirt] [PATCH v2 04/11] conf: net: Add model enum, and netfront value

2019-03-13 Thread Cole Robinson
This adds a network model enum. The virDomainNetDef property is named 'model' like most other devices. When the XML parser or a driver calls NetSetModelString, if the passed string is in the enum, we will set net->model, otherwise we copy the string into net->modelstr Add a single example for

[libvirt] [PATCH v2 03/11] conf: net: Rename 'model' to 'modelstr'

2019-03-13 Thread Cole Robinson
We will be adding a 'model' enum in upcoming patches. Rename the existing value to make the differentiation clear Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 16 src/conf/domain_conf.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git

[libvirt] [PATCH v2 01/11] tests: Add several net model passthrough tests

2019-03-13 Thread Cole Robinson
Examples of passing unknown strings through Signed-off-by: Cole Robinson --- tests/qemuxml2argvdata/net-many-models.args | 39 ++ tests/qemuxml2argvdata/net-many-models.xml| 37 + tests/qemuxml2argvtest.c | 1 +

[libvirt] [PATCH 2/2] virt-driver-qemu.m4: Require YAJL

2019-03-13 Thread Michal Privoznik
There is not way that qemu driver can work without being able to format/parse JSON. Signed-off-by: Michal Privoznik --- m4/virt-driver-qemu.m4 | 9 + 1 file changed, 9 insertions(+) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 index 80e1d3ad46..af8edaae0d 100644 ---

[libvirt] [PATCH 1/2] virt-yajl.m4: Drop useless check for qemu

2019-03-13 Thread Michal Privoznik
Firstly, this code is lacking AC_REQUIRE() therefore it may happen that this code is executed before LIBVIRT_DRIVER_CHECK_QEMU is evaluated. Secondly, the code tries to detect installed version of qemu to learn if it uses HMP or QMP and enable YAJL based on that. Well, we support only QMP and also

[libvirt] [PATCH 0/2] Require YAJL for QEMU build

2019-03-13 Thread Michal Privoznik
This also fixes a problem that Cole reported on IRC where qemufirmware test is failing on FreeBSD because QEMU driver is enabled but there's no YAJL. Michal Prívozník (2): virt-yajl.m4: Drop useless check for qemu virt-driver-qemu.m4: Require YAJL m4/virt-driver-qemu.m4 | 9 +

Re: [libvirt] [PATCH v2 00/16] domcaps: use virTristateBool

2019-03-13 Thread Cole Robinson
On 3/6/19 6:36 PM, Cole Robinson wrote: v1 posting: https://www.redhat.com/archives/libvir-list/2019-February/msg01088.html v2 changes: - Rebase to master - Remove the full.xml test in patch #3 - Add virCapsEnum 'format' and use it - Extend docs to explain optional XML v1

[libvirt] fix method delete() in src/main/java/org/libvirt/DomainSnapshot.java

2019-03-13 Thread 傅姜晨
if VDSP is set to null during the method delete(), Object snapshot can't be freed in method free() in the same class. Showing 1 changed file with 1 addition and 7 deletions. View file 8 src/main/java/org/libvirt/DomainSnapshot.java | | @@ -35,13 +35,7 @@ public DomainSnapshot(Connect

[libvirt] [PATCH] tests: Document how to add new replies files

2019-03-13 Thread Andrea Bolognani
We already document how to generate them, so might as well go the extra mile and document the remaining steps. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 8 1 file changed, 8 insertions(+) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c

Re: [libvirt] [PATCH] test: Drop a few unnecessary elements added by virt-install

2019-03-13 Thread Daniel P . Berrangé
On Wed, Mar 13, 2019 at 02:29:08PM +0100, Erik Skultety wrote: > On Wed, Mar 13, 2019 at 10:04:27AM +0100, Andrea Bolognani wrote: > > On Wed, 2019-03-13 at 09:42 +0100, Erik Skultety wrote: > > > The elements were added in commit 4d7ea75e and > > > apparently generated by virt-install, but since

Re: [libvirt] [PATCH] test: Drop a few unnecessary elements added by virt-install

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 10:04:27AM +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 09:42 +0100, Erik Skultety wrote: > > The elements were added in commit 4d7ea75e and > > apparently generated by virt-install, but since the @path attribute > > is missing, the element will never be

Re: [libvirt] [PATCH 1/3] tests: Turn virFileWrapperAddPrefix to void

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 11:13:07AM +0100, Michal Privoznik wrote: > In theory, it's nice to have virFileWrapperAddPrefix() return a > value that indicates if the function succeeded or not. But in > practice, nobody checks for that and in fact blindly believes > that the function succeeded.

Re: [libvirt] [PATCH 3/3] tests: Call virFileWrapperClearPrefixes() for tests using virFileWrapper

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 11:13:09AM +0100, Michal Privoznik wrote: > This is mostly to avoid a memleak that is not a true memleak > anyway - prefixes will be freed by kernel upon test exit. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list

Re: [libvirt] [PATCH 3/3] tests: Call virFileWrapperClearPrefixes() for tests using virFileWrapper

2019-03-13 Thread Martin Kletzander
On Wed, Mar 13, 2019 at 11:13:09AM +0100, Michal Privoznik wrote: This is mostly to avoid a memleak that is not a true memleak anyway - prefixes will be freed by kernel upon test exit. Signed-off-by: Michal Privoznik --- tests/qemufirmwaretest.c | 2 ++ tests/qemuxml2argvtest.c | 1 + 2 files

Re: [libvirt] [PATCH 1/3] tests: Turn virFileWrapperAddPrefix to void

2019-03-13 Thread Martin Kletzander
On Wed, Mar 13, 2019 at 11:13:07AM +0100, Michal Privoznik wrote: In theory, it's nice to have virFileWrapperAddPrefix() return a value that indicates if the function succeeded or not. But in practice, nobody checks for that and in fact blindly believes that the function succeeded. Therefore,

Re: [libvirt] [PATCH 5/5] qemu_hotplug: Fix a rare race condition when detaching a device twice

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 11:35:50 +0100, Michal Privoznik wrote: > On 3/12/19 7:57 PM, Peter Krempa wrote: > > On Tue, Mar 12, 2019 at 16:41:15 +0100, Peter Krempa wrote: > > > On Tue, Mar 12, 2019 at 16:13:20 +0100, Michal Privoznik wrote: [...] > > > Additionally it would be better if

Re: [libvirt] [PATCH 2/3] virFileWrapper: Use VIR_AUTOFREE()

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 11:13:08AM +0100, Michal Privoznik wrote: > This enables us to simplify the code a bit. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v3 2/2] conf: Use virStringParseYesNo()

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 03:30:11PM +0900, Shotaro Gotanda wrote: > this commit remove redundant common pattern in our XML parsing. I appreciate splitting the changes for review purposes, most of the time it's a very good practice which makes the reviewer's life easier, but this was a very simple

Re: [libvirt] [PATCH v3 1/2] util: add virStringParseYesNo()

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 03:30:10PM +0900, Shotaro Gotanda wrote: > This function parse the string "yes" into bool true and > "no" into false, and returns 0. > If the string is anything other than "yes|no", > this function returns -1. > > Signed-off-by: Shotaro Gotanda > --- >

Re: [libvirt] [PATCH 2/2] news: Document firmware autoselection for QEMU driver

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 11:08 +0100, Michal Privoznik wrote: [...] > + > + > + qemu: Enable firmware autoselection > + > + > + Libvirt allows users to provide loader path for some time now. > + However, this puts some burden on users because

Re: [libvirt] [PATCH 2/2] news: Document firmware autoselection for QEMU driver

2019-03-13 Thread Erik Skultety
On Wed, Mar 13, 2019 at 11:08:23AM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > docs/news.xml | 16 > 1 file changed, 16 insertions(+) > > diff --git a/docs/news.xml b/docs/news.xml > index 81466c3d55..b3bfdcbfa1 100644 > --- a/docs/news.xml > +++

Re: [libvirt] [PATCH] conf: Add a function virDomainDefCputuneValidate

2019-03-13 Thread Erik Skultety
conf: Introduce virDomainDefCputuneValidate helper ...would probably sound better... When sending further revisions of a patch it should be noted in the subject prefix, you can do that by using '-vN' when formatting patches with git. On Tue, Mar 12, 2019 at 03:32:40PM -0600, Suyang Chen wrote: >

Re: [libvirt] [PATCH 1/2] qemuFirmwareFetchConfigs: Fix check for @privileged

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 11:08 +0100, Michal Privoznik wrote: > The qemuFirmwareFetchConfigs() function is supposed to fetch all > firmware descriptions from paths defined by firmware.json > specification. This includes user's $HOME directory. However, it > was agreed that if libvirtd is running as

Re: [libvirt] [PATCH 5/5] qemu_hotplug: Fix a rare race condition when detaching a device twice

2019-03-13 Thread Michal Privoznik
On 3/12/19 7:57 PM, Peter Krempa wrote: On Tue, Mar 12, 2019 at 16:41:15 +0100, Peter Krempa wrote: On Tue, Mar 12, 2019 at 16:13:20 +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1623389 If a device is detached twice from the same domain the following race

[libvirt] [PATCH 2/3] virFileWrapper: Use VIR_AUTOFREE()

2019-03-13 Thread Michal Privoznik
This enables us to simplify the code a bit. Signed-off-by: Michal Privoznik --- tests/virfilewrapper.c | 81 ++ 1 file changed, 18 insertions(+), 63 deletions(-) diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index 497e91bd45..88441331ce

[libvirt] [PATCH 0/3] virFileWrapper: Couple of small improvements

2019-03-13 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): tests: Turn virFileWrapperAddPrefix to void virFileWrapper: Use VIR_AUTOFREE() tests: Call virFileWrapperClearPrefixes() for tests using virFileWrapper tests/qemufirmwaretest.c | 2 + tests/qemuxml2argvtest.c | 1 + tests/virfilewrapper.c |

[libvirt] [PATCH 1/3] tests: Turn virFileWrapperAddPrefix to void

2019-03-13 Thread Michal Privoznik
In theory, it's nice to have virFileWrapperAddPrefix() return a value that indicates if the function succeeded or not. But in practice, nobody checks for that and in fact blindly believes that the function succeeded. Therefore, make the function return nothing and just abort() if it would fail.

[libvirt] [PATCH 3/3] tests: Call virFileWrapperClearPrefixes() for tests using virFileWrapper

2019-03-13 Thread Michal Privoznik
This is mostly to avoid a memleak that is not a true memleak anyway - prefixes will be freed by kernel upon test exit. Signed-off-by: Michal Privoznik --- tests/qemufirmwaretest.c | 2 ++ tests/qemuxml2argvtest.c | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/qemufirmwaretest.c

[libvirt] [PATCH 0/2] Document firmware autoselection and fix one trivial bug

2019-03-13 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): qemuFirmwareFetchConfigs: Fix check for @privileged news: Document firmware autoselection for QEMU driver docs/news.xml| 16 src/qemu/qemu_firmware.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) -- 2.19.2

[libvirt] [PATCH 1/2] qemuFirmwareFetchConfigs: Fix check for @privileged

2019-03-13 Thread Michal Privoznik
The qemuFirmwareFetchConfigs() function is supposed to fetch all firmware descriptions from paths defined by firmware.json specification. This includes user's $HOME directory. However, it was agreed that if libvirtd is running as privileged user then his $HOME is ignored (thus $HOME is included in

[libvirt] [PATCH 2/2] news: Document firmware autoselection for QEMU driver

2019-03-13 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- docs/news.xml | 16 1 file changed, 16 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 81466c3d55..b3bfdcbfa1 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -66,6 +66,22 @@ virtio device version is presented to

Re: [libvirt] [libvirt-go-xml PATCH] Make @Path of UNIX chr device source optional

2019-03-13 Thread Daniel P . Berrangé
On Wed, Mar 13, 2019 at 09:58:52AM +0100, Erik Skultety wrote: > According to the libvirt RNG schema, @path is an optional attribute for > the character source element, so we should be okay if it was omitted. > > Signed-off-by: Erik Skultety > --- > domain.go | 2 +- > 1 file changed, 1

Re: [libvirt] [PATCH v4 0/8] bulk snapshot list/redefine (incremental backup saga)

2019-03-13 Thread Daniel P . Berrangé
On Tue, Mar 12, 2019 at 04:52:24PM -0500, Eric Blake wrote: > On 3/12/19 4:35 PM, Nir Soffer wrote: > > >>> We don't have a need to list or define snapshots since we managed > >> snapshots > >>> on oVirt side. > >>> We want an API to list and redefine checkpoints. > >> > >> But the proposed also

Re: [libvirt] [PATCH 3/4] libxl: Add support for max_grant_frames

2019-03-13 Thread Daniel P . Berrangé
On Tue, Mar 12, 2019 at 02:34:43PM -0600, Jim Fehlig wrote: > On 3/12/19 8:17 AM, Daniel P. Berrangé wrote: > > On Fri, Mar 08, 2019 at 04:05:57PM -0700, Jim Fehlig wrote: > > > Add support for setting max_grant_frames in libxl domain config > > > object and include a test to check that it is

Re: [libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 10:32:59 +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 10:22 +0100, Peter Krempa wrote: > > On Wed, Mar 13, 2019 at 10:18:52 +0100, Andrea Bolognani wrote: > > > Anyway, by the end of the series we'll have to pass dataDir to > > > testQemuCapsIterate() in addition

Re: [libvirt] [PATCH 1/8] tests: Introduce testQemuDataInit() and testQemuDataReset()

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 10:29:52 +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 10:12 +0100, Peter Krempa wrote: > > Actually I don't see the reason for anything in this patch. Each > > function is called exactly once, so splitting it out does not make much > > sense without any further

Re: [libvirt] [PATCH 4/8] tests: Use virAsprintf() to build titles

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 10:32 +0100, Peter Krempa wrote: > On Wed, Mar 13, 2019 at 10:25:16 +0100, Andrea Bolognani wrote: > > On Wed, 2019-03-13 at 09:48 +0100, Peter Krempa wrote: > > > On Thu, Mar 07, 2019 at 16:44:33 +0100, Andrea Bolognani wrote: > > [...] > > > > #define DO_TEST(arch, name) \

Re: [libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 10:22 +0100, Peter Krempa wrote: > On Wed, Mar 13, 2019 at 10:18:52 +0100, Andrea Bolognani wrote: > > Anyway, by the end of the series we'll have to pass dataDir to > > testQemuCapsIterate() in addition to using it to build the path for > > both the input and output file, so

Re: [libvirt] [PATCH 4/8] tests: Use virAsprintf() to build titles

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 10:25:16 +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 09:48 +0100, Peter Krempa wrote: > > On Thu, Mar 07, 2019 at 16:44:33 +0100, Andrea Bolognani wrote: > [...] > > > #define DO_TEST(arch, name) \ > > > do { \ > > > +VIR_AUTOFREE(char *) title =

Re: [libvirt] [PATCH 1/8] tests: Introduce testQemuDataInit() and testQemuDataReset()

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 10:12 +0100, Peter Krempa wrote: > Actually I don't see the reason for anything in this patch. Each > function is called exactly once, so splitting it out does not make much > sense without any further justification. > > The need to reset data->ret to 0 is not enough of a

Re: [libvirt] [PATCH 4/8] tests: Use virAsprintf() to build titles

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 09:48 +0100, Peter Krempa wrote: > On Thu, Mar 07, 2019 at 16:44:33 +0100, Andrea Bolognani wrote: [...] > > #define DO_TEST(arch, name) \ > > do { \ > > +VIR_AUTOFREE(char *) title = NULL; \ > > +VIR_AUTOFREE(char *) copyTitle = NULL; \ > > +if

Re: [libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 10:18:52 +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 09:41 +0100, Peter Krempa wrote: > > On Thu, Mar 07, 2019 at 16:44:32 +0100, Andrea Bolognani wrote: > > > This removes a little duplication right away, and more > > > importantly will allow us to perform some

Re: [libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 09:41 +0100, Peter Krempa wrote: > On Thu, Mar 07, 2019 at 16:44:32 +0100, Andrea Bolognani wrote: > > This removes a little duplication right away, and more > > importantly will allow us to perform some interesting > > refactoring later on. [...] > > @@ -47,6 +48,8 @@

Re: [libvirt] [PATCH 1/8] tests: Introduce testQemuDataInit() and testQemuDataReset()

2019-03-13 Thread Peter Krempa
On Wed, Mar 13, 2019 at 10:09:17 +0100, Andrea Bolognani wrote: > On Wed, 2019-03-13 at 09:44 +0100, Peter Krempa wrote: > > On Thu, Mar 07, 2019 at 16:44:30 +0100, Andrea Bolognani wrote: > > > These functions don't do anything too interesting right now, > > > but will be extended significantly

Re: [libvirt] [PATCH 1/8] tests: Introduce testQemuDataInit() and testQemuDataReset()

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 09:44 +0100, Peter Krempa wrote: > On Thu, Mar 07, 2019 at 16:44:30 +0100, Andrea Bolognani wrote: > > These functions don't do anything too interesting right now, > > but will be extended significantly later on. > > The state after all patches applied does not really look

Re: [libvirt] [PATCH] test: Drop a few unnecessary elements added by virt-install

2019-03-13 Thread Andrea Bolognani
On Wed, 2019-03-13 at 09:42 +0100, Erik Skultety wrote: > The elements were added in commit 4d7ea75e and > apparently generated by virt-install, but since the @path attribute > is missing, the element will never be formatted back to the XML which the > libvirt-go-xml-check expects, so it fails. >

Re: [libvirt] [PATCH 2/8] tests: Move ret into testQemuData

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:31 +0100, Andrea Bolognani wrote: > This is not particularly useful right now, but will allow us > to refactor some functionality later on. > > Signed-off-by: Andrea Bolognani > --- > tests/qemucapabilitiestest.c | 10 ++ > tests/qemucaps2xmltest.c | 11

Re: [libvirt] [PATCH 7/8] tests: Introduce testQemuCapsIterate()

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:36 +0100, Andrea Bolognani wrote: > This function iterates over a directory containing > capabilities-related data, extract some useful bits of > information from the file name, and calls a user-provided > callback. > > Signed-off-by: Andrea Bolognani > --- >

Re: [libvirt] [PATCH 8/8] tests: Use testQemuCapsIterate()

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:37 +0100, Andrea Bolognani wrote: > With only a couple minor tweaks, we can make the existing > doCapsTest() functions with testQemuCapsIterate() and finally > remove the need to manually adjust the test programs every time > a new input file is introduced; moreover,

[libvirt] [libvirt-go-xml PATCH] Make @Path of UNIX chr device source optional

2019-03-13 Thread Erik Skultety
According to the libvirt RNG schema, @path is an optional attribute for the character source element, so we should be okay if it was omitted. Signed-off-by: Erik Skultety --- domain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain.go b/domain.go index

Re: [libvirt] [PATCH 6/8] tests: Add testutilsqemu dependency for qemucaps2xmltest

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:35 +0100, Andrea Bolognani wrote: > We're not using any of the functionality offered by the > module at the moment, but we will in just a second. I'd squash this to the patch actually using something from the module. ACK regardless. signature.asc Description: PGP

Re: [libvirt] [PATCH 5/8] tests: Move code from DO_TEST() to doCapsTest()

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:34 +0100, Andrea Bolognani wrote: > This removes the awkard escaping and will allow us to perform > some interesting refactoring later on. > > Signed-off-by: Andrea Bolognani > --- > tests/qemucapabilitiestest.c | 40 +--- >

Re: [libvirt] [PATCH 4/8] tests: Use virAsprintf() to build titles

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:33 +0100, Andrea Bolognani wrote: > We're using static string concatenation at the moment, but > that will no longer be a possibility in a bit. > > Signed-off-by: Andrea Bolognani > --- > tests/qemucapabilitiestest.c | 11 --- > tests/qemucaps2xmltest.c

Re: [libvirt] [PATCH 1/8] tests: Introduce testQemuDataInit() and testQemuDataReset()

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:30 +0100, Andrea Bolognani wrote: > These functions don't do anything too interesting right now, > but will be extended significantly later on. The state after all patches applied does not really look "significant" > > Signed-off-by: Andrea Bolognani > --- >

[libvirt] [PATCH] test: Drop a few unnecessary elements added by virt-install

2019-03-13 Thread Erik Skultety
The elements were added in commit 4d7ea75e and apparently generated by virt-install, but since the @path attribute is missing, the element will never be formatted back to the XML which the libvirt-go-xml-check expects, so it fails. The lack of the @path attribute is not a problem in general,

Re: [libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

2019-03-13 Thread Peter Krempa
On Thu, Mar 07, 2019 at 16:44:32 +0100, Andrea Bolognani wrote: > This removes a little duplication right away, and more > importantly will allow us to perform some interesting > refactoring later on. > > Signed-off-by: Andrea Bolognani > --- > tests/qemucapabilitiestest.c | 15 +--

[libvirt] [PATCH v2 4/4] tools: console: pass stream/fd errors to user

2019-03-13 Thread Nikolay Shirokovskiy
If the console was disconnected due to a connection problem or a problem on the server side it is convinient to provide the cause to the user. If the error come from the API then the error is saved in a virsh global variable. However, since success is returned from virshRunConsole after we reach

[libvirt] [PATCH v2 0/4] tools: console: a fix and improvment

2019-03-13 Thread Nikolay Shirokovskiy
Jonh, I split the 1st patch the other way to avoid changing same lines of code in subsequent patches. Diff to v1[1] - split 1st patch into 3 - change wordings of commit messages/error messages - add minor changes to code as suggested by John [1]

[libvirt] [PATCH v2 2/4] tools: console: add missing locks in callbacks

2019-03-13 Thread Nikolay Shirokovskiy
Stream/fd callbacks accessing console object are called from the event loop thread and the console object is also accessed from the main thread so we are better add locking to handlers. Signed-off-by: Nikolay Shirokovskiy --- tools/virsh-console.c | 35 +-- 1

[libvirt] [PATCH v2 3/4] tools: console: check if console was shutdown in callbacks

2019-03-13 Thread Nikolay Shirokovskiy
On error in main thread virConsoleShutdown is called which deletes fd watches/stream callback and yet callbacks can be called after. Thus we can incorrectly allocate terminalToStream.data memory and get memory leak for example. Let's check if console was shutdown in the very beginning of

[libvirt] [PATCH v2 1/4] tools: console: cleanup console on errors in main thread

2019-03-13 Thread Nikolay Shirokovskiy
We only check now for virObjectWait failures in virshRunConsole but we'd better check and for other failures too. Anyway if failure happened we need to shutdown console to stop delivering events from event loop thread or we are in trouble as console is freed on virshRunConsole exit. We need to

[libvirt] [PATCH v3 2/2] conf: Use virStringParseYesNo()

2019-03-13 Thread Shotaro Gotanda
this commit remove redundant common pattern in our XML parsing. Signed-off-by: Shotaro Gotanda --- src/conf/domain_conf.c | 30 +- src/conf/secret_conf.c | 12 ++-- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH v3 1/2] util: add virStringParseYesNo()

2019-03-13 Thread Shotaro Gotanda
This function parse the string "yes" into bool true and "no" into false, and returns 0. If the string is anything other than "yes|no", this function returns -1. Signed-off-by: Shotaro Gotanda --- src/util/virstring.c | 21 + src/util/virstring.h | 3 +++ 2 files changed, 24

[libvirt] [PATCH v3 0/2] Add function for XML yes|no string handling

2019-03-13 Thread Shotaro Gotanda
Changes since v2: - adjust the code to the coding guideline Shotaro Gotanda (2): util: add virStringParseYesNo() conf: Use virStringParseYesNo() src/conf/domain_conf.c | 30 +- src/conf/secret_conf.c | 12 ++-- src/util/virstring.c | 21