[PATCH v2 0/4] virsh: refactor unnecessary variables and else branch
by Kristina Hanicova
This is partially v2 of:
https://listman.redhat.com/archives/libvir-list/2021-September/msg00731.html
Diff to v1:
* split changes into smaller patches
Kristina Hanicova (4):
virsh: remove variable 'ret' and use early return if possible
virsh: remove variable 'ret' in cmdVersion()
virsh: remove variable 'ret' and 'inactive'
virsh: util: remove 'else' branch after return
tools/virsh-host.c | 25 +++++-----------
tools/virsh-interface.c | 65 ++++++++++++++++++-----------------------
tools/virsh-network.c | 47 +++++++++++++----------------
tools/virsh-nodedev.c | 32 ++++++++------------
tools/virsh-nwfilter.c | 15 +++++-----
tools/virsh-util.c | 3 +-
6 files changed, 76 insertions(+), 111 deletions(-)
--
2.31.1
3 years, 2 months
[PATCH 00/14] qemu: Some more 'query-command-line-options' originated cleanups
by Peter Krempa
There are a few more capabilities we can easily assume and stop trying
to probe them and some more legacy code to delete.
This time it's mainly about VNC including a modernization of
qemuxml2argvtest cases for it.
Peter Krempa (14):
qemuxml2argvtest: Use real caps in "graphics-vnc-tls" case
qemu: Always assume presence of QEMU_CAPS_OBJECT_TLS_CREDS_X509
qemu: capabilities: Retire QEMU_CAPS_OBJECT_TLS_CREDS_X509
qemuBuildTLSx509BackendProps: Remove unused 'qemuCaps'
qemu: command: Simplify 'vnc' commandline generator
qemu: command: Always assume QEMU_CAPS_VNC_OPTS
qemu: capabilities: Retire QEMU_CAPS_VNC_OPTS
qemuxml2argvtest: Replace vnc unix socket tests with pinned versions
qemu: command: Always QEMU_CAPS_VNC_MULTI_SERVERS
qemu: capabilities: Retire QEMU_CAPS_VNC_MULTI_SERVERS
qemuxml2argvtest: Add DO_TEST_CAPS_LATEST for the vnc unix socket
tests
qemuxml2argvtest: Modernize the rest of 'graphics-vnc' tests
qemu: validate: Always assume QEMU_CAPS_SPICE_FILE_XFER_DISABLE
qemu: capabilities: Retire QEMU_CAPS_SPICE_FILE_XFER_DISABLE
src/qemu/qemu_backup.c | 5 +-
src/qemu/qemu_capabilities.c | 12 +-
src/qemu/qemu_capabilities.h | 8 +-
src/qemu/qemu_command.c | 108 ++++++------------
src/qemu/qemu_command.h | 10 +-
src/qemu/qemu_domain.c | 4 -
src/qemu/qemu_driver.c | 15 +--
src/qemu/qemu_hotplug.c | 13 +--
src/qemu/qemu_hotplug.h | 3 +-
src/qemu/qemu_migration_params.c | 2 +-
src/qemu/qemu_snapshot.c | 3 +-
src/qemu/qemu_validate.c | 20 ----
.../caps_2.11.0.s390x.xml | 3 -
.../caps_2.11.0.x86_64.xml | 4 -
.../caps_2.12.0.aarch64.xml | 3 -
.../caps_2.12.0.ppc64.xml | 3 -
.../caps_2.12.0.s390x.xml | 3 -
.../caps_2.12.0.x86_64.xml | 4 -
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 3 -
.../caps_3.0.0.riscv32.xml | 3 -
.../caps_3.0.0.riscv64.xml | 3 -
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 3 -
.../caps_3.0.0.x86_64.xml | 4 -
.../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 3 -
.../caps_3.1.0.x86_64.xml | 4 -
.../caps_4.0.0.aarch64.xml | 3 -
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 3 -
.../caps_4.0.0.riscv32.xml | 4 -
.../caps_4.0.0.riscv64.xml | 4 -
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 3 -
.../caps_4.0.0.x86_64.xml | 4 -
.../caps_4.1.0.x86_64.xml | 4 -
.../caps_4.2.0.aarch64.xml | 3 -
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 3 -
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 3 -
.../caps_4.2.0.x86_64.xml | 4 -
.../caps_5.0.0.aarch64.xml | 3 -
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 3 -
.../caps_5.0.0.riscv64.xml | 4 -
.../caps_5.0.0.x86_64.xml | 4 -
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 4 -
.../caps_5.1.0.x86_64.xml | 4 -
.../caps_5.2.0.aarch64.xml | 3 -
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 3 -
.../caps_5.2.0.riscv64.xml | 4 -
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 3 -
.../caps_5.2.0.x86_64.xml | 4 -
.../caps_6.0.0.aarch64.xml | 3 -
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 3 -
.../caps_6.0.0.x86_64.xml | 4 -
.../caps_6.1.0.x86_64.xml | 4 -
tests/qemuhotplugtest.c | 1 -
...cs-vnc-auto-socket-cfg.x86_64-2.11.0.args} | 7 +-
...ics-vnc-auto-socket-cfg.x86_64-latest.args | 36 ++++++
...raphics-vnc-auto-socket.x86_64-2.11.0.args | 31 +++++
...raphics-vnc-auto-socket.x86_64-latest.args | 33 ++++++
...phics-vnc-egl-headless.x86_64-2.11.0.args} | 5 +-
...aphics-vnc-egl-headless.x86_64-latest.args | 37 ++++++
...ics-vnc-no-listen-attr.x86_64-2.11.0.args} | 5 +-
...hics-vnc-no-listen-attr.x86_64-latest.args | 36 ++++++
...s => graphics-vnc-none.x86_64-2.11.0.args} | 5 +-
.../graphics-vnc-none.x86_64-latest.args | 33 ++++++
...=> graphics-vnc-policy.x86_64-2.11.0.args} | 5 +-
.../graphics-vnc-policy.x86_64-latest.args | 36 ++++++
...emove-generated-socket.x86_64-2.11.0.args} | 5 +-
...remove-generated-socket.x86_64-latest.args | 36 ++++++
...s => graphics-vnc-sasl.x86_64-2.11.0.args} | 7 +-
.../graphics-vnc-sasl.x86_64-latest.args | 37 ++++++
...vnc-socket-new-cmdline.x86_64-2.11.0.args} | 5 +-
...-vnc-socket-new-cmdline.x86_64-latest.args | 33 ++++++
.../qemuxml2argvdata/graphics-vnc-socket.args | 30 -----
...=> graphics-vnc-socket.x86_64-2.11.0.args} | 7 +-
.../graphics-vnc-socket.x86_64-latest.args | 33 ++++++
...gs => graphics-vnc-tls.x86_64-2.11.0.args} | 8 +-
...graphics-vnc-websocket.x86_64-2.11.0.args} | 5 +-
.../graphics-vnc-websocket.x86_64-latest.args | 33 ++++++
...r.args => graphics-vnc.x86_64-2.11.0.args} | 5 +-
.../graphics-vnc.x86_64-latest.args | 36 ++++++
tests/qemuxml2argvdata/name-escape.args | 2 +-
tests/qemuxml2argvtest.c | 71 ++++++------
tests/qemuxml2xmltest.c | 4 +-
81 files changed, 586 insertions(+), 378 deletions(-)
rename tests/qemuxml2argvdata/{graphics-vnc-auto-socket-cfg.args => graphics-vnc-auto-socket-cfg.x86_64-2.11.0.args} (79%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-auto-socket-cfg.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-auto-socket.x86_64-2.11.0.args
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-auto-socket.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-egl-headless.args => graphics-vnc-egl-headless.x86_64-2.11.0.args} (84%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc.args => graphics-vnc-no-listen-attr.x86_64-2.11.0.args} (83%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-no-listen-attr.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-none.args => graphics-vnc-none.x86_64-2.11.0.args} (81%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-none.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-policy.args => graphics-vnc-policy.x86_64-2.11.0.args} (84%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-policy.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-remove-generated-socket.args => graphics-vnc-remove-generated-socket.x86_64-2.11.0.args} (83%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-remove-generated-socket.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-sasl.args => graphics-vnc-sasl.x86_64-2.11.0.args} (82%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-sasl.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-socket-new-cmdline.args => graphics-vnc-socket-new-cmdline.x86_64-2.11.0.args} (81%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-socket-new-cmdline.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/graphics-vnc-socket.args
rename tests/qemuxml2argvdata/{graphics-vnc-auto-socket.args => graphics-vnc-socket.x86_64-2.11.0.args} (78%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-socket.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-tls.args => graphics-vnc-tls.x86_64-2.11.0.args} (71%)
rename tests/qemuxml2argvdata/{graphics-vnc-websocket.args => graphics-vnc-websocket.x86_64-2.11.0.args} (81%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc-websocket.x86_64-latest.args
rename tests/qemuxml2argvdata/{graphics-vnc-no-listen-attr.args => graphics-vnc.x86_64-2.11.0.args} (83%)
create mode 100644 tests/qemuxml2argvdata/graphics-vnc.x86_64-latest.args
--
2.31.1
3 years, 2 months
[PATCH 0/5] virsh: small refactoring
by Kristina Hanicova
This series targets some alterations to make the code more readable and
consistent.
Kristina Hanicova (5):
virsh: checkpoint & domain-monitor: small refactoring
virsh: domain: refactoring of small functions
virsh: domain: change the way functions return bool value
virsh: domain, host & volume: refactor bigger functions
virsh: refactor functions to not use 'ret' variable
tools/virsh-checkpoint.c | 19 +-
tools/virsh-domain-monitor.c | 314 +++++++++----------
tools/virsh-domain.c | 567 ++++++++++++++---------------------
tools/virsh-host.c | 166 +++++-----
tools/virsh-interface.c | 65 ++--
tools/virsh-network.c | 47 ++-
tools/virsh-nodedev.c | 32 +-
tools/virsh-nwfilter.c | 15 +-
tools/virsh-util.c | 3 +-
tools/virsh-volume.c | 56 ++--
10 files changed, 546 insertions(+), 738 deletions(-)
--
2.31.1
3 years, 2 months
[PATCH RFC 0/8] blockdev-replace
by Vladimir Sementsov-Ogievskiy
Hi all!
As a continuation of "Qemu block filter insertion/removal API"
discussion, here is my proposal of blockdev-replace.
The realization allows:
- replace children of different parents: BDS, block devices, block
exports
- automatically replace all parents of specific BDS, excluding creating
loops (like bdrv_replace_node())
- do several replacements in one transaction
It's an untested draft, so you may go to patch 8, to look at QAPI
addition.
Vladimir Sementsov-Ogievskiy (8):
block-backend: blk_root(): drop const specifier on return type
block: add BlockParentClass class
block: realize BlockParentClass for BlockDriverState
block/export: realize BlockParentClass functionality
qdev: improve find_device_state() to distinguish simple not found case
qdev: realize BlockParentClass
block: improve bdrv_replace_node_noperm()
qapi: add blockdev-replace command
qapi/block-core.json | 78 ++++++++++++++++
include/block/block-parent.h | 32 +++++++
include/sysemu/block-backend.h | 2 +-
block.c | 158 ++++++++++++++++++++++++++++++++-
block/block-backend.c | 2 +-
block/block-parent.c | 66 ++++++++++++++
block/export/export.c | 44 +++++++++
softmmu/qdev-monitor.c | 90 +++++++++++++++----
block/meson.build | 1 +
9 files changed, 453 insertions(+), 20 deletions(-)
create mode 100644 include/block/block-parent.h
create mode 100644 block/block-parent.c
--
2.29.2
3 years, 2 months
[PATCH] qemu: driver: Remove unused variable 'cfg'
by Peter Krempa
Commit a50c473ad6c988a2 removed last use of 'cfg' from
qemuDomainMemoryPeek and qemuDomainScreenshot triggering a compile time
warning.
Fixes: a50c473ad6c988a249bf79a30fb7c6dc19733347
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Build-fix && trivial. Pushed.
src/qemu/qemu_driver.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f57e943b48..28aa7351ee 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3374,7 +3374,6 @@ qemuDomainScreenshot(virDomainPtr dom,
const char *videoAlias = NULL;
char *ret = NULL;
bool unlink_tmp = false;
- g_autoptr(virQEMUDriverConfig) cfg = NULL;
virCheckFlags(0, NULL);
@@ -3382,7 +3381,6 @@ qemuDomainScreenshot(virDomainPtr dom,
goto cleanup;
priv = vm->privateData;
- cfg = virQEMUDriverGetConfig(driver);
if (virDomainScreenshotEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
@@ -10559,7 +10557,6 @@ qemuDomainMemoryPeek(virDomainPtr dom,
g_autofree char *tmp = NULL;
int fd = -1, ret = -1;
qemuDomainObjPrivate *priv;
- g_autoptr(virQEMUDriverConfig) cfg = NULL;
virCheckFlags(VIR_MEMORY_VIRTUAL | VIR_MEMORY_PHYSICAL, -1);
@@ -10567,7 +10564,6 @@ qemuDomainMemoryPeek(virDomainPtr dom,
goto cleanup;
priv = vm->privateData;
- cfg = virQEMUDriverGetConfig(driver);
if (virDomainMemoryPeekEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
--
2.31.1
3 years, 2 months
[PATCH v4 00/11] Implement IOThreads related APIs for test driver
by 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 testIOThreadInfo and generate IOThread infos
test_driver: Implement virDomainAddIOThread
test_driver: Implement virDomainDelIOThread
domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()
test_driver: Implement virDomainGetIOThreadInfo
test_driver: Implement virDomainPinIOThread
test_driver: Implement testDomainSetIOThreadParams
test_driver: Implement virConnectGetAllDomainStats
test_driver: Introduce testDomainGetStatsIOThread
tests: Test IOThread related functions for test driver
examples/xml/test/testdomfc4.xml | 5 +
src/hypervisor/domain_driver.c | 132 ++++++++
src/hypervisor/domain_driver.h | 10 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_driver.c | 113 +------
src/test/test_driver.c | 516 +++++++++++++++++++++++++++++++
tests/virshtest.c | 110 +++++++
7 files changed, 781 insertions(+), 108 deletions(-)
--
2.33.0
3 years, 2 months
[PATCH v3 0/2] qemu: don't change ownership of cache directory
by Peng Liang
See path 2 for detail.
v2 -> v3:
- Change the directory to put the temp files of screenshot and
memorypeek from autoDumpPath to per-domain directory [Daniel]
v1 -> v2:
- Add commit message for path1 [Peter]
Peng Liang (2):
qemu: move temp file of screenshot and memorypeek to per-domain dir
qemu: don't change ownership of cache directory
src/qemu/qemu_driver.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
--
2.31.1
3 years, 2 months
[RFC PATCH 0/7] qemu: QAPI-schema: Add support for enum value 'features'
by Peter Krempa
This series is based on Markus' effort to add 'feature' flags to enum
values so that e.g. they can be deprecated:
https://listman.redhat.com/archives/libvir-list/2021-September/msg00453.html
This series adapts both the schema query language to support querying
for arbitrary feature flags and also the schema validator to reject
deprecated enum values.
Libvirt didn't use any deprecated value for now so to see that this
really works you can fetch this series including patches which show it's
working (tests fail):
git fetch https://gitlab.com/pipo.sk/libvirt.git qemu-deprecate-enum
The above branch also demonstrates that parsing from the new arrays
produces identical results as it has updated qemu capabilities.
This series is RFC as it's waiting for the qemu additions first.
Peter Krempa (7):
virQEMUQAPISchemaTraverseEnum: Move helper variables into loop
virQEMUQAPISchemaTraverseEnum: Use the modern 'members' array
virQEMUQAPISchemaTraverseEnum: Allow query of enume type features
testQEMUSchemaValidateEnum: Refactor logic to simplify switching to
new QMP schema format
testQEMUSchemaValidateEnum: Use new 'members' for 'enum' meta type
testQEMUSchemaValidateDeprecated: Move to the top
testQEMUSchemaValidateEnum: Validate deprecated members
src/qemu/qemu_qapi.c | 46 +++++++++++--
tests/testutilsqemuschema.c | 130 +++++++++++++++++++++---------------
2 files changed, 117 insertions(+), 59 deletions(-)
--
2.31.1
3 years, 2 months
[libvirt PATCH 0/2] Random improvements to work around a build system issue
by Tim Wiederhake
This is an alternative to
https://listman.redhat.com/archives/libvir-list/2021-September/msg00522.html.
When libvirt is build:
* with sanitizers enabled,
* buildtype explicitly set to "debug",
* on clang,
the build fails with:
../src/conf/nwfilter_conf.c:2190:1: error: stack frame size of 10616
bytes in function 'virNWFilterRuleDefFixup' [-Werror,-Wframe-larger-than=]
virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
^
1 error generated.
../src/conf/domain_conf.c:19514:1: error: stack frame size of 8312
bytes in function 'virDomainDefParseXML' [-Werror,-Wframe-larger-than=]
virDomainDefParseXML(xmlXPathContextPtr ctxt,
^
1 error generated.
Note that this does not happen when "-Dbuildtype" is not specified, even
though "debug" is the default build type.
The patches in this series happen to make these errors go away.
Regards,
Tim
Tim Wiederhake (2):
virDomainDefParseXML: Use automatic memory management
virNWFilterRuleDefFixup: Replace macro with function
src/conf/domain_conf.c | 208 ++++++++++++++--------------
src/conf/nwfilter_conf.c | 284 ++++++++++++++++++++-------------------
2 files changed, 245 insertions(+), 247 deletions(-)
--
2.31.1
3 years, 2 months
[libvirt PATCH 0/1] Fix rpmbuild on CentOS Stream 8
by Erik Skultety
When running rpmbuild on CentOS 8 results in the following error:
error: Too many levels of recursion in macro expansion. It is likely caused by
recursive macro declaration.
error: Macro %libvirt_daemon_perform_restart failed to expand
error: line 1275: %global libvirt_daemon_perform_restart() \
if test %libvirt_daemon_needs_restart %1 \
then \
/bin/systemctl try-restart %1.service >/dev/null 2>&1 || : \
fi \
%libvirt_daemon_finish_restart %1
Erik Skultety (1):
libvirt.spec.in: Replace %global with %define
libvirt.spec.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--
2.31.1
3 years, 2 months