[PATCH v3 08/12] cpu_map: Add versioned Intel Icelake CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 4 + src/cpu_map/meson.build | 4 + src/cpu_map/x86_Icelake-Server-v3.xml | 103 + src/cpu_map/x86_Icelake-Server-v4.xml | 108 + src/cpu_m

[PATCH v3 10/12] cpu_map: Add versioned Intel Snowridge CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 3 + src/cpu_map/meson.build | 3 + src/cpu_map/x86_Snowridge-v2.xml | 78 ++ src/cpu_map/x86_Snowridge-v3.xml | 80 +++ src/cpu_ma

[PATCH v3 12/12] cpu_map: Add versioned Dhyana CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 1 + src/cpu_map/meson.build | 1 + src/cpu_map/x86_Dhyana-v2.xml | 81 +++ ..._64-cpuid-Hygon-C86-7185-32-core-guest.xml | 5 +- ...6_64-cpuid-Hygon-C86-71

[PATCH v3 04/12] qemu: use canonical name for CPU models

2023-12-15 Thread Jonathon Jongsma
As described in detail in the commit "cpu_map: add canonical names to existing CPU models", the unversioned CPU model names are not migration-safe. If qemu makes the anticipated changes to CPU alias mapping, an unversioned CPU model may be represented by different underlying CPU models on different

[PATCH v3 07/12] cpu_map: Add versioned Intel Cascadelake CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 3 + src/cpu_map/meson.build | 3 + src/cpu_map/x86_Cascadelake-Server-v2.xml | 93 +++ src/cpu_map/x86_Cascadelake-Server-v4.xml | 91 ++ src/cpu_ma

[PATCH v3 05/12] cpu_map: Add versioned EPYC CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 6 + src/cpu_map/meson.build | 6 + src/cpu_map/x86_EPYC-Milan-v2.xml | 108 ++ src/cpu_map/x86_EPYC-Rome-v2.xml | 93 +++ src/cpu_ma

[PATCH v3 06/12] cpu_map: Add versioned Intel Skylake CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 3 + src/cpu_map/meson.build | 3 + src/cpu_map/x86_Skylake-Client-v4.xml | 77 + src/cpu_map/x86_Skylake-Server-v4.xml | 83 ++ src/cpu_map/

[PATCH v3 09/12] cpu_map: Add versioned Intel Cooperlake CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 1 + src/cpu_map/meson.build | 1 + src/cpu_map/x86_Cooperlake-v2.xml | 98 +++ .../x86_64-cpuid-Cooperlake-host.xml | 3 +- .../domaincapsdata/qemu_6.

[PATCH v3 11/12] cpu_map: Add versioned Intel SapphireRapids CPUs

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/index.xml | 1 + src/cpu_map/meson.build | 1 + src/cpu_map/x86_SapphireRapids-v2.xml | 125 ++ .../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_

[PATCH v3 02/12] cpu_map: add canonical names to existing CPU models

2023-12-15 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/cpu_map/x86_Broadwell-IBRS.xml| 1 + src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 1 + src/cpu_map/x86_Broadwell-noTSX.xml | 1 + src/cpu_map/x86_Broadwell.xml | 1 + src/cpu_map/x86_Cascadelake-Server-noTSX.xml | 1

[PATCH v3 03/12] cpu: parse the canonical name from the cpu model

2023-12-15 Thread Jonathon Jongsma
Recent changes have added a 'canonical_name' field to the xml definitions for our CPU models. Parse this field into the C structure and pass it around where necessary. --- src/conf/cpu_conf.c | 3 +++ src/conf/cpu_conf.h | 1 + src/cpu/cpu_x86.c | 24 3 files changed,

[PATCH v3 00/12] Improve versioned CPU support in libvirt

2023-12-15 Thread Jonathon Jongsma
For SEV-SNP support we will need to be able to specify versioned CPU models that are not yet available in libvirt. Rather than just adding a versioned CPU or two that would satisfy that immediate need, I decided to try to add versioned CPUs in a more standard way. This series generates CPU definiti

[PATCH v3 01/12] cpu_map: update script to handle versioned CPUs

2023-12-15 Thread Jonathon Jongsma
Previously, the script only generated the parent CPU and any versions that had a defined alias. The script now generates all CPU versions. Any version that had a defined alias will continue to use that alias, but those without aliases will use the generated name $BASECPUNAME-vN. The reason for thi

Re: [libvirt PATCH 0/5] add loongarch support for libvirt

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 02:08:44PM +0800, xianglai li wrote: > Hello, Everyone: > This patch series adds libvirt support for loongarch.Although the bios > path and name has not been officially integrated into qemu and we think > there are still many shortcomings, we try to push a version of patch

Re: [PATCH 1/2] ci: integration: Switch upstream integration tests to Fedora 39

2023-12-15 Thread Andrea Bolognani
On Fri, Dec 15, 2023 at 06:06:54PM +0100, Erik Skultety wrote: > On Fri, Dec 15, 2023 at 02:26:11AM -0800, Andrea Bolognani wrote: > > On Thu, Dec 14, 2023 at 09:28:16AM +0100, Michal Privoznik wrote: > > > Currently, Fedora 37 and 38 is used. The former is now EOL since > > > there's new release.

Re: [libvirt PATCH 5/5] Add bios path for loongarch

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 02:08:49PM +0800, xianglai li wrote: > +++ b/src/qemu/qemu_conf.c > @@ -93,7 +93,8 @@ VIR_ONCE_GLOBAL_INIT(virQEMUConfig); > "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ > "/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ >

Re: [libvirt PATCH 4/5] Implement the method of getting host info for loongarch

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 02:08:48PM +0800, xianglai li wrote: > +++ b/src/util/virhostcpu.c > @@ -579,7 +579,7 @@ virHostCPUParsePhysAddrSize(FILE *cpuinfo, unsigned int > *addrsz) > char *str; > char *endptr; > > -if (!(str = STRSKIP(line, "address sizes"))) > +if

Re: [libvirt PATCH 3/5] Config some capabilities for loongarch virt machine

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 02:08:47PM +0800, xianglai li wrote: > +++ b/src/qemu/qemu_domain.c > @@ -5635,6 +5635,11 @@ > qemuDomainControllerDefPostParse(virDomainControllerDef *cont, > cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; > else if (virQEMUC

Re: [libvirt PATCH 1/5] Add loongarch cpu support

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 02:08:45PM +0800, xianglai li wrote: > From: lixianglai > > Add loongarch cpu support, Define new cpu type 'loongarch64' > and implement it's driver functions. > > Signed-off-by: lixianglai We usually prefer the full name to be used both for git authorship and DCO purpose

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Denis V. Lunev
On 12/15/23 16:07, Daniel P. Berrangé wrote: On Fri, Dec 15, 2023 at 01:48:09PM +, Efim Shevrin wrote: Hello, here are call traces with two threads generated by python script // == [root@dandreev-vz-6-0-0-243-master libvirt]# gdb -p 288985 (gdb) t a a bt Thread

Re: [PATCH 1/2] ci: integration: Switch upstream integration tests to Fedora 39

2023-12-15 Thread Erik Skultety
On Fri, Dec 15, 2023 at 02:26:11AM -0800, Andrea Bolognani wrote: > On Thu, Dec 14, 2023 at 09:28:16AM +0100, Michal Privoznik wrote: > > Currently, Fedora 37 and 38 is used. The former is now EOL since > > there's new release. Switch 37 to 39 then. > > > > Signed-off-by: Michal Privoznik > > ---

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Denis V. Lunev
On 12/15/23 16:47, Daniel P. Berrangé wrote: On Fri, Dec 15, 2023 at 03:51:19PM +0100, Denis V. Lunev wrote: On 12/15/23 14:48, Efim Shevrin wrote: *From:* Daniel P. Berrangé *Sent:* Friday, December 15, 2023 19:09 *To:* Efim Shevrin *Cc:* devel@lists.libvirt.org ; d...@openvz.org *Subject:*

Re: [PATCH 04/19] qemuxml2argvdata: Move 'smbios-multiple-type2' case to genericxml2xmltest

2023-12-15 Thread Peter Krempa
On Fri, Dec 15, 2023 at 13:33:14 +0100, Peter Krempa wrote: > The qemu driver explicitly rejects such configuration, thus this is just > a generic XML2XML test case. Move it. > > Signed-off-by: Peter Krempa > --- > .../smbios-multiple-type2.xml | 0 > tests/gene

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Daniel P . Berrangé
On Fri, Dec 15, 2023 at 03:51:19PM +0100, Denis V. Lunev wrote: > On 12/15/23 14:48, Efim Shevrin wrote: > > *From:* Daniel P. Berrangé > > *Sent:* Friday, December 15, 2023 19:09 > > *To:* Efim Shevrin > > *Cc:* devel@lists.libvirt.org ; d...@openvz.org > > > > *Subject:* Re: [PATCH 3/3] rpc: R

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Daniel P . Berrangé
On Fri, Dec 15, 2023 at 01:48:09PM +, Efim Shevrin wrote: > Hello, > > here are call traces with two threads generated by python script > // == > [root@dandreev-vz-6-0-0-243-master libvirt]# gdb -p 288985 > (gdb) t a a bt > > Thread 2 (Thread 0x7f2112862640 (LWP 28

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Denis V. Lunev
On 12/15/23 14:48, Efim Shevrin wrote: Hello, here are call traces with two threads generated by python script // == [root@dandreev-vz-6-0-0-243-master libvirt]# gdb -p 288985 (gdb) t a a bt Thread 2 (Thread 0x7f2112862640 (LWP 288986) "python3"): #0  0x7f2121d42

[PATCH 4/4] vmx: Ensure unique disk targets when parsing

2023-12-15 Thread Michal Privoznik
When parsing disks from a vmx file, the target name is generated based on disk bus, controller the disk is attached to, and its unit. But in case of SCSI and SATA attached disks this does not guarantee the target name uniqueness. If there are two disks, one attached to scsi.0 and the other to sata.

[PATCH 2/4] vmx2xmltest: Add another test case

2023-12-15 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- tests/vmx2xmldata/esx-in-the-wild-12.vmx | 86 tests/vmx2xmldata/esx-in-the-wild-12.xml | 39 +++ tests/vmx2xmltest.c | 1 + 3 files changed, 126 insertions(+) create mode 100644 tests/vmx2xmldata/esx-in-t

[PATCH 3/4] vmx: Separate disk target name generation into a function

2023-12-15 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 175 +++--- 1 file changed, 110 insertions(+), 65 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index af1c1640ae..399f03b419 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2136,6 +2136,1

[PATCH 1/4] vmx: Accept empty fileName for cdrom-image

2023-12-15 Thread Michal Privoznik
Turns out, there are two ways to specify an empty CD-ROM drive in a .vmx file: 1) .fileName = "emptyBackingString" 2) .fileName = "" While we do parse 1) successfully, the code does not accept 2) and an error is reported. Modify the code to treat both cases the same. Resolves: https://issues

[PATCH 0/4] vmx: A couple of disk related fixes

2023-12-15 Thread Michal Privoznik
The first patch fixes an issue. The last one - I am not sure if it's not going to break something and thus it's optional. Michal Prívozník (4): vmx: Accept empty fileName for cdrom-image vmx2xmltest: Add another test case vmx: Separate disk target name generation into a function vmx: Ensur

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Efim Shevrin
Hello, here are call traces with two threads generated by python script // == [root@dandreev-vz-6-0-0-243-master libvirt]# gdb -p 288985 (gdb) t a a bt Thread 2 (Thread 0x7f2112862640 (LWP 288986) "python3"): #0 0x7f2121d4296f in poll () at /lib64/libc.so.6 #1 0x

[PATCH 18/19] qemuxml2argvtest: Add test cases covered only by qemuxml2xmltest - part 2

2023-12-15 Thread Peter Krempa
Add the rest of test cases which were tested only by qemuxml2xmltest. All test cases added here have a ' --- .../net-bandwidth.x86_64-latest.args | 47 ++ tests/qemuxml2argvdata/net-bandwidth.xml | 2 +- .../net-bandwidth2.x86_64-latest.args | 44 +++

[PATCH 19/19] qemuxml2argvtest: Add checker that all input files are used

2023-12-15 Thread Peter Krempa
To prevent regressions when refactoring tests and accidentally forgotten input files make sure that qemuxml2argvtest is invoked for all input files in tests/qemuxml2argvdata Signed-off-by: Peter Krempa --- tests/qemustatusxml2xmltest.c | 2 +- tests/qemuxml2argvtest.c | 63

[PATCH 16/19] qemuxml2argvtest: Enable 'graphics-listen-network' case

2023-12-15 Thread Peter Krempa
Use the data from 'nat-network' network definition to enable the test case also for xml2argvtest. Since the network listen bit doesn't need any plug definition just use an empty string. Signed-off-by: Peter Krempa --- ...graphics-listen-network.x86_64-latest.args | 37 +++ .../g

[PATCH 17/19] virnetworkportxml2xmltest: Add simple versions of bridge/network tests

2023-12-15 Thread Peter Krempa
Add versions stripping vlans and bandwidth setup so that they can be used in qemuxml2argvtest for interfaces which don't support the above. Signed-off-by: Peter Krempa --- tests/virnetworkportxml2xmldata/plug-bridge-basic.xml | 11 +++ .../virnetworkportxml2xmldata/plug-network-basic.xml

[PATCH 15/19] qemuxml2xmltest: Introduce fake network driver

2023-12-15 Thread Peter Krempa
In order to be able to use ' --- tests/qemuxml2argvtest.c | 98 1 file changed, 98 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 13d279b301..7197fd35db 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtes

[PATCH 14/19] qemuxml2argvmock: Mock virNetDevSetMTU

2023-12-15 Thread Peter Krempa
Unfortunately the network backend commandline formatter attempts to also setup the backend itself, which it really should not. For now make sure qemuxml2argvtest can call virNetDevSetMTU. Signed-off-by: Peter Krempa --- src/util/virnetdev.h | 2 +- tests/qemuxml2argvmock.c | 8 2 f

[PATCH 13/19] qemu: process: Separate setup of network device objects

2023-12-15 Thread Peter Krempa
Separate the SLIRP bits from 'qemuProcessNetworkPrepareDevices' and do the setup of the internal data when setting up domain data. This will allow tests to use the same code path to lookup data for a network. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 45 +

[PATCH 12/19] qemuxml2xmltest: Delete 'interface-driver' case

2023-12-15 Thread Peter Krempa
Everything this XML tests is already explicitly covered in other tests. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/interface-driver.xml | 54 --- .../interface-driver.x86_64-latest.xml| 67 --- tests/qemuxml2xmltest.c | 1 -

[PATCH 08/19] qemuxml2argvtest: Add test cases covered only by qemuxml2xmltest - part 1

2023-12-15 Thread Peter Krempa
There were plenty of test cases invoked only from qemuxml2xmltest but not from qemuxml2argvtest, either by accident or it was deemed unneeded. Bulk-add all test cases which fit the above description which don't require faking the network driver. Use same invocation as present in qemuxml2xmltest.

[PATCH 11/19] qemuxml*test: Improve 'vhost_queues' test case

2023-12-15 Thread Peter Krempa
Modify the test case so that it can be used also for qemuxml2argvtest by removing invalid configuration (interface type='user' + queues), clean up unneeded disks and rename it accordingly. Also test the ioeventfd. Signed-off-by: Peter Krempa --- .../net-virtio-vhost.x86_64-latest.args | 42

[PATCH 10/19] qemuxml2*test: Add specific test case for interface link state

2023-12-15 Thread Peter Krempa
Test both linkstates in an explicit test case. Note that link state is setup via monitor, thus not visible on the commandline. Signed-off-by: Peter Krempa --- .../net-linkstate.x86_64-latest.args | 36 +++ tests/qemuxml2argvdata/net-linkstate.xml | 34 ++ te

[PATCH 09/19] qemuxml2xmltest: Move 'graphics-listen-network2' case go genericxml2xmltest

2023-12-15 Thread Peter Krempa
The tested configuration is not valid for a qemu VM. Move it to the generic test. Signed-off-by: Peter Krempa --- .../graphics-listen-network2.xml | 0 .../graphics-listen-network2.xml} | 19 +++ tests/genericxml2xmltest.c| 1 + test

[PATCH 06/19] qemuxml2argvtest: Check for duplicate invocation of tests

2023-12-15 Thread Peter Krempa
Prevent duplicated invocation of tests by tracking use of output files. Some cases need to be exempt from this for now. Signed-off-by: Peter Krempa --- tests/qemustatusxml2xmltest.c | 2 +- tests/qemuxml2argvtest.c | 37 +++ tests/testutilsqemu.h |

[PATCH 07/19] qemuxml2argvmock: Mock qemuInterfaceBridgeConnect

2023-12-15 Thread Peter Krempa
Prepare for test cases which would want to call that function. Signed-off-by: Peter Krempa --- src/qemu/qemu_interface.h | 2 +- tests/qemuxml2argvmock.c | 17 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h

[PATCH 04/19] qemuxml2argvdata: Move 'smbios-multiple-type2' case to genericxml2xmltest

2023-12-15 Thread Peter Krempa
The qemu driver explicitly rejects such configuration, thus this is just a generic XML2XML test case. Move it. Signed-off-by: Peter Krempa --- .../smbios-multiple-type2.xml | 0 tests/genericxml2xmltest.c | 2 ++ tests/qemuxm

[PATCH 05/19] qemuxml2argvtest: Remove duplicated invocations of tests

2023-12-15 Thread Peter Krempa
'parallel-tcp-chardev', 'parallel-parport-chardev' are invoked twice with exactly the same parameters, remove the duplicity. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5ce

[PATCH 03/19] qemuxml2argvtest: Reinstate 'pseries-vio-address-clash' case

2023-12-15 Thread Peter Krempa
The case was removed in commit 8ff73d22c7405049452e2bf7f281f7460a6b9d10 which modernized the cases without an explicit reason. Reinstate it. Fixes: 8ff73d22c7405049452e2bf7f281f7460a6b9d10 Signed-off-by: Peter Krempa --- .../qemuxml2argvdata/pseries-vio-address-clash.ppc64-latest.err | 1 + tes

[PATCH 02/19] qemuxml2argvtest: Fix and use 'disk-network-ssh-key' case

2023-12-15 Thread Peter Krempa
The test case was introduced by commit 68599168ea8185689bd227e6d142e3d933558f84 but is only used in the qemunbdkittest. Fix it and make use of it also in qemuxml2argvtest. Fixes: 68599168ea8185689bd227e6d142e3d933558f84 Signed-off-by: Peter Krempa --- .../disk-network-ssh-key.x86_64-latest.args

[PATCH 00/19] qemu XML testing improvements, part 1 - forgotten test files and network driver

2023-12-15 Thread Peter Krempa
This patch saga aims to improve and simplify testing of qemu XML configs. Part 1 deals with input test files which are not used in qemuxml2argvtest, introduces a mock network driver and adds a checker that all input files are in fact used. Peter Krempa (19): qemuxml2argvtest: Reinstate 'console

[PATCH 01/19] qemuxml2argvtest: Reinstate 'console-compat-chardev' and 'pci-serial-dev-chardev'

2023-12-15 Thread Peter Krempa
The tests invocations were accidentaly removed in commit 54257ed51b5132032cedb7e1e7b8c34b9ae52115 Fixes: 54257ed51b5132032cedb7e1e7b8c34b9ae52115 Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxm

Re: [PATCH 0/4] virsh/virt-admin: Don't use virErrorRestore

2023-12-15 Thread Michal Prívozník
On 12/14/23 17:56, Peter Krempa wrote: > Client application shouldn't need to reset the error. > > Peter Krempa (4): > virshReconnect: Preserve current URI if not explicitly set in > ctl->connname > virshCatchDisconnect: Don't probe connection URI > vshAdmConnect: Preserve connection URI

[PATCH 4/4] vshAdmCatchDisconnect: Don't probe connection URI

2023-12-15 Thread Peter Krempa
virsh already stores the connection URI in 'ctl->connname', use that instead. Signed-off-by: Peter Krempa --- tools/virt-admin.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 02cf421cee..fa9304c772 100644 --- a/tools/virt

Re: [PATCH] CIM: Include in libxkutil for malloc functions

2023-12-15 Thread Michal Prívozník
On 12/15/23 11:16, Florian Weimer wrote: > * Peter Krempa: > >> On Fri, Dec 15, 2023 at 11:04:51 +0100, Florian Weimer wrote: >>> This avoids implicit function declarations and build failures with >>> future compilers. >>> >>> Not sure where to submit this. Our Fedora package references >>>

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread John Levon
On Fri, Dec 15, 2023 at 11:20:10AM +, Daniel P. Berrangé wrote: > Libvirt is executing the error callback and work done in the error callback > is breaking our API guarantee. > > This broken API guarantee is not the app's fault, it is libvirt's fault for > not protecting itself against things

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread Daniel P . Berrangé
On Wed, Dec 13, 2023 at 11:04:54AM +, John Levon wrote: > > These two functions are currently private to libvirt, hence not available to > consumers. Would it be possible to make them public? Without them, there's no > way to do any libvirt call without stomping on an existing error that you m

[PATCH v2 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Fima Shevrin
RPC client implementation uses the following paradigm. The critical section is organized via virObjectLock(client)/virObjectUnlock(client) braces. Though this is potentially problematic as main thread:side thread: virObjectUnlock(client);

[PATCH v2 2/3] utils: Module extension for using locable object in GSourceFuncs

2023-12-15 Thread Fima Shevrin
The ability to use virObjectLockable allows to unlock an object at the prepare stage inside the Main Event Loop. Co-authored-by: Denis V. Lunev Co-authored-by: Nikolai Barybin Signed-off-by: Fima Shevrin --- src/rpc/virnetclient.c | 6 +++--- src/util/vireventglib.c | 4 ++-- src

[PATCH v2 0/3] Rework main and side threads interaction in rpc

2023-12-15 Thread Fima Shevrin
From: "Fima Shevrin" RPC client implementation uses the following paradigm. The critical section is organized via virObjectLock(client)/virObjectUnlock(client) braces. Though this is potentially problematic as main thread:side thread: virObjectUnlock(client);

Re: [PATCH] Extend libvirt-guests to shutdown only persistent VMs

2023-12-15 Thread Benjamin Taubmann
ping > On 13. Nov 2023, at 11:22, Benjamin Taubmann > wrote: > > At the moment, there is no configuration option for the libvirt-guests > service that allows users to define that only persistent virtual machines > should be shutdown on host shutdown. > > Currently, the service config allows to

Re: [PATCH 3/3] rpc: Rework rpc notifications in main and side thread

2023-12-15 Thread Daniel P . Berrangé
On Fri, Dec 15, 2023 at 02:32:19AM +0800, Fima Shevrin wrote: > RPC client implementation uses the following paradigm. The critical > section is organized via virObjectLock(client)/virObjectUnlock(client) > braces. Though this is potentially problematic as > main thread:

close callback and multiple threads

2023-12-15 Thread John Levon
On Fri, Dec 15, 2023 at 10:58:29AM +, Daniel P. Berrangé wrote: > If you use the virConnectRegisterCloseCallback() method, you should get > notified of the connection drop at precisely the right time, every time, > regardless of whether you happen to be making an API call at the time. That on

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread Daniel P . Berrangé
On Wed, Dec 13, 2023 at 11:04:54AM +, John Levon wrote: > > These two functions are currently private to libvirt, hence not available to > consumers. Would it be possible to make them public? Without them, there's no > way to do any libvirt call without stomping on an existing error that you m

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread Daniel P . Berrangé
On Thu, Dec 14, 2023 at 05:55:41PM +0100, Peter Krempa wrote: > On Thu, Dec 14, 2023 at 12:03:55 +, John Levon wrote: > Using the global error handler function is not a very good idea in > multithreaded applications, so I'd really suggest to have a generic > handler function that you'll call af

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread Peter Krempa
On Fri, Dec 15, 2023 at 10:28:18 +, John Levon wrote: > On Fri, Dec 15, 2023 at 10:32:36AM +0100, Peter Krempa wrote: > > > > Although, it sounds like you know of a counter-example piece of code: is > > > it > > > something you could share? > > > > See above for the pointers to virsh. > > v

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread John Levon
On Fri, Dec 15, 2023 at 10:32:36AM +0100, Peter Krempa wrote: > > Although, it sounds like you know of a counter-example piece of code: is it > > something you could share? > > See above for the pointers to virsh. virsh is single threaded. regards joh n _

Re: [PATCH 1/2] ci: integration: Switch upstream integration tests to Fedora 39

2023-12-15 Thread Andrea Bolognani
On Thu, Dec 14, 2023 at 09:28:16AM +0100, Michal Privoznik wrote: > Currently, Fedora 37 and 38 is used. The former is now EOL since > there's new release. Switch 37 to 39 then. > > Signed-off-by: Michal Privoznik > --- > ci/integration.yml | 80 +++--- > 1

Re: [PATCH] CIM: Include in libxkutil for malloc functions

2023-12-15 Thread Florian Weimer
* Peter Krempa: > On Fri, Dec 15, 2023 at 11:04:51 +0100, Florian Weimer wrote: >> This avoids implicit function declarations and build failures with >> future compilers. >> >> Not sure where to submit this. Our Fedora package references >> , but it's 404, and I can't fi

Re: [PATCH] CIM: Include in libxkutil for malloc functions

2023-12-15 Thread Peter Krempa
On Fri, Dec 15, 2023 at 11:04:51 +0100, Florian Weimer wrote: > This avoids implicit function declarations and build failures with > future compilers. > > Not sure where to submit this. Our Fedora package references > , but it's 404, and I can't find a CIM > component in

[PATCH] CIM: Include in libxkutil for malloc functions

2023-12-15 Thread Florian Weimer
This avoids implicit function declarations and build failures with future compilers. Not sure where to submit this. Our Fedora package references , but it's 404, and I can't find a CIM component in the Gitlab organization. Thanks, Florian diff --git a/libxkutil/infostor

Re: Public virErrorPreserveLast()/virErrorRestore()

2023-12-15 Thread Peter Krempa
On Thu, Dec 14, 2023 at 19:02:56 +, John Levon wrote: > On Thu, Dec 14, 2023 at 05:55:41PM +0100, Peter Krempa wrote: > > > If you need any form of more complex logic in your application for error > > reporting (ab)using libvirt's thread local variable to store the error > > I'm a bit lost on

[PATCH v3 04/13] libxl: turn virCapabilitiesAddHostFeature() to void

2023-12-15 Thread Dmitry Frolov
virCapabilitiesAddHostFeature() always returns 0. Signed-off-by: Dmitry Frolov --- src/conf/capabilities.c| 4 +--- src/conf/capabilities.h| 2 +- src/libxl/libxl_capabilities.c | 5 ++--- src/test/test_driver.c | 6 ++ 4 files changed, 6 insertions(+), 11 deletions(-

[PATCH v3 13/13] rpc: turn virNetClientAddProgram() to void

2023-12-15 Thread Dmitry Frolov
virNetClientAddProgram() always returns 0. Signed-off-by: Dmitry Frolov --- src/admin/admin_remote.c| 3 +-- src/locking/lock_driver_lockd.c | 3 +-- src/logging/log_manager.c | 3 +-- src/lxc/lxc_monitor.c | 4 +--- src/remote/remote_driver.c | 7 +++ src/rpc/vi

[PATCH v3 06/13] libxl: turn libxlMakeDomainOSCaps() to void

2023-12-15 Thread Dmitry Frolov
libxlMakeDomainOSCaps() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_capabilities.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 8853ba9d88..defbf9d223 100644 --- a/src/l

[PATCH v3 09/13] libxl: turn libxlMakeDomainDeviceVideoCaps() to void

2023-12-15 Thread Dmitry Frolov
libxlMakeDomainDeviceVideoCaps() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_capabilities.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 9b219adb3c..b0bd468442 100644 --- a

[PATCH v3 08/13] libxl: turn libxlMakeDomainDeviceGraphicsCaps() to void

2023-12-15 Thread Dmitry Frolov
libxlMakeDomainDeviceGraphicsCaps() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_capabilities.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 7663790649..9b219adb3c 100644 ---

[PATCH v3 07/13] libxl: turn libxlMakeDomainDeviceDiskCaps() to void

2023-12-15 Thread Dmitry Frolov
libxlMakeDomainDeviceDiskCaps() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_capabilities.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index defbf9d223..7663790649 100644 --- a/s

[PATCH v3 02/13] cpu: turn virCPUx86DataAdd() to void

2023-12-15 Thread Dmitry Frolov
virCPUx86DataAdd() always returns 0. Signed-off-by: Dmitry Frolov --- src/cpu/cpu_x86.c | 66 +- src/cpu/cpu_x86.h | 2 +- src/libxl/libxl_capabilities.c | 7 +--- 3 files changed, 26 insertions(+), 49 deletions(-) diff --git a/src/cpu

[PATCH v3 10/13] conf: turn virDomainGraphicsListenAppendAddress() to void

2023-12-15 Thread Dmitry Frolov
virDomainGraphicsListenAppendAddress() always returns 0. Signed-off-by: Dmitry Frolov --- src/conf/domain_conf.c | 4 +--- src/conf/domain_conf.h | 4 ++-- src/libxl/xen_common.c | 7 ++- src/libxl/xen_xl.c | 3 +-- src/vbox/vbox_common.c | 4 +--- src/vmx/vmx.c | 3 +-- 6 files

[PATCH v3 11/13] vbox: turn vboxDumpDisplay() to void

2023-12-15 Thread Dmitry Frolov
vboxDumpDisplay() always returns 0. Signed-off-by: Dmitry Frolov --- src/vbox/vbox_common.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 9f6612ad61..305c85f4ec 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox

[PATCH v3 05/13] conf: turn virCapabilitiesSetNetPrefix() to void

2023-12-15 Thread Dmitry Frolov
virCapabilitiesSetNetPrefix() always returns 0. Signed-off-by: Dmitry Frolov --- src/conf/capabilities.c| 4 +--- src/conf/capabilities.h| 2 +- src/libxl/libxl_capabilities.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/conf/capabilities.c b/src/co

[PATCH v3 01/13] cpu: turn virCPUx86DataAddItem() to void

2023-12-15 Thread Dmitry Frolov
virCPUx86DataAddItem() always returns 0. Signed-off-by: Dmitry Frolov --- src/cpu/cpu_x86.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 8d0e3947ce..f32770b8a3 100644 --- a/src/cpu/cpu_x86.c +++ b/sr

[PATCH v3 03/13] libxl: turn libxlCapsAddCPUID() to void

2023-12-15 Thread Dmitry Frolov
libxlCapsAddCPUID() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_capabilities.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 9da0fe851c..9be64a53a8 100644 --- a/src/libxl/lib

[PATCH v3 12/13] libxl: turn xenParseXLNamespaceData() to void

2023-12-15 Thread Dmitry Frolov
xenParseXLNamespaceData() always returns 0. Signed-off-by: Dmitry Frolov --- src/libxl/xen_xl.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 553aa77896..ea825e85bd 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen

fixed patch

2023-12-15 Thread Dmitry Frolov
Oops... my fault. libxen-dev package was not installed, so xenParseXLNamespaceData was not compiled, thus i missed the error. Also i missed, that libxl_get_physinfo comes with libxen-dev. So, I excluded it from the patch. Many thanks! Dmitry. ___ Deve

[PATCH v3 00/13] Unreacheble code cleanup

2023-12-15 Thread Dmitry Frolov
A lot of unreacheble code was caused by int functions, which return nothing except zero. Unreacheble code was removed. Corresponding functions type was changed to void. --- v2: Changing functions return type to void v3: fixed errors in v2 Dmitry Frolov (13): cpu: turn virCPUx86DataAddItem() to