[libvirt][PATCH v6 4/6] Add unit tests for guest VM creation command with SGX EPC

2021-08-19 Thread Haibin Huang
From: Lin Yang --- .../sgx-epc.x86_64-5.1.0.args | 41 +++ tests/qemuxml2argvdata/sgx-epc.xml| 40 ++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 82 insertions(+) create mode 100644 tests/qemuxml2argvdata/sgx

[libvirt][PATCH v6 3/6] Support to query SGX capability

2021-08-19 Thread Haibin Huang
1.Add SGX feature in domain capabilities 2.Get sgx capabilities by query-sgx-capabilities 3.Transfer the B to KB for epc_size 4.Delete sgx1 and sgx2 5.add unit test for get capabilities Signed-off-by: Haibin Huang --- src/conf/domain_capabilities.c| 29 src/conf/domain_capa

[libvirt][PATCH v6 1/6] conf: Introduce SGX EPC element into device memory xml

2021-08-19 Thread Haibin Huang
From: Lin Yang ... 512 ... --- docs/schemas/domaincommon.rng| 1 + src/conf/domain_conf.c | 4 src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 1 + src/qemu/qemu_domain.c | 2 ++ src/security/security_apparmor.c

[libvirt][PATCH v6 5/6] Add dommaincaps unit test

2021-08-19 Thread Haibin Huang
Signed-off-by: Haibin Huang --- docs/schemas/domaincaps.rng | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 325581476d..a9fd21fcb6 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -

[libvirt][PATCH v6 2/6] qemu: Add command-line to generate SGX EPC memory backend

2021-08-19 Thread Haibin Huang
From: Lin Yang According to the result parsing from xml, add the argument of SGX EPC memory backend into QEMU command line: #qemu-system-x86_64 \ .. \ -object memory-backend-epc,id=mem1,size=64M,prealloc=on \ -object memory-backend-epc,id=mem2,size=28M \ -

[libvirt][PATCH v6 0/6] Support query and use SGX

2021-08-19 Thread Haibin Huang
This patch series provides support for enabling Intel's Software Guard Extensions (SGX) feature in guest VM. Giving the SGX support in QEMU is still pending for reviewing, this patch series is not submmited for code review, but only describe the SGX enabling solution design that contains chan

[PATCH 2/2] docs/about: Unify the subject format

2021-08-19 Thread Yanan Wang
Unify the subject format in deprecated.rst to "since X.Y". Unify the subject format in removed-features.rst to "removed in X.Y". Signed-off-by: Yanan Wang --- docs/about/deprecated.rst | 56 - docs/about/removed-features.rst | 28 - 2 files c

[PATCH 1/2] docs/about: Remove the duplicated doc

2021-08-19 Thread Yanan Wang
There are two places describing the same thing about deprecation of invalid topologies of -smp CLI, so remove the duplicated one. Signed-off-by: Yanan Wang Reviewed-by: Cornelia Huck --- docs/about/removed-features.rst | 13 - 1 file changed, 13 deletions(-) diff --git a/docs/about

[PATCH 0/2] docs/about: some documentation clean-up

2021-08-19 Thread Yanan Wang
These two patches (one of which has been reviewed) originally come from [1]. Here resend them separately as a short doc clean-up series. [1] https://lore.kernel.org/qemu-devel/20210819031027.41104-1-wangyana...@huawei.com/ Yanan Wang (2): docs/about: Remove the duplicated doc docs/about: Uni

Re: [libvirt PATCH 01/13] security: add SELinux policy for virt

2021-08-19 Thread Vit Mojzis
On 10. 08. 21 18:35, Daniel P. Berrangé wrote: On Tue, Aug 10, 2021 at 10:39:23AM +0200, Pavel Hrdina wrote: On Fri, Aug 06, 2021 at 06:47:58PM +0100, Daniel P. Berrangé wrote: From: Nikola Knazekova SELinux policy was created for: Hypervisor drivers: - virtqemud (QEMU/KVM) - virtlxcd (LXC

Re: [PATCH] fix error in printf format string

2021-08-19 Thread Michal Prívozník
On 8/19/21 2:14 PM, Zhenyu Ye wrote: > Use %s to print NULLSTR(duri). > > Reported-by: Peng Liang > Signed-off-by: Zhenyu Ye > --- > src/libvirt-domain.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c > index 4eb14d4176..3c4

Re: [libvirt PATCH 0/5] Waste less CPU on syntax-check

2021-08-19 Thread Michal Prívozník
On 8/19/21 4:12 PM, Ján Tomko wrote: > Use 'git ls-tree' directly instead of a wrapper script that > can possibly handle all the other versioning systems we do not use. > > Instead of adding, removing, then re-adding the absolute path prefix, > only add it once per every syntax check rule. > > De

Re: [libvirt PATCH] ch: monitor: unref mon->vm before vm

2021-08-19 Thread Michal Prívozník
On 8/19/21 4:15 PM, Ján Tomko wrote: > Do not access 'mon' after unref'ing it. > > Signed-off-by: Ján Tomko > --- > src/ch/ch_monitor.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Michal Privoznik Michal

Re: [PATCHv2 1/6] virnetdevovs: Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos

2021-08-19 Thread Michal Prívozník
On 8/17/21 6:38 AM, jx8zjs wrote: > From: Jinsheng Zhang > > Add vmuuid notes on virNetDevOpenvswitchInterfaceSetQos, > and change vmid to vmuuid. > > Signed-off-by: Jinsheng Zhang > --- > src/util/virnetdevopenvswitch.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) I th

Re: [PATCHv2 3/6] virnetdevovs: Extract common code block to a single function

2021-08-19 Thread Michal Prívozník
On 8/17/21 6:38 AM, jx8zjs wrote: > From: Jinsheng Zhang > > Signed-off-by: zhangjl02 > > s > > Signed-off-by: zhangjl02 > > s > > Signed-off-by: zhangjl02 A bit weird commit message :-) Michal

Re: [PATCHv2 0/6] virDomain: fix problems when setting qos on ovs managed

2021-08-19 Thread Michal Prívozník
On 8/17/21 6:38 AM, jx8zjs wrote: > --- > > diff to v1: > - Modify commit message to no longer then 80 characters. > - Split patch into several commits > - Add notes on some function and defination > - Extract common code block to a single function > > Thanks to Pavel Hrdina for helping

Re: [PATCHv2 6/6] tests: add test on virNetDevOpenvswitchInterfaceSetQos and virNetDevOpenvswitchInterfaceClearQos

2021-08-19 Thread Michal Prívozník
On 8/17/21 6:38 AM, jx8zjs wrote: > From: Jinsheng Zhang > > Test virNetDevOpenvswitchInterfaceSetQos and > virNetDevOpenvswitchInterfaceClearQos with dryrun method. > > Signed-off-by: zhangjl02 > --- > tests/virnetdevopenvswitchtest.c | 196 ++- > 1 file changed, 1

Re: [PATCHv2 2/6] virnetdevovs: Extract conversion parameters between virNetDevBandwidth and ovs

2021-08-19 Thread Michal Prívozník
On 8/17/21 6:38 AM, jx8zjs wrote: > From: Jinsheng Zhang > > Signed-off-by: zhangjl02 > --- > src/util/virnetdevopenvswitch.c | 12 +++- > src/util/virnetdevopenvswitch.h | 7 +++ > 2 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/src/util/virnetdevopenvswitch.

[PATCH 5/5] rpm: Enable numactl on s390x

2021-08-19 Thread Michal Privoznik
While s390x doesn't have NUMA nodes it has libnuma which is still helpful as it parses sysfs for us and kernel emulates NUMA#0. Signed-off-by: Michal Privoznik --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c3f50224

[PATCH 3/5] virhostmem: Let caller pass max NUMA node to virHostMemAllocPages

2021-08-19 Thread Michal Privoznik
In all three cases (LXC, QEMU and VBox drivers) the caller has access to host capabilities and thus know the maximum NUMA node. This means, that virHostMemAllocPages() doesn't have to query it. Querying may fail if libvirt was compiled without numactl support. Signed-off-by: Michal Privoznik ---

[PATCH 4/5] virhostmem: Handle numactl-less build in hugepages allocation/reporting

2021-08-19 Thread Michal Privoznik
When using 'virsh freepages' or 'virsh allocpages' then virHostMemGetFreePages() or virHostMemAllocPages() is called, respectively. But the following may happen: libvirt was built without numactl support and thus a fake NUMA node was constructed for capabilities, which means that startCell is going

[PATCH 0/5] Allow freepage/allocpages on numactl-less builds

2021-08-19 Thread Michal Privoznik
See 3/5 for explanation. Michal Prívozník (5): conf: Introduce virCapabilitiesHostNUMAGetMaxNode() virhostmem: Let caller pass max NUMA node to virHostMemGetFreePages virhostmem: Let caller pass max NUMA node to virHostMemAllocPages virhostmem: Handle numactl-less build in hugepages al

[PATCH 1/5] conf: Introduce virCapabilitiesHostNUMAGetMaxNode()

2021-08-19 Thread Michal Privoznik
This is just a small helper that will be used later. Signed-off-by: Michal Privoznik --- src/conf/capabilities.c | 9 + src/conf/capabilities.h | 2 ++ src/libvirt_private.syms | 1 + 3 files changed, 12 insertions(+) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c inde

[PATCH 2/5] virhostmem: Let caller pass max NUMA node to virHostMemGetFreePages

2021-08-19 Thread Michal Privoznik
In all three cases (LXC, QEMU and VBox drivers) the caller has access to host capabilities and thus know the maximum NUMA node. This means, that virHostMemGetFreePages() doesn't have to query it. Querying may fail if libvirt was compiled without numactl support. Signed-off-by: Michal Privoznik --

[libvirt PATCH 4/5] syntax-check: drop useless useless-if-before-free

2021-08-19 Thread Ján Tomko
With most of new code using g_auto for cleanup, contributors are used to most of the free fucntion handling NULL gracefully. Also, despite finding some occurrences in current codebase: avoid_if_before_free ~/libvirt/src/ch/ch_monitor.c: if (mon->vm) virObjectUnref(mon->vm); ~/libvirt

[libvirt PATCH 2/5] syntax-check: use VC_LIST_EXCEPT instead of VC_LIST

2021-08-19 Thread Ján Tomko
Three callers were using VC_LIST directly. This is not wrong, because they exclude the always-excluded files by only looking for C and/or header files. But using VC_LIST here prevents switching it to outputting relative paths. Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 6 +++---

[libvirt PATCH] ch: monitor: unref mon->vm before vm

2021-08-19 Thread Ján Tomko
Do not access 'mon' after unref'ing it. Signed-off-by: Ján Tomko --- src/ch/ch_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 1648d05017..0f8752d1ed 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -543

[libvirt PATCH 5/5] syntax-check: remove _test_script_regex

2021-08-19 Thread Ján Tomko
Commit abab5c47f8060eddf0212084a1d70c4b1e3d92dd incorrectly assumed we do not have any files that could be affected by sc_prohibit_reversed_compare_failure due to the conditional assignment: _test_script_regex ?= \ so it removed the check. Also remove the leftover assignment of test-lib.sh

[libvirt PATCH 3/5] syntax-check: replace vc-list-files

2021-08-19 Thread Ján Tomko
Directly invoke git ls-tree instead of the wrapper file which also: * checks for other versioning systems * prepends the source directory to all output lines Since there is no srcdir prefix in the output anymore, also drop the extra 'sed' invocation that removes it. Signed-off-by: Ján Tomko ---

[libvirt PATCH 0/5] Waste less CPU on syntax-check

2021-08-19 Thread Ján Tomko
Use 'git ls-tree' directly instead of a wrapper script that can possibly handle all the other versioning systems we do not use. Instead of adding, removing, then re-adding the absolute path prefix, only add it once per every syntax check rule. Delete the useless-if-before-free check since we've b

[libvirt PATCH 1/5] syntax-check: assume we're using git

2021-08-19 Thread Ján Tomko
Meson already checks whether we're using git before running syntax check. This only affects direct invocation through make. Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-

[PATCH] fix error in printf format string

2021-08-19 Thread Zhenyu Ye
Use %s to print NULLSTR(duri). Reported-by: Peng Liang Signed-off-by: Zhenyu Ye --- src/libvirt-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 4eb14d4176..3c4204e563 100644 --- a/src/libvirt-domain.c +++ b/src/libvi

Re: [PATCH v2 1/3] test_driver: Implement virDomainGetBlkioParameters

2021-08-19 Thread Martin Kletzander
On Thu, Aug 19, 2021 at 06:04:29PM +0800, Luke Yue wrote: Signed-off-by: Luke Yue Reviewed-by: Martin Kletzander --- src/test/test_driver.c | 47 ++ 1 file changed, 47 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b0

Re: [PATCH v2 2/3] test_driver: Implement virDomainSetBlkioParameters

2021-08-19 Thread Martin Kletzander
On Thu, Aug 19, 2021 at 06:04:30PM +0800, Luke Yue wrote: Signed-off-by: Luke Yue --- src/test/meson.build | 1 + src/test/test_driver.c | 49 ++ 2 files changed, 50 insertions(+) diff --git a/src/test/meson.build b/src/test/meson.build index f54585adfd.

Re: [PATCH v2 3/3] tests: Test BlkioParameters related functions for test driver

2021-08-19 Thread Martin Kletzander
On Thu, Aug 19, 2021 at 06:04:31PM +0800, Luke Yue wrote: Signed-off-by: Luke Yue --- examples/xml/test/testdomfv0.xml | 11 ++ examples/xml/test/testnodeinline.xml | 11 ++ tests/virshtest.c| 55 3 files changed, 77 insertions(+) diff -

[PATCH v2 4/4] tests: add xml2xml tests to exercize pm acpi hotplug options for i386

2021-08-19 Thread Ani Sinha
This change adds xml2xml unit tests for the following change: 78ced83e3bb354 ("pm/i386: add support for two options that controls acpi hotplug on q35/i440fx") This unit test ensures that libvirt generates the correct output xml with proper pm acpi hotplug options for a given input xml. Signed-of

[PATCH v2 3/4] tests: add negative xml2argv tests to exercize pm acpi hotplug options for i386

2021-08-19 Thread Ani Sinha
This change adds negative argv2xml unit tests for the following change: 78ced83e3bb354 ("pm/i386: add support for two options that controls acpi hotplug on q35/i440fx") These tests ensure that libvirt produces the correct error when the qemu capabilities required from an input xml are absent. Si

[PATCH v2 2/4] tests: add positive xml2argv tests to exercize pm acpi hotplug options for i386

2021-08-19 Thread Ani Sinha
This change adds positive xml2argv unit tests for the following change: 78ced83e3bb354 ("pm/i386: add support for two options that controls acpi hotplug on q35/i440fx") These tests ensure that libvirt generates the correct qemu commandline for a given input xml. Signed-off-by: Ani Sinha --- ..

[PATCH v2 0/4] Add support for two i386 pm options which control acpi hotplug

2021-08-19 Thread Ani Sinha
Hi: I added some negative xml2argv tests as well as new xml2xml tests. In the process, I also fixed a bug where I had not added appropriate code to generate the output xml correctly. The patch series is sent again as v2. Kindly, please provide inputs and review them. [PATCH v2 1/4] pm/i386: add

[PATCH v2 1/4] pm/i386: add support for two options that controls acpi hotplug on q35/i440fx

2021-08-19 Thread Ani Sinha
'acpi-pci-hotplug-with-bridge-support' and 'acpi-root-pci-hotplug' are two pm options for i386 that governs acpi pci hotplug support for qemu. This patch tries to implement support for both these two global i386 pm options within libvirt. 'acpi-pci-hotplug-with-bridge-support' applies both for q3

[PATCH v2 1/3] test_driver: Implement virDomainGetBlkioParameters

2021-08-19 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 47 ++ 1 file changed, 47 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b096d49ac6..23176000b6 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3290

[PATCH v2 3/3] tests: Test BlkioParameters related functions for test driver

2021-08-19 Thread Luke Yue
Signed-off-by: Luke Yue --- examples/xml/test/testdomfv0.xml | 11 ++ examples/xml/test/testnodeinline.xml | 11 ++ tests/virshtest.c| 55 3 files changed, 77 insertions(+) diff --git a/examples/xml/test/testdomfv0.xml b/examples/xml/t

[PATCH v2 2/3] test_driver: Implement virDomainSetBlkioParameters

2021-08-19 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/meson.build | 1 + src/test/test_driver.c | 49 ++ 2 files changed, 50 insertions(+) diff --git a/src/test/meson.build b/src/test/meson.build index f54585adfd..c0174ad856 100644 --- a/src/test/meson.build +++ b/src/t

[PATCH v2 0/3] Implement some blkio related APIs for test driver

2021-08-19 Thread Luke Yue
v2: - Rebase to current master branch - Refine the tests Luke Yue (3): test_driver: Implement virDomainGetBlkioParameters test_driver: Implement virDomainSetBlkioParameters tests: Test BlkioParameters related functions for test driver examples/xml/test/testdomfv0.xml | 11 example

Re: [PATCH] qemu: Label vhostuser net device

2021-08-19 Thread Michael S. Tsirkin
On Wed, Aug 18, 2021 at 09:00:52AM -0400, Laine Stump wrote: > On 8/18/21 4:21 AM, Michal Prívozník wrote: > > On 8/18/21 12:31 AM, Jim Fehlig wrote: > > > On 8/17/21 12:11 PM, Jim Fehlig wrote: > > > > On 8/17/21 4:13 AM, Michal Prívozník wrote: > > > > > On 8/13/21 11:36 PM, Jim Fehlig wrote: > >

Re: [PATCH] tests: Add missing test cases to vmx2xmltest

2021-08-19 Thread Ján Tomko
On a Thursday in 2021, Martin Kletzander wrote: Commit 42b2f35d36a9e was meant to test all four combinations of serial-pipe-{server,client}-{app,vm} files, but did only add the files and by mistake duplicated the tests. Those were later removed as duplicates, so add them back in. Signed-off-by:

[PATCH] tests: Add missing test cases to vmx2xmltest

2021-08-19 Thread Martin Kletzander
Commit 42b2f35d36a9e was meant to test all four combinations of serial-pipe-{server,client}-{app,vm} files, but did only add the files and by mistake duplicated the tests. Those were later removed as duplicates, so add them back in. Signed-off-by: Martin Kletzander --- This is based on top of th

Re: [PATCH 0/6] qemu: Fixes and capability update for 6.1 release

2021-08-19 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: full version is at: git fetch https://gitlab.com/pipo.sk/libvirt.git qemu-caps-bump Posting this one early since it's updating tests to prevent spurious changes and improve testing of host-model cpus. Peter Krempa (6): qemuxml2argvdata: Don't use '

Re: [PATCH 0/3] vmx: Drop useless prefix for test cases

2021-08-19 Thread Martin Kletzander
On Wed, Aug 18, 2021 at 03:51:09PM +0200, Michal Privoznik wrote: You can find these also here: https://gitlab.com/MichalPrivoznik/libvirt/-/tree/vmx_floppy Michal Prívozník (3): vmx2xmltest: Drop duplicate testcases vmx2xmltest: Deduplicate DO_TEST*() arguments tests: Drop vmx2xml- prefix f

Re: [PATCH 0/3] vmx: Drop useless prefix for test cases

2021-08-19 Thread Ján Tomko
On a Wednesday in 2021, Michal Privoznik wrote: You can find these also here: https://gitlab.com/MichalPrivoznik/libvirt/-/tree/vmx_floppy Michal Prívozník (3): vmx2xmltest: Drop duplicate testcases vmx2xmltest: Deduplicate DO_TEST*() arguments tests: Drop vmx2xml- prefix for vmx2xml test ca

Re: [PATCH 1/3] vmx2xmltest: Drop duplicate testcases

2021-08-19 Thread Martin Kletzander
On Wed, Aug 18, 2021 at 03:51:10PM +0200, Michal Privoznik wrote: There are three test cases are called twice. This is needless. Drop redundant calls. Signed-off-by: Michal Privoznik --- tests/vmx2xmltest.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xml