Re: [PATCH 0/6] qemu: Remove monitor socket waiting code

2022-08-02 Thread Jonathon Jongsma
On 8/2/22 7:51 AM, Peter Krempa wrote: We either pre-open a socket and pass the file descriptor to qemu or are guaranteed that the socket is open by other means. The qemu monitor code can be simplified a lot. Peter Krempa (6): qemu: process: Remove 'retry' argument from qemuConnectMonitor

Re: [PATCH] qemu_capabilities: replace code with function call

2022-08-02 Thread Jonathon Jongsma
On 8/2/22 10:50 AM, Kristina Hanicova wrote: Since functions virQEMUCapsFillDomainFeatureSEVCaps() and virQEMUCapsSEVInfoCopy() essentially do the same thing it does not make sense to have the code duplicated. This patch replaces the relevant code in the first function with the function call to

Re: [PATCH 2/2] virfile: Fix build with glibc 2.36

2022-08-02 Thread Cole Robinson
On 8/2/22 3:12 AM, Erik Skultety wrote: > On Mon, Aug 01, 2022 at 03:59:15PM -0400, Cole Robinson wrote: >> With glibc 2.36, sys/mount.h and linux/mount.h conflict: >> https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E >> >> virfile.c imports

Re: Live migration support for Cloud-Hypervisor VMs

2022-08-02 Thread Daniel P . Berrangé
On Mon, Aug 01, 2022 at 11:03:49AM -0500, Praveen K Paladugu wrote: > Folks, > > We are implementing Live Migration support in "ch" driver of Libvirt. I'd > like to confirm if the approach we have chosen would be accepted upstream > once implemented. > > > Our immediate goal is to implement

Re: [libvirt PATCH 2/2] conf: set the default chr device type to pty

2022-08-02 Thread Praveen K Paladugu
On 8/1/2022 8:01 AM, Peter Krempa wrote: On Fri, Jul 29, 2022 at 20:36:57 +, Praveen K Paladugu wrote: explicitly set the chr device type to pty to pass the checks of ch driver. https://gitlab.com/libvirt/libvirt/-/issues/344 This is not a persuading enough enough commit message ...

[PATCH] qemu_capabilities: replace code with function call

2022-08-02 Thread Kristina Hanicova
Since functions virQEMUCapsFillDomainFeatureSEVCaps() and virQEMUCapsSEVInfoCopy() essentially do the same thing it does not make sense to have the code duplicated. This patch replaces the relevant code in the first function with the function call to the second one. Signed-off-by: Kristina

Re: [libvirt PATCH] libxl: Fix build with recent Xen that introduces new disk backend type

2022-08-02 Thread Daniel P . Berrangé
On Tue, Aug 02, 2022 at 01:39:31PM +0200, Marek Marczykowski-Górecki wrote: > On Mon, Aug 01, 2022 at 10:36:07AM +0100, Daniel P. Berrangé wrote: > > Generally we want to see errors triggered from new enums arriving, > > as it can be a sign that libvirt code needs a semantic change in > > order to

[PATCH 5/6] qemuMonitorOpenUnix: Remove 'retry' argument

2022-08-02 Thread Peter Krempa
All callers now pass false for 'retry' we are guaranteed to have a monitor socket present. This means that the retry code can be removed. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 47 ++-- src/qemu/qemu_monitor.h | 1 -

[PATCH 6/6] qemuMonitorOpenUnix: Don't overwrite 'ret' needlessly

2022-08-02 Thread Peter Krempa
Directly check the return value of 'connect'. Unfortunately we can't remove it as we have to undo auto-closing of the socket on success. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c

[PATCH 4/6] qemuProcessQMPConnectMonitor: Connect to probing monitor with 'retry' set to false

2022-08-02 Thread Peter Krempa
In 'qemuProcessQMPLaunch' qemu is very specifically launched using it's internal '-daemonize' flag (see comment in the function) to ensure that the monitor socket is ready and opened prior to attempting the monitor connection. This means we don't have to retry the connection to the monitor in

[PATCH 2/6] qemu: monitor: Remove 'timeout' argument from qemuMonitorOpen

2022-08-02 Thread Peter Krempa
The 'timeout' argument is used by 'qemuMonitorOpenUnix' only when the 'retry' argument is true. The callers of 'qemuMonitorOpen' only pass '0' for timeout when they call it with 'retry' true and use other values when 'retry' is false and thus ignored. This means we can remove the argument and

[PATCH 3/6] qemuMonitorTestNew: Call qemuMonitorOpen with 'retry' false

2022-08-02 Thread Peter Krempa
The 'retry' argument makes the monitor connection opening re-try the connection in case the monitor socket doesn't exist or isn't properly listening. In case of the test code this can't happen because the socket is created and made listening in 'qemuMonitorCommonTestNew' which is called prior to

[PATCH 1/6] qemu: process: Remove 'retry' argument from qemuConnectMonitor

2022-08-02 Thread Peter Krempa
Both callers pass 'false' as the argument via a variable which is not modified. Remove the argument and pass 'false' directly. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_process.c

[PATCH 0/6] qemu: Remove monitor socket waiting code

2022-08-02 Thread Peter Krempa
We either pre-open a socket and pass the file descriptor to qemu or are guaranteed that the socket is open by other means. The qemu monitor code can be simplified a lot. Peter Krempa (6): qemu: process: Remove 'retry' argument from qemuConnectMonitor qemu: monitor: Remove 'timeout' argument

Re: [libvirt PATCH] libxl: Fix build with recent Xen that introduces new disk backend type

2022-08-02 Thread Marek Marczykowski-Górecki
On Mon, Aug 01, 2022 at 10:36:07AM +0100, Daniel P. Berrangé wrote: > Generally we want to see errors triggered from new enums arriving, > as it can be a sign that libvirt code needs a semantic change in > order to continue operating correctly. It isn't always correct > to assume that the

[PATCH 1/4] src: Export virDomainTPMVersion enum conversion helpers

2022-08-02 Thread Michal Privoznik
The virDomainTPMVersion enum is declared in domain_conf.h among with its TypeFromString() and TypeToString() helpers (which are then implemented in domain_conf.c). However, neither of these helpers is exposed in libvirt_private.syms which makes it impossible for other modules to use.

[PATCH 0/4] testutilsqemu: Fake TPM versions

2022-08-02 Thread Michal Privoznik
Technically, this is a v2 of: https://listman.redhat.com/archives/libvir-list/2022-July/233306.html but not really. Because I've discarded the 3/3 from original series and implemented Andrea's idea. Michal Prívozník (4): src: Export virDomainTPMVersion enum conversion helpers testutilsqemu:

[PATCH 3/4] qemu_validate: Validate TPM version

2022-08-02 Thread Michal Privoznik
Supported TPM versions are reported in domain capabilities. These are used already to validate TPM type and model, but not TPM version. This is suboptimal, because otherwise we leave users to meet the error when starting a guest and libvirt spawns swtpm binary which in turn reports an error.

[PATCH 4/4] qemuxml2argvtest: Add negative cases for TPM version

2022-08-02 Thread Michal Privoznik
Now that we have all the machinery needed, we can introduce two simple test cases: 1) only TPM 1.2 is supported, but TPM 2.0 was requested in domain XML, 2) only TPM 2.0 is supported, but TPM 1.2 was requested in domain XML. Signed-off-by: Michal Privoznik ---

[PATCH 2/4] testutilsqemu: Fake TPM versions

2022-08-02 Thread Michal Privoznik
Because of v8.5.0-rc1~25 we are already faking TPM support for domaincaps. Might as well fake supported TPM versions. The swtpm binary supports both TPM versions since its first release, but pretend it isn't the case. For QEMU-5.2 and older pretend only TPM-1.2 is available, QEMU-6.* has both

Re: [PATCH 3/3] testutilsqemu: Fake TPM versions

2022-08-02 Thread Andrea Bolognani
On Tue, Aug 02, 2022 at 09:03:01AM +0200, Michal Prívozník wrote: > On 8/1/22 18:10, Andrea Bolognani wrote: > > On Fri, Jul 29, 2022 at 09:42:13AM +0200, Michal Privoznik wrote: > >> +++ b/tests/testutilsqemu.c > >> @@ -150,12 +150,13 @@ bool > >> virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature

Re: [PATCH 0/2] Fix build with glibc 2.36

2022-08-02 Thread Erik Skultety
On Mon, Aug 01, 2022 at 03:59:13PM -0400, Cole Robinson wrote: > With glibc 2.36, sys/mount.h and linux/mount.h conflict: > > https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E > > Easiest way to run this through CI? Submit MR to libvirt gitlab?

Re: [PATCH 2/2] virfile: Fix build with glibc 2.36

2022-08-02 Thread Erik Skultety
On Mon, Aug 01, 2022 at 03:59:15PM -0400, Cole Robinson wrote: > With glibc 2.36, sys/mount.h and linux/mount.h conflict: > https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E > > virfile.c imports sys/mount.h and linux/fs.h, which pulls in >

Re: [PATCH 1/2] lxc: containter: fix build with glibc 2.36

2022-08-02 Thread Erik Skultety
On Mon, Aug 01, 2022 at 03:59:14PM -0400, Cole Robinson wrote: > With glibc 2.36, sys/mount.h and linux/mount.h conflict: > https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E > > lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in

Re: [PATCH 3/3] testutilsqemu: Fake TPM versions

2022-08-02 Thread Michal Prívozník
On 8/1/22 18:10, Andrea Bolognani wrote: > On Fri, Jul 29, 2022 at 09:42:13AM +0200, Michal Privoznik wrote: >> +++ b/tests/testutilsqemu.c >> @@ -150,12 +150,13 @@ bool >> virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap) >> { >> switch (cap) { >> +case