[PATCH] lib: Prohibit parallel connections with tunneled migration
by Jim Fehlig
As discussed on the developer list, parallel migration connections
are not compatible with tunneled migration
https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html
Prohibit the concurrent use of parallel and tunneled migration options.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
I added the check to all migration entry points except virDomainMigrate3,
where the p2p and tunneled options are already prohibitied.
src/libvirt-domain.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 4074397b30..b910ba6b4d 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3546,6 +3546,10 @@ virDomainMigrate(virDomainPtr domain,
VIR_MIGRATE_NON_SHARED_INC,
error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (flags & VIR_MIGRATE_OFFLINE) {
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -3701,6 +3705,10 @@ virDomainMigrate2(virDomainPtr domain,
VIR_MIGRATE_NON_SHARED_INC,
error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (flags & VIR_MIGRATE_OFFLINE) {
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -4087,6 +4095,10 @@ virDomainMigrateToURI(virDomainPtr domain,
virCheckReadOnlyGoto(domain->conn->flags, error);
virCheckNonNullArgGoto(duri, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
@@ -4159,6 +4171,10 @@ virDomainMigrateToURI2(virDomainPtr domain,
virCheckDomainReturn(domain, -1);
virCheckReadOnlyGoto(domain->conn->flags, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
@@ -4232,6 +4248,10 @@ virDomainMigrateToURI3(virDomainPtr domain,
virCheckDomainReturn(domain, -1);
virCheckReadOnlyGoto(domain->conn->flags, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+ VIR_MIGRATE_PARALLEL,
+ error);
+
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto error;
--
2.24.1
4 years, 9 months
[PATCH 00/19] qemu: backup: Add support for checkpoint deletion and block copy with checkpoints
by Peter Krempa
The first 7 patches are technically v2 of
[libvirt] [RFC PATCH 00/16] qemu: checkpoint: Add support for deleting checkpoints accross snapshots
https://www.redhat.com/archives/libvir-list/2020-January/msg00430.html
as they were not reviewed, but the handling of block copy would conflict
with them I'm reposting them with two simple bugfixes.
The rest of the series implements handling of bitmaps when doing a block
copy.
Peter Krempa (19):
tests: qemublock: Add test for checkpoint deletion bitmap merge
tests: qemublock: Add few more test cases for checkpoint deletion
tests: qemublock: Add synthetic snapshot+checkpoint test data
qemu: checkpoint: Introduce support for deleting checkpoints accross
snapshots
tests: qemublock: Add checkpoint deletion test for deep backing chain
tests: qemublock: Add checkpoint deletion tests for some special cases
qemu: checkpoint: Track and relabel images for bitmap merging
qemu: block: Extract calls of qemuBlockGetNamedNodeData into a helper
function
util: json: Introduce virJSONValueArrayConcat
virJSONValueNewArray: Use g_new0 to allocate and remove NULL checks
from callers
virhash: Make sure that hash key is always copied
virHashAddOrUpdateEntry: Simplify allocation of new entry
qemu: blockjob: Store 'jobflags' with block job data
qemu: blockjob: Store 'flags' for all the block job types
qemu: block: Add validator for bitmap chains accross backing chains
tests: qemublocktest: Add another synthetic test case for broken
bitmaps
qemu: block: Introduce function to calculate bitmap handling for
block-copy
tests: qemublock: Add tests for qemuBlockBitmapsHandleBlockcopy
qemuDomainBlockPivot: Copy bitmaps backing checkpoints for
virDomainBlockCopy
src/conf/domain_addr.c | 5 +-
src/libvirt_private.syms | 1 +
src/locking/lock_daemon.c | 4 +-
src/logging/log_handler.c | 3 +-
src/network/leaseshelper.c | 6 +-
src/qemu/qemu_agent.c | 6 +-
src/qemu/qemu_backup.c | 11 +-
src/qemu/qemu_block.c | 208 ++++-
src/qemu/qemu_block.h | 16 +
src/qemu/qemu_blockjob.c | 16 +-
src/qemu/qemu_blockjob.h | 12 +-
src/qemu/qemu_checkpoint.c | 146 +++-
src/qemu/qemu_checkpoint.h | 6 +-
src/qemu/qemu_domain.c | 7 +
src/qemu/qemu_driver.c | 54 +-
src/qemu/qemu_firmware.c | 12 +-
src/qemu/qemu_migration_params.c | 3 +-
src/qemu/qemu_monitor_json.c | 3 +-
src/rpc/virnetserver.c | 6 +-
src/rpc/virnetserverservice.c | 3 +-
src/util/virhash.c | 13 +-
src/util/virhash.h | 3 +-
src/util/virjson.c | 44 +-
src/util/virjson.h | 2 +
src/util/virlockspace.c | 6 +-
src/util/virmacmap.c | 8 +-
tests/qemublocktest.c | 250 +++++-
.../bitmap/snapshots-synthetic-broken.json | 819 +++++++++++++++++
.../bitmap/snapshots-synthetic-broken.out | 12 +
.../snapshots-synthetic-checkpoint.json | 827 ++++++++++++++++++
.../bitmap/snapshots-synthetic-checkpoint.out | 13 +
.../bitmapblockcopy/basic-deep-out.json | 117 +++
.../bitmapblockcopy/basic-shallow-out.json | 117 +++
.../bitmapblockcopy/snapshots-deep-out.json | 133 +++
.../snapshots-shallow-out.json | 48 +
.../checkpointdelete/basic-current-out.json | 29 +
.../basic-intermediate1-out.json | 22 +
.../basic-intermediate2-out.json | 22 +
.../basic-intermediate3-out.json | 22 +
.../checkpointdelete/basic-noparent-out.json | 9 +
.../snapshots-current-out.json | 29 +
.../snapshots-intermediate1-out.json | 24 +
.../snapshots-intermediate2-out.json | 62 ++
.../snapshots-intermediate3-out.json | 61 ++
.../snapshots-noparent-out.json | 27 +
...hots-synthetic-checkpoint-current-out.json | 29 +
...ynthetic-checkpoint-intermediate1-out.json | 31 +
...ynthetic-checkpoint-intermediate2-out.json | 34 +
...ynthetic-checkpoint-intermediate3-out.json | 61 ++
...ots-synthetic-checkpoint-noparent-out.json | 27 +
tests/qemumonitorjsontest.c | 5 +-
.../qemustatusxml2xmldata/backup-pull-in.xml | 2 +-
.../blockjob-blockdev-in.xml | 8 +-
53 files changed, 3293 insertions(+), 151 deletions(-)
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.out
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json
create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json
--
2.24.1
4 years, 9 months
[libvirt PATCH] qemu: Fix domain ID allocation
by Ján Tomko
The rewrite to use GLib's atomic ops functions changed the behavior
of virAtomicIntInc - before it returned the pre-increment value.
Most of the callers using its value were adjusted, but the one
in qemuDriverAllocateID was not. If libvirtd would reconnect to
a running domain during startup, the next started domain would get
the same ID:
$ virsh list
Id Name State
--------------------------
1 f28live running
1 f28live1 running
Use the g_atomic_add function directly (as recommended in viratomic.h)
and add 1 to the result.
This also restores the usual numbering from 1 instead of 0.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Fixes: 7b9645a7d127a374b8d1c83fdf9789706dbab2c9
---
src/qemu/qemu_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index e5051027fc..0b119cbe78 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1858,7 +1858,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
int qemuDriverAllocateID(virQEMUDriverPtr driver)
{
- return virAtomicIntInc(&driver->lastvmid);
+ return g_atomic_int_add(&driver->lastvmid, 1) + 1;
}
--
2.21.0
4 years, 9 months
[libvirt PATCH 0/5] qemu: Add support for the kvm-no-adjvtime CPU feature
by Andrea Bolognani
This ARM-specific CPU feature has been recently added to QEMU with
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg04124.html
Patch 1/5 has been trimmed quite liberally: to obtain the unabridged
version of this series, use
$ git fetch https://gitlab.com/abologna/libvirt kvm-no-adjvtime
Andrea Bolognani (5):
tests: Add capabilities for QEMU 5.0.0 on aarch64
qemu: Add the QEMU_CAPS_CPU_KVM_NO_ADJVTIME capability
cpu: Add the kvm-no-adjvtime CPU feature
qemu: Validate the kvm-no-adjvtime CPU feature
tests: Add tests for the kvm-no-adjvtime CPU feature
src/cpu_map/arm_features.xml | 3 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 14 +-
.../qemu_5.0.0-virt.aarch64.xml | 156 +
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 150 +
.../caps_5.0.0.aarch64.replies | 22717 ++++++++++++++++
.../caps_5.0.0.aarch64.xml | 457 +
.../aarch64-features-misc.aarch64-latest.args | 32 +
.../aarch64-features-misc.xml | 17 +
tests/qemuxml2argvtest.c | 2 +
11 files changed, 23549 insertions(+), 2 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
create mode 100644 tests/domaincapsdata/qemu_5.0.0.aarch64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
create mode 100644 tests/qemuxml2argvdata/aarch64-features-misc.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/aarch64-features-misc.xml
--
2.24.1
4 years, 9 months
[libvirt PATCH 0/3] Clean up usage of virBufferTrim
by Ján Tomko
Before it was possible to supply a matching suffix, a length of chars
to trim, or both.
However the combination of the two was only used in tests.
Split the function into two.
Ján Tomko (3):
util: introduce virBufferTrimLen
Use virBufferTrimLen when applicable
virBufferTrim: do not accept len
src/conf/domain_addr.c | 2 +-
src/conf/domain_conf.c | 6 ++---
src/cpu/cpu_x86.c | 6 ++---
src/libvirt_private.syms | 1 +
src/lxc/lxc_container.c | 2 +-
src/qemu/qemu_command.c | 8 +++----
src/rpc/virnetsshsession.c | 2 +-
src/storage/storage_util.c | 4 ++--
src/util/virbuffer.c | 47 +++++++++++++++++++++----------------
src/util/virbuffer.h | 3 ++-
src/util/virqemu.c | 2 +-
src/util/virresctrl.c | 4 ++--
tests/qemublocktest.c | 2 +-
tests/qemumonitorjsontest.c | 4 ++--
tests/virbuftest.c | 19 +++++++--------
tools/virsh-domain.c | 8 +++----
tools/vsh.c | 6 ++---
17 files changed, 67 insertions(+), 59 deletions(-)
--
2.19.2
4 years, 9 months
[PATCH 0/7] Drop virAtomic module
by Michal Privoznik
Inspired by:
https://www.redhat.com/archives/libvir-list/2020-January/msg01446.html
Instead of using:
#define virAtomicIntXXX g_atomic_int_XXX
let's use the GLib directly and drop needless defines.
Michal Prívozník (7):
test_driver: Replace virAtomicIntAdd() with virAtomicIntInc()
tests: Drop viratomictest
src: Replace virAtomicIntGet() with g_atomic_int_get()
src: Replace virAtomicIntSet() with g_atomic_int_set()
src: Replace virAtomicIntInc() with g_atomic_int_add()
src: Drop virAtomicIntDecAndTest() with g_atomic_int_dec_and_test()
Drop virAtomic module
configure.ac | 1 -
m4/virt-atomic.m4 | 77 -------------
src/Makefile.am | 6 -
src/libvirt_atomic.syms | 11 --
src/libxl/libxl_domain.c | 5 +-
src/libxl/libxl_driver.c | 3 +-
src/lxc/lxc_process.c | 7 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 33 +++---
src/qemu/qemu_conf.c | 1 -
src/qemu/qemu_domain.c | 1 -
src/qemu/qemu_process.c | 7 +-
src/test/test_driver.c | 7 +-
src/util/Makefile.inc.am | 2 -
src/util/viratomic.c | 35 ------
src/util/viratomic.h | 130 ----------------------
src/util/virobject.c | 9 +-
src/util/virprocess.c | 3 +-
src/util/virsystemd.c | 17 ++-
tests/Makefile.am | 5 -
tests/viratomictest.c | 175 ------------------------------
20 files changed, 41 insertions(+), 494 deletions(-)
delete mode 100644 m4/virt-atomic.m4
delete mode 100644 src/libvirt_atomic.syms
delete mode 100644 src/util/viratomic.c
delete mode 100644 src/util/viratomic.h
delete mode 100644 tests/viratomictest.c
--
2.24.1
4 years, 9 months