Re: [PATCH v5 0/8] Implement detach device related APIs for test driver

2022-03-02 Thread Luke Yue
On Mon, 2022-02-07 at 15:38 +0800, Luke Yue wrote: > diff to v4: > - Rebase to current master > > diff to v3: > - Add virDomainDeviceDefOperationsCallbacks to xmlopt for de- > duplicating purpose > - Add virDomainDeviceTypeFlags for de-duplicating purpose > - Remove the me

[PATCH v5 8/8] tests: Add generichotplugtest

2022-02-06 Thread Luke Yue
For testing hypervisor independent device detach / attach / update functions, currently only detaching included. Signed-off-by: Luke Yue --- The test would show error messages with expected to fail tests even with VIR_TEST_DEBUG=0, really don't know what I missed to make it quiet :( I would

[PATCH v5 5/8] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2022-02-06 Thread Luke Yue
-by: Luke Yue --- Compare to the v3, I remove the random comments, and align the error messages, also add virDomainDetachChrDeviceConfig by using xmlopt. Then I got a lot of choices here: 1. Just cleanup these functions and using them in drivers, just like what I did in the previous patch. 2. Add

[PATCH v5 6/8] test_driver: Implement virDomainDetachDeviceFlags

2022-02-06 Thread Luke Yue
virDomainDetachDeviceAlias and virDomainDetachDevice. Signed-off-by: Luke Yue --- src/test/test_driver.c | 149 + 1 file changed, 149 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2380c37ddb..65ab412b36 100644 --- a/src/test

[PATCH v5 1/8] conf: Introduce virDomainInputDefRemove and fix memory leak

2022-02-06 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 12 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH v5 3/8] conf: Add virDomainDeviceTypeFlags and use it in various drivers

2022-02-06 Thread Luke Yue
. Signed-off-by: Luke Yue --- src/conf/domain_conf.h | 31 ++ src/libxl/libxl_conf.c | 3 ++- src/libxl/libxl_domain.c | 8 +++ src/libxl/libxl_domain.h | 1 + src/lxc/lxc_conf.c | 3 ++- src/lxc/lxc_domain.c | 7 ++ src/lxc/lxc_domain.h | 1 + src

[PATCH v5 7/8] examples: xml: test: add xml for testing devices related APIs

2022-02-06 Thread Luke Yue
Also add some device xml to generichotplugdata for testing purpose, and add the forgotten testdomfc5.xml to meson.build. Signed-off-by: Luke Yue --- examples/xml/test/meson.build | 1 + examples/xml/test/testdomfc5.xml | 54 +++ examples/xml/test

[PATCH v5 4/8] conf: Add tpm helpers for future use

2022-02-06 Thread Luke Yue
Signed-off-by: Luke Yue --- As persistent_state and is bool type and its default value is false, so I guess it's fine that it's not explicitly assigned with false. link to context: https://listman.redhat.com/archives/libvir-list/2021-November/msg00874.html --- src/conf/domain_conf.c | 67

[PATCH v5 2/8] conf: Introduce virDomainDeviceDefOperationsCallbacks to xmlopt

2022-02-06 Thread Luke Yue
). This would be useful when de-duplicate related functions. Signed-off-by: Luke Yue --- I am not pretty sure whether these functions could be put into virDomainXMLPrivateDataCallbacks or not, so I just create a new one to store them. --- src/bhyve/bhyve_domain.c | 2 +- src/ch/ch_conf.c

[PATCH v5 0/8] Implement detach device related APIs for test driver

2022-02-06 Thread Luke Yue
Luke Yue (8): conf: Introduce virDomainInputDefRemove and fix memory leak conf: Introduce virDomainDeviceDefOperationsCallbacks to xmlopt conf: Add virDomainDeviceTypeFlags and use it in various drivers conf: Add tpm helpers for future use domain_driver: extract DetachXXXDeviceConfig related

[PATCH v2 4/4] tests: Add test for virDomainGetSecurityLabelList

2021-12-03 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/virshtest.c b/tests/virshtest.c index 012edb8601..fc7caf6bc3 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -22,7 +22,8 @@ main(void) # define

[PATCH v2 2/4] virsh: Add '--full-seclabels' option for dominfo

2021-12-03 Thread Luke Yue
There is no virsh command uses virDomainGetSecurityLabelList API, so add an option for dominfo to call it and print full list of security labels. Signed-off-by: Luke Yue --- docs/manpages/virsh.rst | 5 +++-- tools/virsh-domain-monitor.c | 43 +++- 2 files

[PATCH v2 3/4] virsh: Realign some outputs

2021-12-03 Thread Luke Yue
As it's now "Security labels:" instead of "Security label:". Signed-off-by: Luke Yue --- tests/virsh-undefine | 8 ++--- tests/virshtest.c| 70 ++-- tools/virsh-domain-monitor.c | 42 +++--- 3 files ch

[PATCH v2 1/4] test_driver: Implement virDomainGetSecurityLabelList

2021-12-03 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 43 ++ 1 file changed, 43 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b6bca884f0..e9d009cfdb 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[PATCH v2 0/4] Add an option to use virDomainGetSecurityLabelList and test it

2021-12-03 Thread Luke Yue
Luke Yue (4): test_driver: Implement virDomainGetSecurityLabelList virsh: Add '--full-seclabels' option for dominfo virsh: Realign some outputs tests: Add test for virDomainGetSecurityLabelList docs/manpages/virsh.rst | 5 ++- src/test/test_driver.c | 43

[PATCH v4 0/8] Implement detach device related APIs for test driver

2021-12-03 Thread Luke Yue
with internal APIs link to v3: https://listman.redhat.com/archives/libvir-list/2021-November/msg00288.html link to CI: https://gitlab.com/lukedyue/libvirt/-/pipelines/421921587 Luke Yue (8): conf: Introduce virDomainInputDefRemove and fix memory leak conf: Introduce virDomainDeviceDefOperationsCallbacks

[PATCH v4 7/8] examples: xml: test: add xml for testing devices related APIs

2021-12-03 Thread Luke Yue
Also add some device xml to generichotplugdata for testing purpose, and add the forgotten testdomfc5.xml to meson.build. Signed-off-by: Luke Yue --- examples/xml/test/meson.build | 1 + examples/xml/test/testdomfc5.xml | 54 +++ examples/xml/test

[PATCH v4 2/8] conf: Introduce virDomainDeviceDefOperationsCallbacks to xmlopt

2021-12-03 Thread Luke Yue
). This would be useful when de-duplicate related functions. Signed-off-by: Luke Yue --- I am not pretty sure whether these functions could be put into virDomainXMLPrivateDataCallbacks or not, so I just create a new one to store them. --- src/bhyve/bhyve_domain.c | 2 +- src/ch/ch_conf.c

[PATCH v4 8/8] tests: Add generichotplugtest

2021-12-03 Thread Luke Yue
For testing hypervisor independent device detach / attach / update functions, currently only detaching included. Signed-off-by: Luke Yue --- The test would show error messages with expected to fail tests even with VIR_TEST_DEBUG=0, really don't know what I missed to make it quiet :( I would

[PATCH v4 6/8] test_driver: Implement virDomainDetachDeviceFlags

2021-12-03 Thread Luke Yue
virDomainDetachDeviceAlias and virDomainDetachDevice. Signed-off-by: Luke Yue --- src/test/test_driver.c | 149 + 1 file changed, 149 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 21caa83be7..6cd1e75771 100644 --- a/src/test

[PATCH v4 5/8] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-12-03 Thread Luke Yue
-by: Luke Yue --- Compare to the previous version, I remove the random comments, and align the error messages, also add virDomainDetachChrDeviceConfig by using xmlopt. Then I got a lot of choices here: 1. Just cleanup these functions and using them in drivers, just like what I did in the previous patch

[PATCH v4 4/8] conf: Add tpm helpers for future use

2021-12-03 Thread Luke Yue
Signed-off-by: Luke Yue --- As persistent_state and is bool type and its default value is false, so I guess it's fine that it's not explicitly assigned with false on default. --- src/conf/domain_conf.c | 67 src/conf/domain_conf.h | 6 src

[PATCH v4 1/8] conf: Introduce virDomainInputDefRemove and fix memory leak

2021-12-03 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 12 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH v4 3/8] conf: Add virDomainDeviceTypeFlags and use it in various drivers

2021-12-03 Thread Luke Yue
. Signed-off-by: Luke Yue --- src/conf/domain_conf.h | 31 ++ src/libxl/libxl_conf.c | 3 ++- src/libxl/libxl_domain.c | 8 +++ src/libxl/libxl_domain.h | 1 + src/lxc/lxc_conf.c | 3 ++- src/lxc/lxc_domain.c | 7 ++ src/lxc/lxc_domain.h | 1 + src

Re: [PATCH 2/3] virsh: Add '--full-seclabels' option for dominfo

2021-11-30 Thread Luke Yue
On Mon, 2021-11-29 at 17:52 +0100, Martin Kletzander wrote: > On Thu, Sep 02, 2021 at 08:29:35PM +0800, Luke Yue wrote: > > There is no virsh command uses virDomainGetSecurityLabelList API, > > so add > > an option for dominfo to call it and print full list of security >

Re: [PATCH v3 12/12] tests: Test detach-device and detach-device-alias for test driver

2021-11-29 Thread Luke Yue
On Mon, 2021-11-29 at 15:50 +0100, Martin Kletzander wrote: > On Mon, Nov 29, 2021 at 10:41:51PM +0800, Luke Yue wrote: > > On Fri, 2021-11-26 at 16:44 +0100, Martin Kletzander wrote: > > > On Wed, Nov 10, 2021 at 10:24:31PM +0800, Luke Yue wrote: > > >

Re: [PATCH v3 02/12] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-11-29 Thread Luke Yue
On Mon, 2021-11-29 at 15:33 +0100, Martin Kletzander wrote: > On Mon, Nov 29, 2021 at 09:06:57PM +0800, Luke Yue wrote: > > On Fri, 2021-11-26 at 16:43 +0100, Martin Kletzander wrote: > > > On Wed, Nov 10, 2021 at 10:24:21PM +0800, Luke Yue wrote: > > > > libxl /

Re: [PATCH v3 12/12] tests: Test detach-device and detach-device-alias for test driver

2021-11-29 Thread Luke Yue
On Fri, 2021-11-26 at 16:44 +0100, Martin Kletzander wrote: > On Wed, Nov 10, 2021 at 10:24:31PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > tests/virshtest.c | 96 > > +++ > > 1 file changed, 96 i

Re: [PATCH v3 08/12] conf: Add a memballoon helper for future use

2021-11-29 Thread Luke Yue
On Fri, 2021-11-26 at 16:44 +0100, Martin Kletzander wrote: > On Wed, Nov 10, 2021 at 10:24:27PM +0800, Luke Yue wrote: > > Currently it will only be used in test driver. > > > > Signed-off-by: Luke Yue > > --- > > src/conf/domain_conf.c   | 24 ++

Re: [PATCH v3 06/12] conf: Add tpm helpers for future use

2021-11-29 Thread Luke Yue
On Fri, 2021-11-26 at 16:43 +0100, Martin Kletzander wrote: > On Wed, Nov 10, 2021 at 10:24:25PM +0800, Luke Yue wrote: > > Currently it will only be used in the test driver. > > > > Signed-off-by: Luke Yue > > --- > &

Re: [PATCH v3 03/12] test_driver: Implement virDomainDetachDeviceFlags

2021-11-29 Thread Luke Yue
On Fri, 2021-11-26 at 16:43 +0100, Martin Kletzander wrote: > On Wed, Nov 10, 2021 at 10:24:22PM +0800, Luke Yue wrote: > > Introduce testDomainChgDevice for further development (just like > > what we > > did for IOThread). And introduce > > testDomainDetachDeviceLive

Re: [PATCH v3 02/12] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-11-29 Thread Luke Yue
On Fri, 2021-11-26 at 16:43 +0100, Martin Kletzander wrote: > On Wed, Nov 10, 2021 at 10:24:21PM +0800, Luke Yue wrote: > > libxl / lxc / qemu drivers share some common codes in their > > DomainDetachDeviceConfig functions, so extract them to > > domain_driver and > > re

[PATCH v3 12/12] tests: Test detach-device and detach-device-alias for test driver

2021-11-10 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 96 +++ 1 file changed, 96 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index af2a70f5fb..8e5b397420 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -160,6 +160,8 @@ static

[PATCH v3 10/12] examples: xml: test: add xml for testing devices related APIs

2021-11-10 Thread Luke Yue
Signed-off-by: Luke Yue --- examples/xml/test/testdevcontroller.xml | 1 + examples/xml/test/testdevdiskcdrom.xml | 5 +++ examples/xml/test/testdevfs.xml | 6 +++ examples/xml/test/testdevhostdev.xml| 5 +++ examples/xml/test/testdevif.xml | 6 +++ examples/xml/test

[PATCH v3 09/12] test_driver: add memballoon support for testDomainDetachDeviceLiveAndConfig

2021-11-10 Thread Luke Yue
As the memballoon device shouldn't be hot-(un)pluggable, so error if try to remove it on a running domain, for removing from config, it's fine. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms

[PATCH v3 06/12] conf: Add tpm helpers for future use

2021-11-10 Thread Luke Yue
Currently it will only be used in the test driver. Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 67 src/conf/domain_conf.h | 6 src/libvirt_private.syms | 2 ++ 3 files changed, 75 insertions(+) diff --git a/src/conf/domain_conf.c b

[PATCH v3 07/12] test_driver: add TPM support for testDomainDetachDeviceLiveAndConfig

2021-11-10 Thread Luke Yue
Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms | 1 + src/test/test_driver.c | 7 ++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/hypervisor

[PATCH v3 04/12] test_driver: Implement virDomainDetachDeviceAlias

2021-11-10 Thread Luke Yue
As we already implement testDomainChgDevice for both DetachDeviceFlags and DetachDeviceAlias, so it's simple to implement this API by changing the parameter. Signed-off-by: Luke Yue --- src/test/test_driver.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/test/test_driver.c

[PATCH v3 11/12] virshtest: add expectError parameter to testCompareOutputLit

2021-11-10 Thread Luke Yue
Add expectError so that we can make some test fail on purpose and compare the error message. The problem is that the test would pass, but the failed test would raise an internal error, with VIR_TEST_DEBUG=1, the error message would still be printed. Signed-off-by: Luke Yue --- tests

[PATCH v3 08/12] conf: Add a memballoon helper for future use

2021-11-10 Thread Luke Yue
Currently it will only be used in test driver. Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 24 src/conf/domain_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

[PATCH v3 05/12] test_driver: Implement virDomainDetachDevice

2021-11-10 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 9843340fec..b1ca6a7b97 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -10261,6 +10261,14

[PATCH v3 02/12] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-11-10 Thread Luke Yue
libxl / lxc / qemu drivers share some common codes in their DomainDetachDeviceConfig functions, so extract them to domain_driver and reuse them. At the same time, this will enable test driver to test these functions with virshtest in the future. Signed-off-by: Luke Yue --- Not pretty sure

[PATCH v3 03/12] test_driver: Implement virDomainDetachDeviceFlags

2021-11-10 Thread Luke Yue
Introduce testDomainChgDevice for further development (just like what we did for IOThread). And introduce testDomainDetachDeviceLiveAndConfig for detaching devices. Signed-off-by: Luke Yue --- src/test/test_driver.c | 202 + 1 file changed, 202 insertions

[PATCH v3 01/12] conf: Introduce virDomainInputDefRemove and fix memory leak

2021-11-10 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 12 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH v3 00/12] Implement detach device related APIs for test driver

2021-11-10 Thread Luke Yue
v3: - Rebase to current master branch - Split some tests to different functions in PATCH 12/12 and add some tests link to v2: https://listman.redhat.com/archives/libvir-list/2021-August/msg00637.html link to CI: https://gitlab.com/lukedyue/libvirt/-/pipelines/405150749 Luke Yue (12): conf

[PATCH v4 10/11] test_driver: Introduce testDomainGetStatsIOThread

2021-09-15 Thread Luke Yue
Introduce testDomainGetStatsIOThread to add support for testConnectGetAllDomainStats to get IOThread infos. Signed-off-by: Luke Yue --- src/test/test_driver.c | 44 +- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/test_driver.c b

[PATCH v4 11/11] tests: Test IOThread related functions for test driver

2021-09-15 Thread Luke Yue
-by: Luke Yue --- tests/virshtest.c | 110 ++ 1 file changed, 110 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 87da1f5889..c2c892c60d 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -32,6 +32,7 @@ main(void

[PATCH v4 05/11] domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()

2021-09-15 Thread Luke Yue
driver or some special situation. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 68 ++ src/hypervisor/domain_driver.h | 4 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 53 +- 4 files changed, 74

[PATCH v4 00/11] Implement IOThreads related APIs for test driver

2021-09-15 Thread Luke Yue
v4: - Rebase to current master branch - Add the forgotten virObjectUnlock(vm) in PATCH 09/11 - Refine tests CI link: https://gitlab.com/lukedyue/libvirt/-/pipelines/371315349 Luke Yue (11): domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck() test_driver: Introduce

[PATCH v4 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-09-15 Thread Luke Yue
Implement virConnectGetAllDomainStats in a modular way just like QEMU driver, though remove some params in GetStatsWorker that we don't need in test driver currently. Only add the worker to get state so far, more worker will be added in the future. Signed-off-by: Luke Yue --- src/test

[PATCH v4 07/11] test_driver: Implement virDomainPinIOThread

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0971661c89..43c0822c87 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[PATCH v4 08/11] test_driver: Implement testDomainSetIOThreadParams

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 43c0822c87..7cff26776a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[PATCH v4 06/11] test_driver: Implement virDomainGetIOThreadInfo

2021-09-15 Thread Luke Yue
() as bitmap_size instead. Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b588bbc32e..0971661c89 100644 --- a/src/test/test_driver.c +++ b/src/test

[PATCH v4 04/11] test_driver: Implement virDomainDelIOThread

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index e0b7ace4ed..b588bbc32e 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[PATCH v4 03/11] test_driver: Implement virDomainAddIOThread

2021-09-15 Thread Luke Yue
Introduce testDomainChgIOThread at the same time, could be used for virDomainDelIOThread etc. Signed-off-by: Luke Yue --- src/test/test_driver.c | 76 ++ 1 file changed, 76 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index

[PATCH v4 01/11] domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()

2021-09-15 Thread Luke Yue
The test driver can share the same code with qemu driver when implement testDomainAddIOThreadCheck and testDomainDelIOThreadCheck, so extract them for test driver to use. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 64 ++ src/hypervisor

[PATCH v4 02/11] test_driver: Introduce testIOThreadInfo and generate IOThread infos

2021-09-15 Thread Luke Yue
testDomainGenerateIOThreadInfos, the values are taken from QEMU. Signed-off-by: Luke Yue --- examples/xml/test/testdomfc4.xml | 5 + src/test/test_driver.c | 37 2 files changed, 42 insertions(+) diff --git a/examples/xml/test/testdomfc4.xml b/examples/xml

Re: [PATCH v3 0/5] Implement some job related APIs for test driver

2021-09-02 Thread Luke Yue
On Wed, 2021-08-18 at 22:17 +0800, Luke Yue wrote: > v3: > - Fix virDomainGetJobStats when use completed flags > - Introduce testDomainSetDummyData > - Add and refine some tests > > Luke Yue (5): >   test_driver: Implement virDomainGetJobInfo >   test_driver: Implem

[PATCH 0/3] Add an option to use virDomainGetSecurityLabelList and test it

2021-09-02 Thread Luke Yue
Luke Yue (3): test_driver: Implement virDomainGetSecurityLabelList virsh: Add '--full-seclabels' option for dominfo tests: Add test for virDomainGetSecurityLabelList docs/manpages/virsh.rst | 5 +- src/test/test_driver.c | 42 + tests/virsh-undefine | 8

[PATCH 2/3] virsh: Add '--full-seclabels' option for dominfo

2021-09-02 Thread Luke Yue
There is no virsh command uses virDomainGetSecurityLabelList API, so add an option for dominfo to call it and print full list of security labels. Also realign some outputs as it's now "Security labels:" instead of "Security label:". Signed-off-by: Luke Yue --- docs/manpages

[PATCH 3/3] tests: Add test for virDomainGetSecurityLabelList

2021-09-02 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/virshtest.c b/tests/virshtest.c index 0d703f3765..4fb4799456 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -69,6 +69,7 @@ Managed save:no\n\ Security model

[PATCH 1/3] test_driver: Implement virDomainGetSecurityLabelList

2021-09-02 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2f19b7c520..1b5914c890 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

[PATCH v2 04/12] test_driver: Implement virDomainDetachDeviceAlias

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5e4d6d37ef..6cabf78e7c 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9737,6 +9737,16

[PATCH v2 01/12] conf: Introduce virDomainInputDefRemove and fix memory leak

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 12 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH v2 09/12] test_driver: add memballoon support for testDomainDetachDeviceLiveAndConfig

2021-08-20 Thread Luke Yue
As the memballoon device shouldn't be hot-(un)pluggable, so error if try to remove it on a running domain, for removing from config, it's fine. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms

[PATCH v2 08/12] conf: Add a memballoon helper for future use

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 24 src/conf/domain_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7f3d207a3e..62bb6669e8 100644 --- a/src

[PATCH v2 03/12] test_driver: Implement virDomainDetachDeviceFlags

2021-08-20 Thread Luke Yue
Introduce testDomainChgDevice for further development (just like what we did for IOThread). And introduce testDomainDetachDeviceLiveAndConfig for detaching devices. Signed-off-by: Luke Yue --- src/test/test_driver.c | 201 + 1 file changed, 201 insertions

[PATCH v2 00/12] Implement detach device related APIs for test driver

2021-08-20 Thread Luke Yue
s - Refine tests Luke Yue (12): conf: Introduce virDomainInputDefRemove and fix memory leak domain_driver: extract DetachXXXDeviceConfig related functions and use them test_driver: Implement virDomainDetachDeviceFlags test_driver: Implement virDomainDetachDeviceAlias test_driver:

[PATCH v2 11/12] virshtest: add expectError parameter to testCompareOutputLit

2021-08-20 Thread Luke Yue
-by: Luke Yue --- tests/virshtest.c | 53 ++- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tests/virshtest.c b/tests/virshtest.c index 87da1f5889..0d2ffd960a 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -109,7 +109,7

[PATCH v2 12/12] tests: Test detach-device and detach-device-alias for test driver

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 0d2ffd960a..c37d24e900 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -159,6 +159,8 @@ static

[PATCH v2 10/12] examples: xml: test: add xml for testing devices related APIs

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- examples/xml/test/testdevcontroller.xml | 1 + examples/xml/test/testdevdiskcdrom.xml | 5 +++ examples/xml/test/testdevfs.xml | 6 +++ examples/xml/test/testdevhostdev.xml| 5 +++ examples/xml/test/testdevif.xml | 6 +++ examples/xml/test

[PATCH v2 07/12] test_driver: add TPM support for testDomainDetachDeviceLiveAndConfig

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms | 1 + src/test/test_driver.c | 7 ++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/hypervisor

[PATCH v2 06/12] conf: Add tpm helpers for future use

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 67 src/conf/domain_conf.h | 6 src/libvirt_private.syms | 2 ++ 3 files changed, 75 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6667426b9a..7f3d207a3e

[PATCH v2 05/12] test_driver: Implement virDomainDetachDevice

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6cabf78e7c..c6aead09c9 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9747,6 +9747,14

[PATCH v2 02/12] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-08-20 Thread Luke Yue
libxl / lxc / qemu drivers share some common codes in their DomainDetachDeviceConfig functions, so extract them to domain_driver and reuse them. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 267 + src/hypervisor/domain_driver.h | 41 + src

[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

[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

[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

[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

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

2021-08-18 Thread Luke Yue
On Wed, 2021-08-18 at 14:37 +0200, Martin Kletzander wrote: > On Tue, Jul 13, 2021 at 01:42:14PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > examples/xml/test/testdomfv0.xml | 11 + > > examples/xml/test/testnodeinline.xml | 11

[PATCH v3 3/5] test_driver: Implement virDomainAbortJob

2021-08-18 Thread Luke Yue
As we are using jobState to store dummy job type, so just change it to VIR_DOMAIN_JOB_CANCELLED when try to abort a job. Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test

[PATCH v3 0/5] Implement some job related APIs for test driver

2021-08-18 Thread Luke Yue
v3: - Fix virDomainGetJobStats when use completed flags - Introduce testDomainSetDummyData - Add and refine some tests Luke Yue (5): test_driver: Implement virDomainGetJobInfo test_driver: Implement virDomainGetJobStats test_driver: Implement virDomainAbortJob test_driver: Introduce

[PATCH v3 2/5] test_driver: Implement virDomainGetJobStats

2021-08-18 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 135 +++-- 1 file changed, 131 insertions(+), 4 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index ae6422c955..9899976966 100644 --- a/src/test/test_driver.c +++ b/src/test

[PATCH v3 5/5] virshtest: add test for domjobinfo and domjobabort

2021-08-18 Thread Luke Yue
e completed job info should be deleted, so should get none next time. In testCompareDomJobAbortByName, domjobabort should set type to cancelled and preserve the operation. Signed-off-by: Luke Yue --- tests/virshtest.c | 89 +++ 1 file changed, 89 inser

[PATCH v3 4/5] test_driver: Introduce testDomainSetDummyData

2021-08-18 Thread Luke Yue
being changed, in order to test virDomainGetJobInfo and virDomainGetJobStats (domjobinfo in virsh). Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 3535

[PATCH v3 1/5] test_driver: Implement virDomainGetJobInfo

2021-08-18 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 89 ++ 1 file changed, 89 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b096d49ac6..ae6422c955 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c

Re: [PATCH 5/5] tests: Test detach-device and detach-device-alias for test driver

2021-08-17 Thread Luke Yue
On Tue, 2021-08-17 at 14:22 +0200, Martin Kletzander wrote: > On Mon, Aug 16, 2021 at 07:19:49PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > tests/virshtest.c | 24 > > 1 file changed, 24 insertions(+) > > > >

Re: [PATCH 4/5] examples: xml: test: add xml for testing devices related APIs

2021-08-17 Thread Luke Yue
On Tue, 2021-08-17 at 14:18 +0200, Martin Kletzander wrote: > On Mon, Aug 16, 2021 at 07:19:48PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > examples/xml/test/testdevcontroller.xml |  1 + > > examples/xml/test/testdevdiskcdrom.xml  |  5 +++ > >

Re: [PATCH 1/5] test_driver: Implement virDomainDetachDeviceFlags

2021-08-17 Thread Luke Yue
On Tue, 2021-08-17 at 14:13 +0200, Martin Kletzander wrote: > On Mon, Aug 16, 2021 at 07:19:45PM +0800, Luke Yue wrote: > > Introduce testDomainChgDevice for further development (just like > > what we > > did for IOThread). And introduce > > testDomainDetachDeviceLive

Re: [PATCH v2 4/4] virshtest: add test for domjobinfo

2021-08-17 Thread Luke Yue
On Tue, 2021-08-17 at 13:52 +0200, Martin Kletzander wrote: > On Mon, Aug 16, 2021 at 07:13:37PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > tests/virshtest.c | 11 +++ > > 1 file changed, 11 insertions(+) > > > > diff --git

Re: [PATCH v2 2/4] test_driver: Implement virDomainGetJobStats

2021-08-17 Thread Luke Yue
On Tue, 2021-08-17 at 13:48 +0200, Martin Kletzander wrote: > On Mon, Aug 16, 2021 at 07:13:35PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > src/test/test_driver.c | 105 > > + > > 1 file changed, 105

[PATCH 5/5] tests: Test detach-device and detach-device-alias for test driver

2021-08-16 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 24 1 file changed, 24 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 53db2aa19a..273596d636 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -291,6 +291,22 @@ static int

[PATCH 4/5] examples: xml: test: add xml for testing devices related APIs

2021-08-16 Thread Luke Yue
Signed-off-by: Luke Yue --- examples/xml/test/testdevcontroller.xml | 1 + examples/xml/test/testdevdiskcdrom.xml | 5 +++ examples/xml/test/testdevfs.xml | 6 examples/xml/test/testdevhostdev.xml| 5 +++ examples/xml/test/testdevif.xml | 6 examples/xml/test

[PATCH 3/5] test_driver: Implement virDomainDetachDevice

2021-08-16 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index e2463876fa..21e813db8f 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9731,6 +9731,14

[PATCH 1/5] test_driver: Implement virDomainDetachDeviceFlags

2021-08-16 Thread Luke Yue
Introduce testDomainChgDevice for further development (just like what we did for IOThread). And introduce testDomainDetachDeviceLiveAndConfig for detaching devices. Signed-off-by: Luke Yue --- src/test/test_driver.c | 270 + 1 file changed, 270 insertions

[PATCH 0/5] Implement detach device related APIs for test driver

2021-08-16 Thread Luke Yue
Luke Yue (5): test_driver: Implement virDomainDetachDeviceFlags test_driver: Implement virDomainDetachDeviceAlias test_driver: Implement virDomainDetachDevice examples: xml: test: add xml for testing devices related APIs tests: Test detach-device and detach-device-alias for test driver

[PATCH 2/5] test_driver: Implement virDomainDetachDeviceAlias

2021-08-16 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2ebdbaa604..e2463876fa 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9721,6 +9721,16

[PATCH v2 3/4] test_driver: Implement virDomainAbortJob

2021-08-16 Thread Luke Yue
As we are using jobState to store dummy job type, so just change it to VIR_DOMAIN_JOB_CANCELLED when try to abort a job. Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test

[PATCH v2 4/4] virshtest: add test for domjobinfo

2021-08-16 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 53db2aa19a..0c46496c74 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -291,6 +291,13 @@ static int testCompareDomControlInfoByName

[PATCH v2 1/4] test_driver: Implement virDomainGetJobInfo

2021-08-16 Thread Luke Yue
off-by: Luke Yue --- src/test/test_driver.c | 89 ++ 1 file changed, 89 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 00cc13511a..9306f0e104 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -380,6 +380

  1   2   >