Re: [PATCH 7/8] hyperv: implement connectGetVersion

2020-10-02 Thread Matt Coleman
On Oct 2, 2020, at 2:48 AM, Pino Toscano wrote: > IMHO these explanations should be documented in the Hyper-V driver > page: docs/drvhyperv.html.in. This way, users know about the different > value returned by virConnectGetVersion() by the Hyper-V driver, and > can unmangle it to get the real

Re: [PATCH 0/8] hyperv: implement new APIs & more

2020-10-02 Thread Matt Coleman
On Oct 2, 2020, at 2:07 AM, Pino Toscano wrote: > > One general note for all the patches: NEWS.rst is updated as a whole > at the end, as separate commit. This eases cherry-picking, removes > dependencies between patches that would not conflict otherwise, and > avoids churn in each patch.

Re: [PATCH 3/8] hyperv: break out common lookups into separate functions

2020-10-02 Thread Matt Coleman
On Oct 2, 2020, at 2:25 AM, Pino Toscano wrote: > Note that now hypervGetVirtualSystemByID() issues VIR_ERR_INTERNAL_ERROR > in case / *computerSystemList is null, instead of > VIR_ERR_NO_DOMAIN. Shouldn't this still be able to explicitly report > when the requested domain does not exist? I’ll

Re: restrictions for virtiofs (related to commit: 88957116c9 for libvirt 6.9.0)

2020-10-02 Thread Masayoshi Mizuma
On Fri, Oct 02, 2020 at 11:31:32AM -0400, Masayoshi Mizuma wrote: > Hello Jan, and Michal, > > commit: 88957116c9 ("qemu: Use memory-backend-* for regular guest memory") > gets > the system memory sharable without numa config. > The qemu options with the patch will be like as: > > -machine >

Re: [PATCH 1/1] vircommand.c: write child pidfile before process tuning in virExec()

2020-10-02 Thread Stefan Berger
On 10/1/20 10:35 AM, Daniel Henrique Barboza wrote: When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent will expect the pidfile to be written before exiting, sitting tight in a saferead() call waiting. The child then does process tuning (via virProcessSet* functions) before writing

Re: [PATCH v3 0/2] block: deprecate the sheepdog driver

2020-10-02 Thread Neal Gompa
On Fri, Oct 2, 2020 at 7:34 AM Daniel P. Berrangé wrote: > > 2 years back I proposed dropping the sheepdog mailing list from the > MAINTAINERS file, but somehow the patch never got picked up: > > https://lists.gnu.org/archive/html/qemu-block/2018-03/msg01048.html > > So here I am with the same

Re: [PATCH 4/8] hyperv: replace generic WMI class list helpers with a macro

2020-10-02 Thread Matt Coleman
On Oct 2, 2020, at 2:26 AM, Pino Toscano wrote: > This change seems unrelated to the patch. Can you please split it in an > own commit? I originally had the macro in this header and had moved the function next to the other closely-related functions. Since I moved the macro to hyperv_driver.c,

Re: [PATCH 1/1] vircommand.c: write child pidfile before process tuning in virExec()

2020-10-02 Thread Daniel Henrique Barboza
On 10/2/20 2:28 PM, Michal Prívozník wrote: On 10/2/20 6:42 PM, Daniel Henrique Barboza wrote: On 10/2/20 1:07 PM, Michal Prívozník wrote: On 10/1/20 4:35 PM, Daniel Henrique Barboza wrote: When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent [...] Resolves:

Re: [PATCH 1/1] vircommand.c: write child pidfile before process tuning in virExec()

2020-10-02 Thread Michal Prívozník
On 10/2/20 6:42 PM, Daniel Henrique Barboza wrote: On 10/2/20 1:07 PM, Michal Prívozník wrote: On 10/1/20 4:35 PM, Daniel Henrique Barboza wrote: When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent [...] Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1882093

Re: [PATCH 1/1] vircommand.c: write child pidfile before process tuning in virExec()

2020-10-02 Thread Daniel Henrique Barboza
On 10/2/20 1:07 PM, Michal Prívozník wrote: On 10/1/20 4:35 PM, Daniel Henrique Barboza wrote: When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent [...] Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1882093 Signed-off-by: Daniel Henrique Barboza ---  

[PATCH 1/1] Optional free-page-reporting can be enabled/disabled for memballon device of model 'virtio'.

2020-10-02 Thread Nico Pache
xml: qemu: qemu -device virtio-balloon-pci,...,free-page-reporting=on This kernel feature allows for more stable and resource friendly systems. Signed-off-by: Nico Pache --- docs/formatdomain.rst | 6 ++ docs/schemas/domaincommon.rng | 5

[PATCH 0/1] qemu: Add support for free-page-reporting

2020-10-02 Thread Nico Pache
gitlab issue: https://gitlab.com/libvirt/libvirt/-/issues/79 The virtio-balloon device now has the ability to report free pages back to the hypervisor for reuse by other programs. This kernel feature allows for more stable and resource friendly systems. This feature is available in QEMU and is

Re: [PATCH 1/1] vircommand.c: write child pidfile before process tuning in virExec()

2020-10-02 Thread Michal Prívozník
On 10/1/20 4:35 PM, Daniel Henrique Barboza wrote: When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent will expect the pidfile to be written before exiting, sitting tight in a saferead() call waiting. The child then does process tuning (via virProcessSet* functions) before writing

Re: [PATCH 06/15] virbitmaptest: Use g_auto(free) for cleanup

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: On Fri, Oct 02, 2020 at 10:50:55 +0200, Ján Tomko wrote: On a Friday in 2020, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > tests/virbitmaptest.c | 73 ++- > 1 file changed, 24 insertions(+), 49

Re: [PATCH 03/15] virBitmapToString|virBitmapNewString: Clarify semantics of the 'string'

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: On Fri, Oct 02, 2020 at 13:17:17 +0200, Ján Tomko wrote: On a Friday in 2020, Peter Krempa wrote: > Clarify which bit is considered most significant in the bitmap and > resulting string. Also be explicit that it's a hex string. > > Signed-off-by: Peter

Re: [PATCH 09/15] virbitmaptest: Add few more cases for virBitmapToString

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: On Fri, Oct 02, 2020 at 12:47:48 +0200, Ján Tomko wrote: On a Friday in 2020, Peter Krempa wrote: > Test an empty bitmap including it's extension via the self-expanding > APIs and and a "0" and "" strings when converting the string back and > forth. > >

Re: [PATCH 06/15] virbitmaptest: Use g_auto(free) for cleanup

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 10:50:55 +0200, Ján Tomko wrote: > On a Friday in 2020, Peter Krempa wrote: > > Signed-off-by: Peter Krempa > > --- > > tests/virbitmaptest.c | 73 ++- > > 1 file changed, 24 insertions(+), 49 deletions(-) > > > > diff --git

restrictions for virtiofs (related to commit: 88957116c9 for libvirt 6.9.0)

2020-10-02 Thread Masayoshi Mizuma
Hello Jan, and Michal, commit: 88957116c9 ("qemu: Use memory-backend-* for regular guest memory") gets the system memory sharable without numa config. The qemu options with the patch will be like as: -machine

Re: [PATCH 03/15] virBitmapToString|virBitmapNewString: Clarify semantics of the 'string'

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 13:17:17 +0200, Ján Tomko wrote: > On a Friday in 2020, Peter Krempa wrote: > > Clarify which bit is considered most significant in the bitmap and > > resulting string. Also be explicit that it's a hex string. > > > > Signed-off-by: Peter Krempa > > --- > >

Re: [libvirt PATCH 1/5] docs: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
On Fri, Oct 02, 2020 at 04:47:59PM +0200, Peter Krempa wrote: > On Fri, Oct 02, 2020 at 15:12:45 +0100, Daniel Berrange wrote: > > Signed-off-by: Daniel P. Berrangé > > --- > > [...] > > > diff --git a/docs/manpages/virt-login-shell.rst > > b/docs/manpages/virt-login-shell.rst > > index

Re: [libvirt PATCH 0/5] misc spelling errors reported by codespell

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 15:12:44 +0100, Daniel Berrange wrote: > > > Daniel P. Berrangé (5): > docs: fix misc spelling errors reported by codespell Please see my specific reply. > src: fix misc spelling errors reported by codespell > tests: fix misc spelling errors reported by codespell

Re: [libvirt PATCH 1/5] docs: fix misc spelling errors reported by codespell

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 15:12:45 +0100, Daniel Berrange wrote: > Signed-off-by: Daniel P. Berrangé > --- [...] > diff --git a/docs/manpages/virt-login-shell.rst > b/docs/manpages/virt-login-shell.rst > index 3833a3e912..1e95d5d2b4 100644 > --- a/docs/manpages/virt-login-shell.rst > +++

Re: [PATCH] the leading space in volmode check will never match the leading tab output from zfs get

2020-10-02 Thread Daniel Henrique Barboza
The code is ok but the commit message can be improved. Usually we want a commit title with a single-line summary of what you're changing, a blank line, and a description describes in more the change, and your signed-off tag. This guideline can be found here:

[libvirt PATCH 5/5] examples: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- examples/c/admin/list_clients.c | 2 +- examples/c/admin/list_servers.c | 2 +- examples/c/domain/info1.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/c/admin/list_clients.c b/examples/c/admin/list_clients.c index

[libvirt PATCH 2/5] src: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/esx/esx_vi.c | 4 ++-- src/libvirt-domain.c | 4 ++-- src/locking/virtlockd.service.in | 2 +- src/logging/virtlogd.service.in | 2 +- src/qemu/qemu_qapi.c | 4 ++-- src/remote/remote_daemon.c | 2 +-

[libvirt PATCH 4/5] tools: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- tools/virsh-completer.c| 2 +- tools/virsh-pool.c | 2 +- tools/wireshark/util/genxdrstub.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c index

[libvirt PATCH 3/5] tests: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- tests/vircgroupmock.c | 2 +- tests/virmockstathelpers.c| 4 ++-- tests/virnetdaemondata/README | 2 +- tests/virpcimock.c| 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/vircgroupmock.c

[libvirt PATCH 0/5] misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Daniel P. Berrangé (5): docs: fix misc spelling errors reported by codespell src: fix misc spelling errors reported by codespell tests: fix misc spelling errors reported by codespell tools: fix misc spelling errors reported by codespell examples: fix misc spelling errors reported by

[libvirt PATCH 1/5] docs: fix misc spelling errors reported by codespell

2020-10-02 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- NEWS.rst | 8 docs/auth.html.in | 2 +- docs/daemons.rst | 4 ++-- docs/drvesx.html.in| 6 +++--- docs/drvxen.html.in| 2 +- docs/format.html.in

Re: [PATCH V4] Modify virCPUarmCompare to perform compare actions

2020-10-02 Thread Daniel Henrique Barboza
On 9/24/20 11:12 AM, Zhenyu Zheng wrote: Modify virCPUarmCompare in cpu_arm.c to perform compare action. This patch only adds host to host CPU compare, the rest cases remains the same. This is useful for source and destination host compare during migrations to avoid migration between

Re: [PATCH] docs/submitting-patches: add reference to DCO

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 15:32:48 +0200, Mauro Matteo Cascella wrote: > Signed-off-by: Mauro Matteo Cascella > --- > docs/submitting-patches.rst | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/docs/submitting-patches.rst b/docs/submitting-patches.rst > index

[PATCH] docs/submitting-patches: add reference to DCO

2020-10-02 Thread Mauro Matteo Cascella
Signed-off-by: Mauro Matteo Cascella --- docs/submitting-patches.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/submitting-patches.rst b/docs/submitting-patches.rst index 17b072655d..3ce8b347a0 100644 --- a/docs/submitting-patches.rst +++

Re: [PATCH 09/15] virbitmaptest: Add few more cases for virBitmapToString

2020-10-02 Thread Peter Krempa
On Fri, Oct 02, 2020 at 12:47:48 +0200, Ján Tomko wrote: > On a Friday in 2020, Peter Krempa wrote: > > Test an empty bitmap including it's extension via the self-expanding > > APIs and and a "0" and "" strings when converting the string back and > > forth. > > > > Signed-off-by: Peter Krempa >

Re: [PATCH] NEWS: mention CVE-2020-25637 in v6.8.0 release notes

2020-10-02 Thread Mauro Matteo Cascella
Thanks for noticing. I actually followed the instructions at [1] and forgot to sign the commit. I will send another patch to add a reference on that page as well. [1] https://libvirt.org/submitting-patches.html Signed-off-by: Mauro Matteo Cascella On Fri, Oct 2, 2020 at 1:26 PM Ján Tomko

Re: [PATCH 5/6] virDomainResctrlNew: Refactor allocation to remove 'cleanup' label

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: If we use g_new0 there's no need for the 'cleanup' label as there's nothing to fail after the allocation. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git

Re: [PATCH 6/6] qemuDomainFilterHotplugVcpuEntities: Refactor memory freeing to remove 'cleanup' label

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: After recent refactors the function can be refactored to remove the 'cleanup' label by using autoptr for the 'map' variable. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 19 ++- 1 file changed, 6 insertions(+), 13

Re: [PATCH 13/15] util: bitmp: Remove virBitmapNewEmpty

2020-10-02 Thread Ján Tomko
Also, s/bitmp/bitmap/ in the commit summary. Jano On a Friday in 2020, Ján Tomko wrote: On a Friday in 2020, Peter Krempa wrote: It can be replaced by virBitmapNew(0). Signed-off-by: Peter Krempa --- src/conf/numa_conf.c | 2 +- src/libvirt_private.syms | 1 - src/util/virbitmap.c |

Re: [PATCH 3/6] Use 'virBitmapNewCopy' instead of 'virBitmapCopy'

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: There are only 3 places using the function. Two can use virBitmapNewCopy directly. In case of the qemu capabilities code we need to free the old bitmap first. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 3 +--

Re: [PATCH 4/6] util: virbitmap: Remove virBitmapCopy

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: The function is now unused. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virbitmap.c | 23 --- src/util/virbitmap.h | 6 -- 3 files changed, 30 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 2/6] Don't check return value of virBitmapNewCopy

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: The function will not fail any more. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 3 +-- src/conf/domain_conf.c | 7 +-- src/conf/numa_conf.c | 4 ++-- src/qemu/qemu_driver.c | 13 +++--

Re: [PATCH 1/6] virBitmapNewCopy: Reimplement bitmap copying to prevent failure

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: virBitmapCopy has a failure condition, which is impossible to meet when creating a new copy. Copy the contents directly to make it obvious that virBitmapNewCopy can't fail. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 10 ++ 1 file

[PATCH v3 1/2] block: drop moderated sheepdog mailing list from MAINTAINERS file

2020-10-02 Thread Daniel P . Berrangé
The sheepdog mailing list is setup to stop and queue messages from non-subscribers, pending moderator approval. Unfortunately it seems that the moderation queue is not actively dealt with. Even when messages are approved, the sender is never added to the whitelist, so every future mail from the

[PATCH v3 2/2] block: deprecate the sheepdog block driver

2020-10-02 Thread Daniel P . Berrangé
This thread from a little over a year ago: http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html states that sheepdog is no longer actively developed. The only mentioned users are some companies who are said to have it for legacy reasons with plans to replace it by Ceph. There is

[PATCH v3 0/2] block: deprecate the sheepdog driver

2020-10-02 Thread Daniel P . Berrangé
2 years back I proposed dropping the sheepdog mailing list from the MAINTAINERS file, but somehow the patch never got picked up: https://lists.gnu.org/archive/html/qemu-block/2018-03/msg01048.html So here I am with the same patch again. This time I go further and deprecate the sheepdog driver

Re: [PATCH] NEWS: mention CVE-2020-25637 in v6.8.0 release notes

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Mauro Matteo Cascella wrote: --- A 'Signed-off-by' line to indicate your compliance with the Developer Certificate of Origin is required: https://libvirt.org/hacking.html#developer-certificate-of-origin (You can reply to this thread with that line, no need to resend the

Re: [PATCH 03/15] virBitmapToString|virBitmapNewString: Clarify semantics of the 'string'

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: Clarify which bit is considered most significant in the bitmap and resulting string. Also be explicit that it's a hex string. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff

[PATCH] NEWS: mention CVE-2020-25637 in v6.8.0 release notes

2020-10-02 Thread Mauro Matteo Cascella
--- NEWS.rst | 8 1 file changed, 8 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index de46cac8c5..f6074d9fe8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -27,6 +27,14 @@ v6.9.0 (unreleased) v6.8.0 (2020-10-01) === +* **Security** + + * qemu: double free in

Re: [PATCH 15/15] virBitmapNew: Don't check return value

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: Remove return value check from all callers. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 7 ++- src/conf/checkpoint_conf.c | 3 +-- src/conf/domain_addr.c | 6 ++ src/conf/domain_conf.c | 12

[PATCH 3/4] qemu: add schema 'fmode' and 'dmode' options

2020-10-02 Thread Brian Turek
Adds schema to validate the 'fmode' and 'dmode' attributes on a 'fileystem' node. Checks to ensure that the values are 1-3 octal digits long. Signed-off-by: Brian Turek --- docs/schemas/domaincommon.rng | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v2 0/4] Add support for QEMU's 'fmode' and 'dmode'

2020-10-02 Thread Brian Turek
This second version of the patch incorporates Peter Krempa's feedback by tweaking a few things in the code and, more importantly, splitting up the singular large patch into smaller patches. Brian Turek (4): qemu: capabilities: add QEMU_CAPS_FSDEV_CREATEMODE qemu: add support for 'fmode' and

[PATCH 4/4] qemu: add docs for 'fmode' and 'dmode' options

2020-10-02 Thread Brian Turek
Adds documentation for QEMU 9pfs 'fmode' and 'dmode' options. Signed-off-by: Brian Turek --- docs/formatdomain.rst | 12 1 file changed, 12 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f3cf9e1fb3..88d836da08 100644 --- a/docs/formatdomain.rst +++

[PATCH 2/4] qemu: add support for 'fmode' and 'dmode' options

2020-10-02 Thread Brian Turek
Expose QEMU's 9pfs 'fmode' and 'dmode' options via attributes on the 'filesystem' node in the domain XML. These options control the creation mode of files and directories, respectively, when using accessmode=mapped. QEMU defaults to creating files with mode 600 and directories with mode 700.

[PATCH 1/4] qemu: capabilities: add QEMU_CAPS_FSDEV_CREATEMODE

2020-10-02 Thread Brian Turek
The QEMU 9pfs 'fmode' and 'dmode' options exists since QEMU 2.10. Probe QEMU's command line set to check whether these options are really available, and if yes, enable this new QEMU_CAPS_FSDEV_CREATEMODE capability on libvirt side. Signed-off-by: Brian Turek --- src/qemu/qemu_capabilities.c

Re: [PATCH 13/15] util: bitmp: Remove virBitmapNewEmpty

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: It can be replaced by virBitmapNew(0). Signed-off-by: Peter Krempa --- src/conf/numa_conf.c | 2 +- src/libvirt_private.syms | 1 - src/util/virbitmap.c | 16 +--- src/util/virbitmap.h | 1 - src/util/virhostcpu.c| 4 ++--

Re: [PATCH 14/15] qemuSlirpNew: Use g_new0 to allocate the slirp object

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_slirp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 12/15] virBitmapNew: Don't force return value check

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: We now always return a valid pointer or crash so the return value doesn't need to be checked. Signed-off-by: Peter Krempa --- src/util/virbitmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: [PATCH 11/15] util: bitmap: Remove virBitmapNewQuiet

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: We no longer report any errors so all callers can be replaced by virBitmapNew. Additionally virBitmapNEw can't return NULL now so error s/NEw/New/ handling is not necessary. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 -

Re: [PATCH 09/15] virbitmaptest: Add few more cases for virBitmapToString

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: Test an empty bitmap including it's extension via the self-expanding APIs and and a "0" and "" strings when converting the string back and forth. Signed-off-by: Peter Krempa --- tests/virbitmaptest.c | 35 ++- 1 file

Re: [PATCH 10/15] virBitmapNewQuiet: Don't fail on unlikely overflow scenario

2020-10-02 Thread Ján Tomko
On a Friday in 2020, Peter Krempa wrote: Modify the condition which would make virBitmapNewQuiet fail to possibly overallocate by 1 rather than failing. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) Reviewed-by: Ján

Re: [libvirt PATCH] tests: fix incorrect free of GVariant in our GLib mock functions

2020-10-02 Thread Michal Prívozník
On 10/2/20 12:36 PM, Pavel Hrdina wrote: GLib implementation of g_dbus_connection_call_sync() calls g_variant_ref_sink() on the passed @parameters to make sure they have proper reference. If the original reference is floating the g_dbus_connection_call_sync() consumes it, but if it's normal

Re: [PATCH 00/20] qemu: migration_cookie: Refactor and modernize

2020-10-02 Thread Michal Prívozník
On 10/2/20 10:57 AM, Peter Krempa wrote: Note that this applies on top of the recent bitmap refactors Peter Krempa (20): qemu: migration_cookie: Extract parsing/validation of mandatory features qemuMigrationCookieXMLParse: Switch to single-purpose temporary variables

[libvirt PATCH] tests: fix incorrect free of GVariant in our GLib mock functions

2020-10-02 Thread Pavel Hrdina
GLib implementation of g_dbus_connection_call_sync() calls g_variant_ref_sink() on the passed @parameters to make sure they have proper reference. If the original reference is floating the g_dbus_connection_call_sync() consumes it, but if it's normal reference it will just add another one. Our

Re: virsystemdtest segfault on ppc64

2020-10-02 Thread Daniel Henrique Barboza
On 10/2/20 4:11 AM, Michal Prívozník wrote: On 10/1/20 7:52 PM, Cole Robinson wrote: I'm seeing failures building libvirt 6.8.0 rpm on fedora 32, 33, and rawhide. virsystemdtest is segfaulting on ppc64. https://kojipkgs.fedoraproject.org//work/tasks/5494/52595494/build.log Ah, I can

Re: [PATCH 1/5] lib: Don't unref message passed to virGDBusCallMethod{WithFD}()

2020-10-02 Thread Pavel Hrdina
On Fri, Oct 02, 2020 at 12:04:21PM +0200, Michal Prívozník wrote: > On 10/2/20 11:52 AM, Pavel Hrdina wrote: > > On Fri, Oct 02, 2020 at 11:22:06AM +0200, Michal Privoznik wrote: > > > The virGDBusCallMethod() and virGDBusCallMethodWithFD() are > > > simple wrappers over

Re: [PATCH 1/5] lib: Don't unref message passed to virGDBusCallMethod{WithFD}()

2020-10-02 Thread Michal Prívozník
On 10/2/20 11:52 AM, Pavel Hrdina wrote: On Fri, Oct 02, 2020 at 11:22:06AM +0200, Michal Privoznik wrote: The virGDBusCallMethod() and virGDBusCallMethodWithFD() are simple wrappers over g_dbus_connection_call_sync() and g_dbus_connection_call_with_unix_fd_list_sync() respectively. The

Re: [PATCH 4/5] vmx; Free @checkMACAddress in virVMXParseEthernet()

2020-10-02 Thread Pavel Hrdina
On Fri, Oct 02, 2020 at 11:22:09AM +0200, Michal Privoznik wrote: > The @checkMACAddress string is allocated in > virVMXGetConfigString() but never freed. > > Signed-off-by: Michal Privoznik > --- > src/vmx/vmx.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Pavel Hrdina

Re: [PATCH 3/5] virfirewalltest: Don't duplicate string when adding it onto stringlist

2020-10-02 Thread Pavel Hrdina
On Fri, Oct 02, 2020 at 11:22:08AM +0200, Michal Privoznik wrote: > In our wrapper of g_dbus_connection_call_sync() in > virfirewalltest a string is duplicated and added onto a > virStringList. This leads to a memory leak because > virStringListAdd() duplicates the string itself. > >

Re: [PATCH 2/5] tests: Set G_DEBUG environment variable

2020-10-02 Thread Pavel Hrdina
On Fri, Oct 02, 2020 at 11:22:07AM +0200, Michal Privoznik wrote: > With us switching to glib more and more it is easy to get things > wrong (as can be seen in the previous commit). Set G_DEBUG > variable to "fatal-warnings" which causes GLib to abort the > program at the first call to g_warning()

Re: [PATCH 1/5] lib: Don't unref message passed to virGDBusCallMethod{WithFD}()

2020-10-02 Thread Pavel Hrdina
On Fri, Oct 02, 2020 at 11:22:06AM +0200, Michal Privoznik wrote: > The virGDBusCallMethod() and virGDBusCallMethodWithFD() are > simple wrappers over g_dbus_connection_call_sync() and > g_dbus_connection_call_with_unix_fd_list_sync() respectively. The > documentation to these function states that

[PATCH 3/5] virfirewalltest: Don't duplicate string when adding it onto stringlist

2020-10-02 Thread Michal Privoznik
In our wrapper of g_dbus_connection_call_sync() in virfirewalltest a string is duplicated and added onto a virStringList. This leads to a memory leak because virStringListAdd() duplicates the string itself. Signed-off-by: Michal Privoznik --- tests/virfirewalltest.c | 2 +- 1 file changed, 1

[PATCH 4/5] vmx; Free @checkMACAddress in virVMXParseEthernet()

2020-10-02 Thread Michal Privoznik
The @checkMACAddress string is allocated in virVMXGetConfigString() but never freed. Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4b1b04c6e1..9894d5c0ce 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@

[PATCH 5/5] NEWS: Document recent GLib DBus fix

2020-10-02 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 7663cf4208..6c237dbba8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,12 @@ v6.9.0 (unreleased) * **Bug fixes** + * lib: Don't unref message passed to

[PATCH 0/5] GDBus and memleak fixes

2020-10-02 Thread Michal Privoznik
The first patch fixes issue raised by Cole here: https://www.redhat.com/archives/libvir-list/2020-October/msg00037.html The second one sets the environment variable which will cause our tests fail should we run into similar problem. To see it in action just switch order with patch 1/5 and

[PATCH 2/5] tests: Set G_DEBUG environment variable

2020-10-02 Thread Michal Privoznik
With us switching to glib more and more it is easy to get things wrong (as can be seen in the previous commit). Set G_DEBUG variable to "fatal-warnings" which causes GLib to abort the program at the first call to g_warning() or g_critical(). Signed-off-by: Michal Privoznik --- tests/meson.build

[PATCH 1/5] lib: Don't unref message passed to virGDBusCallMethod{WithFD}()

2020-10-02 Thread Michal Privoznik
The virGDBusCallMethod() and virGDBusCallMethodWithFD() are simple wrappers over g_dbus_connection_call_sync() and g_dbus_connection_call_with_unix_fd_list_sync() respectively. The documentation to these function states that passed parameters (@message in our case) is consumed for 'convenient'

[PATCH 18/20] qemuMigrationCookieAddCaps: Use 'g_new0' instead of VIR_ALLOC

2020-10-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index a1ef3d2b12..93d91b8a1c 100644 --- a/src/qemu/qemu_migration_cookie.c +++

[PATCH 20/20] qemu: migration_cookie: s/VIR_FREE/g_free/

2020-10-02 Thread Peter Krempa
Previous refactors allow us to plainly replace all VIR_FREE by g_free to finish the modernization of the file. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 34 1 file changed, 17 insertions(+), 17 deletions(-) diff --git

[PATCH 19/20] qemuMigrationCookieXMLParse: Avoid VIR_FREE when parsing lockstate

2020-10-02 Thread Peter Krempa
Restructure the control-flow a bit using an temporary variable to avoid the need to use VIR_FREE. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c

[PATCH 15/20] qemuMigrationCookieNetworkXMLParse: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use modern allocators, automatic memory feeing, and decrease the scope of some variables to remove the 'error' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git

[PATCH 09/20] qemuMigrationCookieXMLFormat: Extract formatting of NBD

2020-10-02 Thread Peter Krempa
Move the code into 'qemuMigrationCookieNBDXMLFormat' and use modern XML formatting code patterns. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 41 +--- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git

[PATCH 06/20] qemuMigrationCookieXMLParse: Remove 'error' label

2020-10-02 Thread Peter Krempa
Now it only returns -1 so we can do that directly. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 39 +++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index

[PATCH 13/20] qemuMigrationCookieNetworkAlloc: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use modern memory handling approach to simplify the code. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index

[PATCH 07/20] qemuMigrationCookieGraphicsXMLFormat: Use 'virXMLFormatElement'

2020-10-02 Thread Peter Krempa
Switch to the two buffer approach to simplify the logic for terminating the element. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c

[PATCH 16/20] qemuMigrationCookieNBDXMLParse: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use modern allocators, automatic memory feeing, and decrease the scope of some variables to remove the 'error' and 'cleanup' labels. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 31 ++- 1 file changed, 10 insertions(+), 21 deletions(-) diff

[PATCH 14/20] qemuMigrationCookieXMLFormat: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use automatic memory freeing to get rid of the 'error' label. Since the 'tmp' variable was used only in one instance, rename it appropriately. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 31 +++ 1 file changed, 11 insertions(+), 20 deletions(-)

[PATCH 12/20] qemuMigrationCookieGraphicsSpiceAlloc: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use modern memory handling approach to simplify the code. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index

[PATCH 00/20] qemu: migration_cookie: Refactor and modernize

2020-10-02 Thread Peter Krempa
Note that this applies on top of the recent bitmap refactors Peter Krempa (20): qemu: migration_cookie: Extract parsing/validation of mandatory features qemuMigrationCookieXMLParse: Switch to single-purpose temporary variables qemuMigrationCookieXMLParse: Check domain element count

[PATCH 03/20] qemuMigrationCookieXMLParse: Check domain element count more defensively

2020-10-02 Thread Peter Krempa
Make sure that 'virXPathNodeSet' returns '1' as the only expected value rather than relying on the fact that the previous check for the number of elements ensures success of the subsequent call. The error message no longer mentions the number of elements in the cookie, but this is a very

[PATCH 17/20] qemuMigrationCookieCapsXMLParse: Refactor memory handling

2020-10-02 Thread Peter Krempa
Use modern allocators, automatic memory feeing, and decrease the scope of some variables to remove the 'cleanup' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 31 +-- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git

[PATCH 05/20] qemuMigrationCookieXMLParse: Remove comment mentioning that error was already set

2020-10-02 Thread Peter Krempa
Most of our functions report errors so there's no need to mention it here again. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index

[PATCH 08/20] qemuMigrationCookieNetworkXMLFormat: Refactor XML formatting

2020-10-02 Thread Peter Krempa
Use 'virXMLFormatElement' both for formating the whole element but also for formatting the subelements. This alows to remove the crazy logic which was determining which element was already formatted. Additional simplification is achieved by switching to skipping the loop using 'continue' rather

[PATCH 10/20] qemuDomainExtractTLSSubject: Refactor memory handling

2020-10-02 Thread Peter Krempa
Switch to automatic memory cleaning, use g_new0 for allocation and get rid of the 'error' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c

[PATCH 11/20] qemu: migration_cookie: Register 'autoptr' functions for internal types

2020-10-02 Thread Peter Krempa
Register the the cleanup functions for 'qemuMigrationCookieGraphics', 'qemuMigrationCookieNetwork', 'qemuMigrationCookieNBD', and 'qemuMigrationCookieCaps'. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH 04/20] qemuMigrationCookieXMLParse: Decrease scope of 'nodes' and use automatic freeing

2020-10-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index 9b1268833a..a9dd2b9323 100644 --- a/src/qemu/qemu_migration_cookie.c +++

[PATCH 02/20] qemuMigrationCookieXMLParse: Switch to single-purpose temporary variables

2020-10-02 Thread Peter Krempa
Don't reuse 'tmp' over and over, but switch to single use automaticaly freed variables instead. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git

[PATCH 01/20] qemu: migration_cookie: Extract parsing/validation of mandatory features

2020-10-02 Thread Peter Krempa
Move the code into 'qemuMigrationCookieXMLParseMandatoryFeatures' to simplify 'qemuMigrationCookieXMLParse'. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 77 +++- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git

[PATCH 0/6] virBitmapCopy: Refactor to prevent failures

2020-10-02 Thread Peter Krempa
Note that this applies on top of my previous series dealing with bitmaps. Peter Krempa (6): virBitmapNewCopy: Reimplement bitmap copying to prevent failure Don't check return value of virBitmapNewCopy Use 'virBitmapNewCopy' instead of 'virBitmapCopy' util: virbitmap: Remove virBitmapCopy

[PATCH 5/6] virDomainResctrlNew: Refactor allocation to remove 'cleanup' label

2020-10-02 Thread Peter Krempa
If we use g_new0 there's no need for the 'cleanup' label as there's nothing to fail after the allocation. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH 2/6] Don't check return value of virBitmapNewCopy

2020-10-02 Thread Peter Krempa
The function will not fail any more. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 3 +-- src/conf/domain_conf.c | 7 +-- src/conf/numa_conf.c | 4 ++-- src/qemu/qemu_driver.c | 13 +++-- src/qemu/qemu_hotplug.c | 3

[PATCH 3/6] Use 'virBitmapNewCopy' instead of 'virBitmapCopy'

2020-10-02 Thread Peter Krempa
There are only 3 places using the function. Two can use virBitmapNewCopy directly. In case of the qemu capabilities code we need to free the old bitmap first. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 3 +-- src/qemu/qemu_capabilities.c | 3 ++- src/util/virresctrl.c

  1   2   >