[libvirt] [PATCH 10/10] configure.ac: add foreign to AM_INIT_AUTOMAKE

2019-04-02 Thread Ján Tomko
We do not care about the portability warnings implied by the implicit 'gnu' option. Switch to 'foreign' to opt out of checking the files present in the top directory to let us drop ChangeLog completely. Signed-off-by: Ján Tomko --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git

[libvirt] [PATCH 04/10] build: require yajl >= 2.0.3

2019-04-02 Thread Ján Tomko
The pkg-config file was introduced by commit b729ded which was released in yajl 2.0.3. Since all our supported platforms include at least yajl 2.0.4, use pkg-config to detect the library and set the minimum to 2.0.3. https://repology.org/project/yajl/versions Signed-off-by: Ján Tomko ---

[libvirt] [PATCH 07/10] virJSONValueToString: bail out early on error

2019-04-02 Thread Ján Tomko
Now that we do not need to cater to YAJL 1, move the check for the return value of yajl_gen_alloc earlier, so that we can assume it was successful in later code. Signed-off-by: Ján Tomko --- src/util/virjson.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git

[libvirt] [PATCH 05/10] json: assume WITH_YAJL2

2019-04-02 Thread Ján Tomko
Now that we require YAJL2, drop the code dealing with YAJL 1. Signed-off-by: Ján Tomko --- src/util/virjson.c | 55 +++--- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index d5d66f879f..b163d5c1cb

[libvirt] [PATCH 03/10] build: drop check for SASL1

2019-04-02 Thread Ján Tomko
Even Debian 8 which we no longer support has 2.1.26. https://repology.org/project/cyrus-sasl/versions Signed-off-by: Ján Tomko --- m4/virt-sasl.m4 | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4 index 6ef24fd4b9..7ab9b2c368 100644 ---

[libvirt] [PATCH 09/10] configure.ac: drop -Wno-obsolete from AM_INIT_AUTOMAKE

2019-04-02 Thread Ján Tomko
Even Ubuntu 16.04 has automake 1.11. Now that we no longer cater to automake 1.9, drop the comment as well as the -Wno-obsolete option, since it does not seem to generate any warnings anymore. Signed-off-by: Ján Tomko --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

[libvirt] [PATCH 06/10] build: remove WITH_YAJL2

2019-04-02 Thread Ján Tomko
Signed-off-by: Ján Tomko --- config-post.h | 1 - m4/virt-yajl.m4 | 1 - 2 files changed, 2 deletions(-) diff --git a/config-post.h b/config-post.h index 54731feff7..093f84a7ce 100644 --- a/config-post.h +++ b/config-post.h @@ -44,7 +44,6 @@ # undef WITH_SYSTEMD_DAEMON # undef

[libvirt] [PATCH 00/10] build: drop some old libs and relax GNU strictness

2019-04-02 Thread Ján Tomko
While testing these changes I found that the build is broken with old rbd on (unsupported) Debian 8. Fix the build by dropping support for old rbd. Ján Tomko (10): rbd: depend on diff_iterate2 rbd: drop support for ceph 0.94 build: drop check for SASL1 build: require yajl >= 2.0.3 json:

[libvirt] [PATCH 01/10] rbd: depend on diff_iterate2

2019-04-02 Thread Ján Tomko
This function was added by commit 6d5b969d4206208e91ca807b09aac75f2f428393 librbd: add diff_iterate2 to API git describe: v0.94-1009-g6d5b969d42 contains: v9.0.1~55^2~27 Effectively bump the required version to 9.0.1 now that we no longer try to support Debian 8. Ubuntu 16.04 has 10.2.11:

[libvirt] [PATCH 08/10] configure: split AM_INIT_AUTOMAKE into multiple lines

2019-04-02 Thread Ján Tomko
Make it work better with git history. Signed-off-by: Ján Tomko --- configure.ac | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 880a3a7e40..104990c2c0 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,14 @@

[libvirt] [PATCH 02/10] rbd: drop support for ceph 0.94

2019-04-02 Thread Ján Tomko
Commit 21deeaf02fdf216b08210fc899579736973ca81d added a stub for volStorageBackendRBDGetFlags without marking the arguments as unused, thus breaking the build. Now that we require diff_iterate2 to be present, remove all the conditionally compiled code, including the stub function. Signed-off-by:

Re: [libvirt] [PATCH v3 26/36] network: introduce networkUpdatePortBandwidth

2019-04-02 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Separate network port bandwidth update code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 115 1 file changed, 65 insertions(+),

Re: [libvirt] [PATCH v3 25/36] network: introduce networkReleasePort

2019-04-02 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Separate network port deletion code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 91 - 1 file changed, 59 insertions(+), 32

Re: [libvirt] [PATCH v3 24/36] network: introduce networkNotifyPort

2019-04-02 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Separate network port notification code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé --- src/network/bridge_driver.c | 106 +--- 1 file changed, 63 insertions(+), 43

Re: [libvirt] [PATCH v3 23/36] network: introduce networkAllocatePort

2019-04-02 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: Separate network port allocation code from the domain driver network callback implementation. Signed-off-by: Daniel P. Berrangé Reviewed-by: Laine Stump --- src/network/bridge_driver.c | 143 +++- 1 file

Re: [libvirt] [PATCH v3 22/36] network: remove the virDomainNetBandwidthChangeAllowed callback

2019-04-02 Thread Laine Stump
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: The current qemu driver code for changing bandwidth on a NIC first asks the network driver if the change is supported, then changes the bandwidth on the VIF, and then tells the network driver to update the bandwidth on the bridge. This is

Re: [libvirt] [PATCH 7/7] qemu: monitor: Avoid unnecessary copies of command string

2019-04-02 Thread Laine Stump
On 3/29/19 9:33 AM, Peter Krempa wrote: Use virJSONValueToBuffer so that we can append the command terminator string without copying of the string again. Also avoid a 'strlen' as we can query the buffer use size. Signed-off-by: Peter Krempa Reviewed-by: Laine Stump ---

Re: [libvirt] [PATCH 6/7] qemu: monitor: Remove few debug statements

2019-04-02 Thread Laine Stump
On 3/29/19 9:33 AM, Peter Krempa wrote: The internal qemu machinery already logs the sent message via the PROBE point in qemuMonitorSend and the monitor receive function. Those are way better as they are easy grepable. Remove the additional ones from the monitor code which just duplicate the

Re: [libvirt] [PATCH 5/7] util: json: Export virJSONValueToBuffer

2019-04-02 Thread Laine Stump
On 3/29/19 9:33 AM, Peter Krempa wrote: Signed-off-by: Peter Krempa I would have just done this directly in Patch 4, but no harm in separating it. Reviewed-by: Laine Stump --- src/libvirt_private.syms | 1 + src/util/virjson.c | 4 ++-- src/util/virjson.h | 5 +

Re: [libvirt] [PATCH 3/7] util: json: Use virBuffer in JSON->string conversion

2019-04-02 Thread Laine Stump
On 3/29/19 9:33 AM, Peter Krempa wrote: The last step of the conversion involves copying of the generated JSON into a separate string. We can use a virBuffer to do this as this will also allow to subsequently use the buffer when we actually need to do some other formatting of the string.

Re: [libvirt] [PATCH 4/7] util: json: Don't bother logging output string in virJSONValueToString

2019-04-02 Thread Laine Stump
On 3/29/19 9:33 AM, Peter Krempa wrote: We have tests that validate the XML formatter. Additionally almost every guide tells users to disable JSON logging. Drop logging of output string in virJSONValueToString. Signed-off-by: Peter Krempa Assuming that anywhere it might be useful to see the

Re: [libvirt] [PATCH v4 2/2] PPC64 support for NVIDIA V100 GPU with NVLink2 passthrough

2019-04-02 Thread Daniel Henrique Barboza
On 4/2/19 4:37 AM, Peter Krempa wrote: On Tue, Mar 12, 2019 at 18:55:50 -0300, Daniel Henrique Barboza wrote: The NVIDIA V100 GPU has an onboard RAM that is mapped into the host memory and accessible as normal RAM via an NVLink2 bridge. When passed through in a guest, QEMU puts the NVIDIA

Re: [libvirt] [PATCH v4 1/2] qemu_domain: NVLink2 bridge detection function for PPC64

2019-04-02 Thread Daniel Henrique Barboza
On 4/2/19 5:34 AM, Erik Skultety wrote: On Tue, Mar 12, 2019 at 06:55:49PM -0300, Daniel Henrique Barboza wrote: The NVLink2 support in QEMU implements the detection of NVLink2 capable devices by verifying the attributes of the VFIO mem region QEMU allocates for the NVIDIA GPUs. To properly

Re: [libvirt] [PATCH v4 1/2] qemu_domain: NVLink2 bridge detection function for PPC64

2019-04-02 Thread Daniel Henrique Barboza
On 4/2/19 4:46 AM, Ján Tomko wrote: On Tue, Apr 02, 2019 at 09:21:53AM +0200, Peter Krempa wrote: On Tue, Mar 12, 2019 at 18:55:49 -0300, Daniel Henrique Barboza wrote: The NVLink2 support in QEMU implements the detection of NVLink2 capable devices by verifying the attributes of the VFIO

Re: [libvirt] [PATCH v4 1/2] qemu_domain: NVLink2 bridge detection function for PPC64

2019-04-02 Thread Daniel Henrique Barboza
On 4/2/19 4:21 AM, Peter Krempa wrote: On Tue, Mar 12, 2019 at 18:55:49 -0300, Daniel Henrique Barboza wrote: The NVLink2 support in QEMU implements the detection of NVLink2 capable devices by verifying the attributes of the VFIO mem region QEMU allocates for the NVIDIA GPUs. To properly

Re: [libvirt] [PATCH v3 03/36] conf: simplify link from hostdev back to network device

2019-04-02 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 08:50:56PM -0400, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > hostdevs have a link back to the original network device. This is fairly > > generic accepting any type of device, however, we don't intend to make > > use of this approach in future.

Re: [libvirt] [PATCH v3 02/36] network: pass a virNetworkPtr to port management APIs

2019-04-02 Thread Daniel P . Berrangé
On Thu, Mar 21, 2019 at 08:49:38PM -0400, Cole Robinson wrote: > On 3/19/19 8:46 AM, Daniel P. Berrangé wrote: > > The APIs for allocating/notifying/removing network ports just take > > an internal domain interface struct right now. As a step towards > > turning these into public facing APIs, add

Re: [libvirt] [PATCH v6 00/33] BaselineHypervisorCPU using QEMU QMP exchanges

2019-04-02 Thread Collin Walling
May I ask what the current status of this item is? Is this still being worked on or has it been shelved? On 1/12/19 7:49 PM, Chris Venteicher wrote: Some architectures (S390) depend on QEMU to compute baseline CPU model and expand a models feature set. Interacting with QEMU requires starting

[libvirt] [PATCHv2 13/14] vvv SQUASH HERE: reformat parseFile output data

2019-04-02 Thread Ján Tomko
Remove trailing slashes and call json_reformat --- tests/virjsondata/parse-Harder-out.json | 17 +- tests/virjsondata/parse-NotSoSimple-out.json | 18 +- tests/virjsondata/parse-Simple-out.json | 7 +- tests/virjsondata/parse-VeryHard-out.json| 167 --- 4 files

[libvirt] [PATCHv2 06/14] virjsontest: remove unnecessary cleanup labels

2019-04-02 Thread Ján Tomko
Now that cleanup is handled automatically, we can use 'return' more often. Signed-off-by: Ján Tomko --- tests/virjsontest.c | 160 ++-- 1 file changed, 65 insertions(+), 95 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index

[libvirt] [PATCHv2 00/14] virjsontest: separate some tests into files

2019-04-02 Thread Ján Tomko
v1: cover.1549987014.git.jto...@redhat.com v2: prettify output, use VIR_AUTO and better-looking commit messages Ján Tomko (14): virjsontest: switch AddAndRemove tests to work with files testJSONFromString: regroup if blocks virjsontest: reword error messages in testJSONFromString

[libvirt] [PATCHv2 08/14] virjsontest: switch DO_TEST_PARSE_FILE to use output files

2019-04-02 Thread Ján Tomko
Also switch the expected output of DO_TEST_PARSE_FILE to be in a file, now that we demonstrated the input files match the expected string representation. Signed-off-by: Ján Tomko --- tests/virjsondata/parse-Harder-out.json | 4 ++ tests/virjsondata/parse-NotSoSimple-out.json | 3 ++

[libvirt] [PATCHv2 05/14] virjsontest: use VIR_AUTOFREE for strings

2019-04-02 Thread Ján Tomko
The only remaining use of VIR_FREE is for reusing variables. Signed-off-by: Ján Tomko --- tests/virjsontest.c | 42 ++ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index bf2bb85c6c..12458878e0

[libvirt] [PATCHv2 09/14] virjsontest: reformat add-remove test input data

2019-04-02 Thread Ján Tomko
Use json_reformat to make the input more readable. Signed-off-by: Ján Tomko --- tests/virjsondata/add-remove-failure-in.json | 4 +++- tests/virjsondata/add-remove-success-in.json | 5 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCHv2 12/14] virjsondata: json_reformat input data

2019-04-02 Thread Ján Tomko
Remove trailing slashes and run json_reformat. Signed-off-by: Ján Tomko --- tests/virjsondata/parse-Harder-in.json | 17 +- tests/virjsondata/parse-NotSoSimple-in.json | 18 ++- tests/virjsondata/parse-Simple-in.json | 7 +- tests/virjsondata/parse-VeryHard-in.json| 167

[libvirt] [PATCHv2 11/14] virjsontest: prettify AddRemove test

2019-04-02 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virjsondata/add-remove-success-out.json | 4 ++-- tests/virjsontest.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virjsondata/add-remove-success-out.json b/tests/virjsondata/add-remove-success-out.json

[libvirt] [PATCHv2 14/14] virjsontest: prettify JSONFromFile test

2019-04-02 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virjsondata/parse-Harder-out.json | 22 +- tests/virjsondata/parse-NotSoSimple-out.json | 24 +- tests/virjsondata/parse-Simple-out.json | 6 +- tests/virjsondata/parse-VeryHard-out.json| 282 +-- tests/virjsontest.c

[libvirt] [PATCHv2 04/14] virjsontest: use VIR_AUTOPTR for virJSONValues

2019-04-02 Thread Ján Tomko
Remove all explicit usage of virJSONValueFree. Signed-off-by: Ján Tomko --- tests/virjsontest.c | 45 +++-- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 51777ba770..bf2bb85c6c 100644 ---

[libvirt] [PATCHv2 02/14] testJSONFromString: regroup if blocks

2019-04-02 Thread Ján Tomko
Handle failure to parse the JSON in an else branch for readability. Signed-off-by: Ján Tomko --- tests/virjsontest.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 429eb58704..3c4bb4141a 100644 ---

[libvirt] [PATCHv2 07/14] virjsontest: introduce DO_TEST_PARSE_FILE

2019-04-02 Thread Ján Tomko
Introduce a new macro DO_TEST_PARSE_FILE which takes the input JSON from a file instead of a C string. This lets us get rid of quote escaping and makes the JSON easier to edit. The output JSON is still taken from a string and will be moved separately. Signed-off-by: Ján Tomko ---

[libvirt] [PATCHv2 10/14] vvv--- squash into: json_reformat add-remove output data

2019-04-02 Thread Ján Tomko
--- tests/virjsondata/add-remove-success-out.json | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/virjsondata/add-remove-success-out.json b/tests/virjsondata/add-remove-success-out.json index 9f1e44637c..50f1770910 100644 ---

[libvirt] [PATCHv2 03/14] virjsontest: reword error messages in testJSONFromString

2019-04-02 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virjsontest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 3c4bb4141a..51777ba770 100644 --- a/tests/virjsontest.c +++ b/tests/virjsontest.c @@ -29,16 +29,16 @@

[libvirt] [PATCHv2 01/14] virjsontest: switch AddAndRemove tests to work with files

2019-04-02 Thread Ján Tomko
Instead of using JSON in C strings, put it in separate files for easier manipulation. Signed-off-by: Ján Tomko Reviewed-by: Andrea Bolognani --- tests/virjsondata/add-remove-failure-in.json | 1 + tests/virjsondata/add-remove-success-in.json | 1 +

[libvirt] [PATCH] rpc: Refactor cleanup paths in virNetLibsshAuthenticatePassword

2019-04-02 Thread Peter Krempa
Now that the memory disposal is handled automatically we can simplify the cleanup paths. In this case it's not as simple as sometimes the value of the called function is returned. While at it fix the initialization value of the returned variable. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 0/5] qemu: caps: Always assume most of block job capabilities

2019-04-02 Thread Ján Tomko
On Tue, Apr 02, 2019 at 01:56:43PM +0200, Peter Krempa wrote: Peter Krempa (5): qemu: capabilities: Always assume QEMU_CAPS_BLOCKJOB_ASYNC qemu: domain: drop qemuDomainSupportsBlockJobs qemu: capabilities: Always assume QEMU_CAPS_BLOCK_COMMIT qemu: capabilities: Always assume

Re: [libvirt] [PATCH 3/4] security: avoid use of dirent d_type field

2019-04-02 Thread Daniel P . Berrangé
On Tue, Apr 02, 2019 at 03:27:47PM +0200, Michal Privoznik wrote: > On 4/2/19 2:40 PM, Daniel P. Berrangé wrote: > > The d_type field cannot be assumed to be filled. Some filesystems, such > > as older XFS, will simply report DT_UNKNOWN. > > > > Even if the d_type is filled in, the use of it in

Re: [libvirt] deadlock in remoteDispatchDomainUndefine vs daemonStreamHandleAbort

2019-04-02 Thread Michal Privoznik
On 4/2/19 10:45 AM, Christian Ehrhardt wrote: > On Mon, Apr 1, 2019 at 4:35 PM Michal Privoznik wrote: >> >> On 4/1/19 4:25 PM, Christian Ehrhardt wrote: >>> Hi, >>> I happened to analyze a bug [1] report I got from a friend and for >>> quite a while it was rather elusive. But I now finally got

Re: [libvirt] [PATCH 4/4] cfg.mk: block use of d_type from dirent by default

2019-04-02 Thread Michal Privoznik
On 4/2/19 2:40 PM, Daniel P. Berrangé wrote: The use of d_type is non-portable and leads to surprises when the OS does not fill in any value except DT_UNKNOWN. Blacklist its usage except in files which inherantly don't require portability (cgroup and selinux) s/and selinux// Signed-off-by:

Re: [libvirt] [PATCH 0/4] Fix various test portability problems

2019-04-02 Thread Michal Privoznik
On 4/2/19 2:40 PM, Daniel P. Berrangé wrote: This includes a slight tweak to the stat/lstat patch wrt logging and fixes use of the dirent d_type field. Daniel P. Berrangé (4): tests: fix mocking of stat() / lstat() functions qemu: don't rely on the non-portable d_type field in dirent

Re: [libvirt] [PATCH 3/4] security: avoid use of dirent d_type field

2019-04-02 Thread Michal Privoznik
On 4/2/19 2:40 PM, Daniel P. Berrangé wrote: The d_type field cannot be assumed to be filled. Some filesystems, such as older XFS, will simply report DT_UNKNOWN. Even if the d_type is filled in, the use of it in the SELinux functions is dubious. If labelling all files in a directory there's no

Re: [libvirt] [PATCH 08/10] util: Introduce 'virpin' module for dealing with PIN numbers

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 03:04:59PM +0200, Peter Krempa wrote: In https://www.redhat.com/archives/libvir-list/2019-February/msg01475.html I was notified that I forgot to deal with the possibility that the JSON number would contain jtomko's PIN number. I had to look around for a leaked list of PIN

Re: [libvirt] [PATCH 04/10] util: buffer: Remove struct member munging

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 03:04:55PM +0200, Peter Krempa wrote: This was meant to stop abusing the members directly, but we don't do this for other cases. Additionally this did not stop the test from touching the members. Remove the header obscurization. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 03/10] Use VIR_AUTODISPOSE_STR instead of VIR_DISPOSE_STRING where possible

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 03:04:54PM +0200, Peter Krempa wrote: Refactor code paths which clear strings on cleanup paths to use the automatic helper. Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c| 3 +-- src/qemu/qemu_command.c | 3 +--

Re: [libvirt] [PATCH 5/5] qemuBuildMemoryBackendProps: Get pagesize early

2019-04-02 Thread Michal Privoznik
On 4/2/19 2:57 PM, Ján Tomko wrote: On Mon, Apr 01, 2019 at 04:04:37PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1693066 Up until memfd introduction (in 24b74d187ca) we did not need to know @pagesize because qemuGetDomainHupageMemPath() could deal with it being

Re: [libvirt] [PATCH 02/10] util: alloc: Add automatic cleanup/disposal of strings

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 03:04:53PM +0200, Peter Krempa wrote: VIR_AUTODISPOSE_STR is similar to VIR_AUTOFREE(char *) but uses virDispose for clearing of the stored string. This patch also refactors VIR_DISPOSE to use the new helper which is used for the new macro. Signed-off-by: Peter Krempa

Re: [libvirt] [PATCH 5/5] qemuBuildMemoryBackendProps: Get pagesize early

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 04:04:37PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1693066 Up until memfd introduction (in 24b74d187ca) we did not need to know @pagesize because qemuGetDomainHupageMemPath() could deal with it being zero (value of zero means use the

[libvirt] [PATCH 4/4] cfg.mk: block use of d_type from dirent by default

2019-04-02 Thread Daniel P . Berrangé
The use of d_type is non-portable and leads to surprises when the OS does not fill in any value except DT_UNKNOWN. Blacklist its usage except in files which inherantly don't require portability (cgroup and selinux) Signed-off-by: Daniel P. Berrangé --- cfg.mk | 16 1 file

[libvirt] [PATCH 2/4] qemu: don't rely on the non-portable d_type field in dirent

2019-04-02 Thread Daniel P . Berrangé
d_type is a non-portable extension to the struct dirent and even if it exists, its value may be DT_UNKNOWN if the filesystem doesn't support it. This is common with older versions of XFS which have ftype=0 feature. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_firmware.c | 12 +---

[libvirt] [PATCH 0/4] Fix various test portability problems

2019-04-02 Thread Daniel P . Berrangé
This includes a slight tweak to the stat/lstat patch wrt logging and fixes use of the dirent d_type field. Daniel P. Berrangé (4): tests: fix mocking of stat() / lstat() functions qemu: don't rely on the non-portable d_type field in dirent security: avoid use of dirent d_type field

[libvirt] [PATCH 1/4] tests: fix mocking of stat() / lstat() functions

2019-04-02 Thread Daniel P . Berrangé
Quite a few of the tests have a need to mock the stat() / lstat() functions and they are taking somewhat different & inconsistent approaches none of which are actually fully correct. This is shown by fact that 'make check' fails on 32-bit hosts. Investigation revealed that the code was calling

Re: [libvirt] [PATCH 4/5] virfile: Introduce and use virFileGetDefaultHugepage

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 04:04:36PM +0200, Michal Privoznik wrote: This helper returns the default hugetlbfs mount point from given array of mount points. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/qemu/qemu_conf.c | 12 src/util/virfile.c | 25

[libvirt] [PATCH 3/4] security: avoid use of dirent d_type field

2019-04-02 Thread Daniel P . Berrangé
The d_type field cannot be assumed to be filled. Some filesystems, such as older XFS, will simply report DT_UNKNOWN. Even if the d_type is filled in, the use of it in the SELinux functions is dubious. If labelling all files in a directory there's no reason to skip things which are not regular

Re: [libvirt] [PATCH 3/5] qemuxml2xmltest: Add memfd tests

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 04:04:35PM +0200, Michal Privoznik wrote: Somehow, these were not tested. Use symlinks to point expected output back to the input. This way we can also fix some discrepancies in the input XMLs. Signed-off-by: Michal Privoznik --- .../fd-memory-no-numa-topology.xml

Re: [libvirt] [PATCH 2/5] qemuxml2xmltest: Move virObjectUnref() call

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 04:04:34PM +0200, Michal Privoznik wrote: The current location looks very arbitrary. Move it to the end of the mymain() function so it is less confusing. Signed-off-by: Michal Privoznik --- tests/qemuxml2xmltest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [libvirt] [PATCH 2/3] maint: Drop ChangeLog-old

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 06:50:52PM +0200, Andrea Bolognani wrote: This file contains the old schoold ChangeLog, which was manually old school? old schooled? updated for every set of changes before the switch to git. When libvirt was imported into git, however, *all* history was preserved,

Re: [libvirt] [PATCH 3/3] maint: Update references to ChangeLog*

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 06:50:53PM +0200, Andrea Bolognani wrote: The files no longer exist, at least not in their previous form, so references to them need to be reworked to still make sense. Signed-off-by: Andrea Bolognani --- docs/news-ascii.xsl | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [libvirt] [PATCH 1/5] qemuxml2argvdata: Drop useless spaces at the beginning of lines

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 04:04:33PM +0200, Michal Privoznik wrote: There are three test XMLs that have useless spaces at the beginning of each line. I intend to add these to qemuxml2xmltest and make xmlout a symlink to the original XML. In order to do that the XMLs must look better than they do

Re: [libvirt] [PATCH 1/3] maint: Stop generating ChangeLog from git

2019-04-02 Thread Ján Tomko
On Tue, Apr 02, 2019 at 01:24:37PM +0200, Andrea Bolognani wrote: On Tue, 2019-04-02 at 12:43 +0200, Ján Tomko wrote: On Mon, Apr 01, 2019 at 06:50:51PM +0200, Andrea Bolognani wrote: > +If you're interested in the full list of changes made to libvirt since > +the project was started, you can

Re: [libvirt] [PATCH] virDirRead: Fix d_type if needed

2019-04-02 Thread Daniel P . Berrangé
On Tue, Apr 02, 2019 at 02:17:35PM +0200, Michal Privoznik wrote: > Some of our code iterates over a directory and does some > decisions based on entry type (e.g. if it's not a regular file > continue with next iteration). This is done by looking at > ent->d_type struct member. However, in some

Re: [libvirt] [PATCH 1/3] maint: Stop generating ChangeLog from git

2019-04-02 Thread Daniel P . Berrangé
On Tue, Apr 02, 2019 at 12:43:33PM +0200, Ján Tomko wrote: > On Mon, Apr 01, 2019 at 06:50:51PM +0200, Andrea Bolognani wrote: > > Our ChangeLog is generated by basically redirecting the output > > of 'git log' into it so, as can be expected, it has only gotten > > bigger as development has

[libvirt] [PATCH] virDirRead: Fix d_type if needed

2019-04-02 Thread Michal Privoznik
Some of our code iterates over a directory and does some decisions based on entry type (e.g. if it's not a regular file continue with next iteration). This is done by looking at ent->d_type struct member. However, in some cases (e.g. for some filesystems) the d_type can be set to DT_UNKNOWN which

Re: [libvirt] [PATCH v2] examples: fix 64-bit integer formatting on Windows

2019-04-02 Thread Michal Privoznik
On 4/2/19 11:24 AM, Daniel P. Berrangé wrote: The Windows printf functions don't support %llu/%lld for printing 64-bit integers. For most of libvirt this doesn't matter as we rely on gnulib which provides a replacement printf that is sane. The example code is designed to compile against the

Re: [libvirt] [PATCH v2 15/29] conf: Replace virDomainDiskSourceParse by virDomainStorageSourceParse

2019-04-02 Thread Ján Tomko
On Tue, Apr 02, 2019 at 02:09:24PM +0200, Peter Krempa wrote: On Tue, Apr 02, 2019 at 09:35:36 +0200, Ján Tomko wrote: On Fri, Mar 22, 2019 at 07:00:51PM +0100, Peter Krempa wrote: > virDomainDiskSourceParse was now just a thin wrapper without any extra > value. Replace all usage of it by the

Re: [libvirt] [PATCH v2 15/29] conf: Replace virDomainDiskSourceParse by virDomainStorageSourceParse

2019-04-02 Thread Peter Krempa
On Tue, Apr 02, 2019 at 09:35:36 +0200, Ján Tomko wrote: > On Fri, Mar 22, 2019 at 07:00:51PM +0100, Peter Krempa wrote: > > virDomainDiskSourceParse was now just a thin wrapper without any extra > > value. Replace all usage of it by the function it calls and remove the > > function. > > > >

[libvirt] [PATCH 4/5] qemu: capabilities: Always assume QEMU_CAPS_DRIVE_MIRROR

2019-04-02 Thread Peter Krempa
qemu added the 'drive-mirror' command in v1.3.0 (d9b902db3fb71fdc) Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 - src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_driver.c| 5 -- src/qemu/qemu_migration.c

[libvirt] [PATCH 2/5] qemu: domain: drop qemuDomainSupportsBlockJobs

2019-04-02 Thread Peter Krempa
It always returns true. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 14 -- src/qemu/qemu_domain.h | 2 -- src/qemu/qemu_driver.c | 12 3 files changed, 28 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH 5/5] qemu: capabilities: Always assume disk snapshot caps

2019-04-02 Thread Peter Krempa
'blockdev-snapshot-sync' is present in QEMU since v0.14.0-rc0 and 'transaction' since v1.1.0 (52e7c241ac766406f05fa) Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 9 + src/qemu/qemu_capabilities.h | 4 ++--

[libvirt] [PATCH 1/5] qemu: capabilities: Always assume QEMU_CAPS_BLOCKJOB_ASYNC

2019-04-02 Thread Peter Krempa
This was detected by the presence of 'block-stream' which is present in qemu since v1.1 (db58f9c0605fa151b8c4) Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 - src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_domain.c

[libvirt] [PATCH 3/5] qemu: capabilities: Always assume QEMU_CAPS_BLOCK_COMMIT

2019-04-02 Thread Peter Krempa
qemu added the 'block-commit' command in v1.3.0 (ed61fc10e8c8d2) Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 -- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_driver.c | 6 --

[libvirt] [PATCH 0/5] qemu: caps: Always assume most of block job capabilities

2019-04-02 Thread Peter Krempa
Peter Krempa (5): qemu: capabilities: Always assume QEMU_CAPS_BLOCKJOB_ASYNC qemu: domain: drop qemuDomainSupportsBlockJobs qemu: capabilities: Always assume QEMU_CAPS_BLOCK_COMMIT qemu: capabilities: Always assume QEMU_CAPS_DRIVE_MIRROR qemu: capabilities: Always assume disk snapshot

[libvirt] [PATCH 2/2] qemu: Remove cleanup section of virQEMUCapsInitQMPMonitorTCG

2019-04-02 Thread Peter Krempa
There's nothing to clean up. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 67cdb8ab96..b55274955e 100644 ---

[libvirt] [PATCH 1/2] qemu: Remove ATTRIBUTE_UNUSED from 'qemuCaps' of virQEMUCapsInitQMPMonitorTCG

2019-04-02 Thread Peter Krempa
It's actually used. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index eb91295f93..67cdb8ab96 100644 --- a/src/qemu/qemu_capabilities.c +++

[libvirt] [PATCH 0/2] qemu: caps: Few more cleanups

2019-04-02 Thread Peter Krempa
These were prompted by the review on the original series. Both will be pushed as trivial once the release is out. Peter Krempa (2): qemu: Remove ATTRIBUTE_UNUSED from 'qemuCaps' of virQEMUCapsInitQMPMonitorTCG qemu: Remove cleanup section of virQEMUCapsInitQMPMonitorTCG

Re: [libvirt] [PATCH 0/3] maint: Drop ChangeLog*

2019-04-02 Thread Andrea Bolognani
On Tue, 2019-04-02 at 12:38 +0200, Ján Tomko wrote: > On Mon, Apr 01, 2019 at 06:50:50PM +0200, Andrea Bolognani wrote: > > Patch 2/3 has been snipped quite extensively so that it would > > make it to the mailing list: the unabridged version of this > > series can be fetched from > > > >

Re: [libvirt] [PATCH 1/3] maint: Stop generating ChangeLog from git

2019-04-02 Thread Andrea Bolognani
On Tue, 2019-04-02 at 12:43 +0200, Ján Tomko wrote: > On Mon, Apr 01, 2019 at 06:50:51PM +0200, Andrea Bolognani wrote: > > +If you're interested in the full list of changes made to libvirt since > > +the project was started, you can clone the git repository from > > + > > +

Re: [libvirt] [PATCH 0/3] maint: Drop ChangeLog*

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 06:50:50PM +0200, Andrea Bolognani wrote: Rationale in the respective commit messages. Patch 2/3 has been snipped quite extensively so that it would make it to the mailing list: the unabridged version of this series can be fetched from

Re: [libvirt] [PATCH 1/3] maint: Stop generating ChangeLog from git

2019-04-02 Thread Ján Tomko
On Mon, Apr 01, 2019 at 06:50:51PM +0200, Andrea Bolognani wrote: Our ChangeLog is generated by basically redirecting the output of 'git log' into it so, as can be expected, it has only gotten bigger as development has progressed. As of today, its size has reached pretty much comical levels: $

[libvirt] [jenkins-ci PATCH] lcitool: include gdb, strace, lsof & netstat by default

2019-04-02 Thread Daniel P . Berrangé
When debugging why tests fail it is important to have commonly used tools like gdb, strace, lsof and netstat available. Note that although the entry for FreeBSD is blank for strace and net-tools, the truss (strace equiv) and netstat tools will be present as they are part of the FreeBSD base

Re: [libvirt] [PATCH 5/5] qemu: domain: Forbid copy_on_read option also for floppies

2019-04-02 Thread Ján Tomko
On Fri, Mar 29, 2019 at 02:53:57PM +0100, Peter Krempa wrote: Using copy_on_read for removable disks is a hassle. It also does not work for CDROMs at all as the image is supposed to be read-only and we might ignore it for floppies when they are started as empty. Forbid it for floppies completely

Re: [libvirt] [PATCH 4/5] qemu: hotplug: Disallow media change while blockjob is active

2019-04-02 Thread Ján Tomko
On Fri, Mar 29, 2019 at 02:53:56PM +0100, Peter Krempa wrote: Until the block job completes we can't change the disk chain. Removal would fail as the block job still has reference to the chain. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 7 +++ 1 file changed, 7 insertions(+)

Re: [libvirt] [PATCH 3/5] qemu: hotplug: Use VIR_AUTOUNREF for virQEMUDriverConfigPtr

2019-04-02 Thread Ján Tomko
On Fri, Mar 29, 2019 at 02:53:55PM +0100, Peter Krempa wrote: Unref the config pointer automatically in code paths which get a local copy. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 40 +--- 1 file changed, 13 insertions(+), 27 deletions(-)

[libvirt] [PATCH 0/5] examples: enforce compiler warning flags

2019-04-02 Thread Daniel P . Berrangé
The example programs emitted a number of warnings even without having the WARN_CFLAGS set. Once they were set a bunch more flaws came to light. Fix them all and enforce warnings so that the example programs are higher quality code. Daniel P. Berrangé (5): examples: fix 64-bit integer formatting

[libvirt] [PATCH 2/5] examples: avoid goto jump over initialization of variable

2019-04-02 Thread Daniel P . Berrangé
Jumping over the declaration and initialization of a variable is bad as it means the jump target sees a potentially non-initialized variable. Signed-off-by: Daniel P. Berrangé --- examples/admin/client_limits.c | 2 +- examples/admin/threadpool_params.c | 2 +- 2 files changed, 2

[libvirt] [PATCH 1/5] examples: fix 64-bit integer formatting on Windows

2019-04-02 Thread Daniel P . Berrangé
The Windows printf functions don't support %llu/%lld for printing 64-bit integers. For most of libvirt this doesn't matter as we rely on gnulib which provides a replacement printf that is sane. The example code is designed to compile against the normal OS headers, with no use of gnulib and thus

[libvirt] [PATCH 3/5] domtop: remove unused domain name parameter

2019-04-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- examples/domtop/domtop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/domtop/domtop.c b/examples/domtop/domtop.c index e1e7fbff8b..c9b51aed51 100644 --- a/examples/domtop/domtop.c +++ b/examples/domtop/domtop.c @@ -186,8

[libvirt] [PATCH 5/5] examples: enable all compiler warnings

2019-04-02 Thread Daniel P . Berrangé
Now that all the examples are warning free, keep it that way by enabling all the normal compiler warning flags. Signed-off-by: Daniel P. Berrangé --- examples/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index

[libvirt] [PATCH 4/5] dominfo: make example more useful

2019-04-02 Thread Daniel P . Berrangé
The example currently assumes that a NULL URI will open Xen and thus also assumes that a domain with ID 0 exists. Change it to require the URI and a domain name as command line arguments. Signed-off-by: Daniel P. Berrangé --- examples/dominfo/info1.c | 25 ++--- 1 file

Re: [libvirt] [PATCH] tests: fix mocking of stat() / lstat() functions

2019-04-02 Thread Michal Privoznik
On 4/2/19 10:58 AM, Daniel P. Berrangé wrote: > On Mon, Apr 01, 2019 at 06:03:29PM +0100, Daniel P. Berrangé wrote: >> Quite a few of the tests have a need to mock the stat() / lstat() >> functions and they are taking somewhat different & inconsistent >> approaches none of which are actually fully

[libvirt] [PATCH v2] examples: fix 64-bit integer formatting on Windows

2019-04-02 Thread Daniel P . Berrangé
The Windows printf functions don't support %llu/%lld for printing 64-bit integers. For most of libvirt this doesn't matter as we rely on gnulib which provides a replacement printf that is sane. The example code is designed to compile against the normal OS headers, with no use of gnulib and thus

Re: [libvirt] [PATCH] tests: fix mocking of stat() / lstat() functions

2019-04-02 Thread Daniel P . Berrangé
On Mon, Apr 01, 2019 at 06:03:29PM +0100, Daniel P. Berrangé wrote: > Quite a few of the tests have a need to mock the stat() / lstat() > functions and they are taking somewhat different & inconsistent > approaches none of which are actually fully correct. This is shown > by fact that 'make check'

  1   2   >