[PATCH] tests: libxl: Mock xs_open and xs_close

2021-05-17 Thread Jim Fehlig
The Xen-related unit tests are failing against the recently released Xen 4.15. Xen commit 90c9f9f4dd changed the implementation of libxl_ctx_alloc to use xs_open instead of xs_daemon_open. libvirt has already mocked xs_daemon-{open,close} and others to allow using libxl in confined build

[PATCH] tests: Replace deprecated ASN1 code

2021-05-17 Thread Luke Yue
This fixes compiler warnings when building with libtasn1 4.17.0. Signed-off-by: Luke Yue --- tests/pkix_asn1_tab.c| 2 +- tests/virnettlshelpers.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/pkix_asn1_tab.c b/tests/pkix_asn1_tab.c index

Qemu block filter insertion/removal API

2021-05-17 Thread Vladimir Sementsov-Ogievskiy
Hi all! I'd like to be sure that we know where we are going to. In blockdev-era where qemu user is aware about block nodes, all nodes have good names and controlled by user we can efficiently use block filters. We already have some useful filters: copy-on-read, throttling, compress. In my

Re: [PATCH] viridentity: Fix ref/unref imbalance in VIR_IDENTITY_AUTORESTORE

2021-05-17 Thread Daniel P . Berrangé
On Mon, May 17, 2021 at 06:12:56PM +0200, Michal Privoznik wrote: > The basic use case of VIR_IDENTITY_AUTORESTORE() is in > conjunction with virIdentityElevateCurrent(). What happens is > that virIdentityElevateCurrent() gets current identity (which > increases the refcounter of thread local

[PATCH] viridentity: Fix ref/unref imbalance in VIR_IDENTITY_AUTORESTORE

2021-05-17 Thread Michal Privoznik
The basic use case of VIR_IDENTITY_AUTORESTORE() is in conjunction with virIdentityElevateCurrent(). What happens is that virIdentityElevateCurrent() gets current identity (which increases the refcounter of thread local virIdentity object) and returns a pointer to it. Later, when the variable goes

RFC: Qemu backup interface plans

2021-05-17 Thread Vladimir Sementsov-Ogievskiy
Hi all! I'd like to share and discuss some plans on Qemu backup interface I have. (actually, most of this I've presented on KVM Forum long ago.. But now I'm a lot closer to realization:) I'd start with a reminder about image fleecing: We have image fleecing scheme to export point-in-time

Re: [PATCH libvirt v1] tests: add capabilities for QEMU 6.0.0 on s390x

2021-05-17 Thread Shalini Chellathurai Saroja
On 5/13/21 12:45 PM, Michal Prívozník wrote: On 5/13/21 11:53 AM, Andrea Bolognani wrote: On Thu, May 13, 2021 at 11:39:24AM +0200, Michal Prívozník wrote: On 5/12/21 6:11 PM, Andrea Bolognani wrote: Overall looks reasonable, but comparing the computed capabilities with those for QEMU 5.2

Re: [PATCH 4/4] virCapabilitiesHostNUMAFormat: Bring variables into loops

2021-05-17 Thread Michal Prívozník
On 5/17/21 3:46 PM, Ján Tomko wrote: > On a Monday in 2021, Michal Privoznik wrote: >> Signed-off-by: Michal Privoznik >> --- >> src/conf/capabilities.c | 9 + >> 1 file changed, 5 insertions(+), 4 deletions(-) >> >> diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c >> index

Re: [libvirt PATCH] meson: Add yajl kludge

2021-05-17 Thread Ján Tomko
On a Friday in 2021, Andrea Bolognani wrote: If this looks familiar, that's because it's literally *the same code* that we used to work around *the same issue* in readline before 1635dca26f61def3fbf56c70fbbfe514f2b50987 :) Note that the issue only really affects people building from source on

Re: [PATCH 0/4] Couple of virnuma cleanups

2021-05-17 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: I'm looking into NUMA code in capabilities and came up with a couple of cleanups. Technically, 3/4 is not needed yet, but I'll be introducing new data to vircaps2xmltest where a NUMA node has no CPUs and that's why the patch is needed. Michal

Re: [PATCH 4/4] virCapabilitiesHostNUMAFormat: Bring variables into loops

2021-05-17 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/conf/capabilities.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 1dae6d38cc..915cd3149e 100644 ---

Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality

2021-05-17 Thread Stefan Hajnoczi
On Mon, May 17, 2021 at 11:47:11AM +0100, Alex Bennée wrote: > > Daniel P. Berrangé writes: > > > On Wed, May 05, 2021 at 11:41:46AM +0100, Alex Bennée wrote: > >> > >> Alex Bennée writes: > >> > >> > Daniel P. Berrangé writes: > >> > > >> >> On Wed, May 05, 2021 at 10:22:57AM +0100, Alex

Re: [PATCH] driver: Don't leak saved error in virGetConnectGeneric()

2021-05-17 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: Recently, a new code was added to virGetConnectGeneric() that saves the original error into a variable so that it's not lost in virConnectClose() called under the 'error' label. However, the error saving code uses virSaveLastError() + virSetError()

[PATCH] driver: Don't leak saved error in virGetConnectGeneric()

2021-05-17 Thread Michal Privoznik
Recently, a new code was added to virGetConnectGeneric() that saves the original error into a variable so that it's not lost in virConnectClose() called under the 'error' label. However, the error saving code uses virSaveLastError() + virSetError() combo which leaks the memory allocated for the

[PATCH 4/4] virCapabilitiesHostNUMAFormat: Bring variables into loops

2021-05-17 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/conf/capabilities.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 1dae6d38cc..915cd3149e 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -807,8

[PATCH 3/4] virnumamock: Allow CPU-less NUMA nodes

2021-05-17 Thread Michal Privoznik
The original virNumaGetNodeCPUs() returns an empty virBitmap if given NUMA node has no CPUs. But that's not how our mock behaves - it looks under $fakesysfs/node/node$N/cpulist only to find an empty file which is then passed to virBitmapParseUnlimited() which threats such input as error.

[PATCH 0/4] Couple of virnuma cleanups

2021-05-17 Thread Michal Privoznik
I'm looking into NUMA code in capabilities and came up with a couple of cleanups. Technically, 3/4 is not needed yet, but I'll be introducing new data to vircaps2xmltest where a NUMA node has no CPUs and that's why the patch is needed. Michal Prívozník (4): numa_conf: Use virXMLFormatElement()

[PATCH 1/4] numa_conf: Use virXMLFormatElement() in virDomainNumaDefFormatXML

2021-05-17 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/conf/numa_conf.c | 107 +++ 1 file changed, 48 insertions(+), 59 deletions(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 525bc28962..537e515b5a 100644 --- a/src/conf/numa_conf.c +++

[PATCH 2/4] virnuma: Export virNumaGetMaxCPUs properly

2021-05-17 Thread Michal Privoznik
This function will be used in virnumamock, shortly. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virnuma.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1df4b8cfe8..b7bbe46dc7

Re: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality

2021-05-17 Thread Alex Bennée
Daniel P. Berrangé writes: > On Wed, May 05, 2021 at 11:41:46AM +0100, Alex Bennée wrote: >> >> Alex Bennée writes: >> >> > Daniel P. Berrangé writes: >> > >> >> On Wed, May 05, 2021 at 10:22:57AM +0100, Alex Bennée wrote: >> >> >>> +TCG introspection features >> >>>

Re: [PATCH 4/4] tests: qemucapabilities: Add test-data for the qemu-6.1 cycle

2021-05-17 Thread Jiri Denemark
On Mon, May 17, 2021 at 11:16:35 +0200, Peter Krempa wrote: > Add test data based on qemu commit v6.0.0-540-g6005ee07c3. > > Notable changes are the removal of 'sheepdog' disk storage protocol. > > Additionally the cpu model reported when probing seems to have changed > from: > > "model-id":

Re: [libvirt PATCH 1/4] test: move nodedev xml2xml output to a separate dir

2021-05-17 Thread Pavel Hrdina
On Fri, May 14, 2021 at 04:28:58PM -0500, Jonathon Jongsma wrote: > Currently, we're loading and parsing the xml from the input file, and > then formatting it and then comparing it directly back to the input > file. This works for now, but is severely limiting as it relies on the > input file

Re: [PATCH 0/4] tests: qemucapabilities: Add data fro the 6.1 cycle

2021-05-17 Thread Pavel Hrdina
On Mon, May 17, 2021 at 11:16:31AM +0200, Peter Krempa wrote: > QEMU already committed some significant changes since the tree opened. > The most notable which has fallout in libvirt is the dropping of the > 'sheepdog' driver. This series adapts to that and then adds the > qemu capabilities data

Re: [PATCH] Delete forward declaration in storage_backend_sheepdog.c.

2021-05-17 Thread Peter Krempa
On Sun, May 16, 2021 at 14:23:07 +0800, peili wrote: > --- > src/storage/storage_backend_sheepdog.c | 99 +- > 1 file changed, 48 insertions(+), 51 deletions(-) Note that we are considering fully removing the sheepdog storage driver backend as of:

[PATCH 4/4] tests: qemucapabilities: Add test-data for the qemu-6.1 cycle

2021-05-17 Thread Peter Krempa
Add test data based on qemu commit v6.0.0-540-g6005ee07c3. Notable changes are the removal of 'sheepdog' disk storage protocol. Additionally the cpu model reported when probing seems to have changed from: "model-id": "AMD Ryzen 9 3900X 12-Core Processor" to: "model-id": "QEMU TCG

[PATCH 1/4] testQemuInfoSetArgs: Strip default machine alias only for 'latest' test cases

2021-05-17 Thread Peter Krempa
For the real-capabilities test cases testing 'latest' capabilities we strip off the alias from 'pc' to the appropriate versioned machine type to prevent update to all tests when bumping qemu capabilities. Recenly we also started caching the capabilities to prevent re-parsing the XML all the time.

[PATCH 3/4] qemuxml2argvtest: Limit 'disk-network-sheepdog' testcase to qemu-6.0.0

2021-05-17 Thread Peter Krempa
QEMU is dropping sheepdog support in 6.1 so we need to limit the test case to the latest version supporting sheepdog as it won't be described by the QMP schema any more. Signed-off-by: Peter Krempa --- ...6_64-latest.args => disk-network-sheepdog.x86_64-6.0.0.args} | 2 +-

[PATCH 2/4] qemublocktest: Drop 'network-sheepdog-qcow2' image creation test case

2021-05-17 Thread Peter Krempa
QEMU dropped sheepdog support for the 6.1 release. Since we use schema validation in the image creation it would create test failures. In this instance we just drop the test altogether as adding versioned capabilities would be a bit too overkill for this scenario. Signed-off-by: Peter Krempa

[PATCH 0/4] tests: qemucapabilities: Add data fro the 6.1 cycle

2021-05-17 Thread Peter Krempa
QEMU already committed some significant changes since the tree opened. The most notable which has fallout in libvirt is the dropping of the 'sheepdog' driver. This series adapts to that and then adds the qemu capabilities data for this cycle based on the most recent qemu upstream commit. Patch 4

Re: [PATCH 0/3] tests: Return EXIT_* from main instead of 0/-1

2021-05-17 Thread Peter Krempa
On Mon, May 17, 2021 at 08:49:07 +0200, Michal Privoznik wrote: > See 3/3 for rationale. > > Michal Prívozník (3): > testutils: Drop libtool binary name handling > tests: Return EXIT_FAILURE/EXIT_SUCCESS instead of -1/0 > testutils: Document and enforce @func callback retvals for >

Re: [PATCH 3/3] testutils: Document and enforce @func callback retvals for virTestMain()

2021-05-17 Thread Peter Krempa
On Mon, May 17, 2021 at 08:49:10 +0200, Michal Privoznik wrote: > Sometimes a test has a wrapper over main() (e.g. because it's > preloading some mock libraries). In such case, the main() is > renamed to something else (usually mymain()), and main() is > generated by calling one of VIR_TEST_MAIN()

Re: How to hot plugin a new vhost-user-blk-pci device to running VM?

2021-05-17 Thread Michal Prívozník
On 5/17/21 7:08 AM, Liang Chaojun wrote: > > Thanks Michal and Peter for your response. I‘ m running it on qemu 5.1 build > by myself. BTW, follow Peter’s suggestion, where I can get the latest rpms if > I want to upgrade to Libvirt 7.1? As I know it seems need more than twenty > related rpms

Re: How to hot plugin a new vhost-user-blk-pci device to running VM?

2021-05-17 Thread Han Han
On Mon, May 17, 2021 at 1:09 PM Liang Chaojun wrote: > > Thanks Michal and Peter for your response. I‘ m running it on qemu 5.1 > build by myself. BTW, follow Peter’s suggestion, where I can get the latest > rpms if I want to upgrade to Libvirt 7.1? As I know it seems need more than > twenty

[PATCH 3/3] testutils: Document and enforce @func callback retvals for virTestMain()

2021-05-17 Thread Michal Privoznik
Sometimes a test has a wrapper over main() (e.g. because it's preloading some mock libraries). In such case, the main() is renamed to something else (usually mymain()), and main() is generated by calling one of VIR_TEST_MAIN() or VIR_TEST_MAIN_PRELOAD() macros. This has a neat side effect - if

[PATCH 1/3] testutils: Drop libtool binary name handling

2021-05-17 Thread Michal Privoznik
Back in the old days, we used to use libtool to run compiled libraries. That meant we had to deal with "lt-" prefix for our binaries. With meson that's no longer the case. Signed-off-by: Michal Privoznik --- tests/testutils.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff

[PATCH 0/3] tests: Return EXIT_* from main instead of 0/-1

2021-05-17 Thread Michal Privoznik
See 3/3 for rationale. Michal Prívozník (3): testutils: Drop libtool binary name handling tests: Return EXIT_FAILURE/EXIT_SUCCESS instead of -1/0 testutils: Document and enforce @func callback retvals for virTestMain() tests/fchosttest.c | 2 +- tests/qemusecuritytest.c|

[PATCH 2/3] tests: Return EXIT_FAILURE/EXIT_SUCCESS instead of -1/0

2021-05-17 Thread Michal Privoznik
When using VIR_TEST_MAIN() or VIR_TEST_MAIN_PRELOAD() macros, the retval of mymain() will become retval of main(). Hence, mymain() should use EXIT_FAILURE and EXIT_SUCCESS return values for greater portability. Another reason is that otherwise our summary printing of failed tests doesn't work (see