[libvirt] [PATCH 0/8] Work-in-progress: Incremental Backup API additions
by Eric Blake
I'm offline the rest of this week, but wanted to post the
progress I've made on patches towards the Incremental Backup RFC:
https://www.redhat.com/archives/libvir-list/2018-May/msg01403.html
Comments welcome, including any naming suggestions
Still to go:
- Add .rng file for validating the XML format used in virDomainBackupBegin()
- Add flags for validating XML
- Add src/conf/checkpoint_conf.c mirroring src/conf/snapshot_conf.c for
tracking tree of checkpoints
- Add virsh wrappers for calling everything
- Add qemu implementation - my first addition will probably just be for
push model full backups, then additional patches to expand into
pull model (on the qemu list, I still need to review and incorporate
Vladimir's patches for exporting a bitmap over NBD)
- Bug fixes (but why would there be any bugs in the first place? :)
I've got portions of the qemu code working locally, but not polished
enough to post as a patch yet; my end goal is to have a working demo
against current qemu.git showing the use of virDomainBackupBegin()
for incremental backups with the push model prior to the code freeze
for 4.5.0 this month, even if that code doesn't get checked into
libvirt until later when the qemu code is changed to drop x- prefixes.
(That is, I'm hoping to demo that my API is sound, and thus we can
include the entrypoints in the libvirt.so for this release, even if
the libvirt code for driving pull mode over qemu waits until after a
qemu release where the pieces are promoted to a stable form.)
Eric Blake (8):
snapshots: Avoid term 'checkpoint' for full system snapshot
backup: Document nuances between different state capture APIs
backup: Introduce virDomainCheckpointPtr
backup: Document new XML for backups
backup: Introduce virDomainCheckpoint APIs
backup: Introduce virDomainBackup APIs
backup: Add new domain:checkpoint access control
backup: Implement backup APIs for remote driver
docs/Makefile.am | 3 +
docs/apibuild.py | 2 +
docs/docs.html.in | 9 +-
docs/domainstatecapture.html.in | 190 ++++++
docs/formatcheckpoint.html.in | 273 +++++++++
docs/formatsnapshot.html.in | 16 +-
docs/schemas/domaincheckpoint.rng | 89 +++
include/libvirt/libvirt-domain-checkpoint.h | 158 +++++
include/libvirt/libvirt-domain-snapshot.h | 10 +-
include/libvirt/libvirt-domain.h | 14 +-
include/libvirt/libvirt.h | 3 +-
include/libvirt/virterror.h | 5 +-
libvirt.spec.in | 2 +
mingw-libvirt.spec.in | 4 +
po/POTFILES | 1 +
src/Makefile.am | 2 +
src/access/viraccessperm.c | 5 +-
src/access/viraccessperm.h | 8 +-
src/conf/snapshot_conf.c | 2 +-
src/datatypes.c | 62 +-
src/datatypes.h | 31 +-
src/driver-hypervisor.h | 74 ++-
src/libvirt-domain-checkpoint.c | 908 ++++++++++++++++++++++++++++
src/libvirt-domain-snapshot.c | 4 +-
src/libvirt-domain.c | 8 +-
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 19 +
src/qemu/qemu_driver.c | 12 +-
src/remote/remote_daemon_dispatch.c | 15 +
src/remote/remote_driver.c | 31 +-
src/remote/remote_protocol.x | 237 +++++++-
src/remote_protocol-structs | 129 ++++
src/rpc/gendispatch.pl | 32 +-
src/util/virerror.c | 15 +-
tests/domaincheckpointxml2xmlin/empty.xml | 1 +
tests/domaincheckpointxml2xmlout/empty.xml | 10 +
tests/virschematest.c | 2 +
tools/virsh-domain.c | 3 +-
tools/virsh-snapshot.c | 2 +-
tools/virsh.pod | 14 +-
40 files changed, 2347 insertions(+), 60 deletions(-)
create mode 100644 docs/domainstatecapture.html.in
create mode 100644 docs/formatcheckpoint.html.in
create mode 100644 docs/schemas/domaincheckpoint.rng
create mode 100644 include/libvirt/libvirt-domain-checkpoint.h
create mode 100644 src/libvirt-domain-checkpoint.c
create mode 100644 tests/domaincheckpointxml2xmlin/empty.xml
create mode 100644 tests/domaincheckpointxml2xmlout/empty.xml
--
2.14.4
6 years, 5 months
[libvirt] [PATCH] conf: fix virtType FromString check
by Cole Robinson
In the domain definition, virtType is virDomainVirtType which is
unsigned, so comparing against -1 doesn't work. Cast to int first
Fixes 8e2982b5767
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
This regressed in the past as well, when virtType was changed to
virDomainVirtType in 7383b8cc068, fixed by the follow up 5e06a4f063.
It's strange that virDomainVirtType is unsigned but VirtTypeFromString
can return -1... it should probably either work like virArch, or we
should switch virDomainVirtType to int in the DomainDef, but that
requires fixing a few other places too
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c27c874d9e..30806d1e59 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19140,7 +19140,7 @@ virDomainDefParseCaps(virDomainDefPtr def,
"%s", _("missing domain type attribute"));
goto cleanup;
}
- if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
+ if ((int)(def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("invalid domain type %s"), virttype);
goto cleanup;
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] conf: don't use virDomainVirtType in struct field
by Daniel P. Berrangé
Use of enum types for struct fields is generally avoided since it causes
warnings if the compiler assumes the enum is unsigned. For example
commit 8e2982b5767a25e5da6533c65bfdc648c95b3c69
Author: Cole Robinson <crobinso(a)redhat.com>
Date: Tue Jul 24 16:27:54 2018 -0400
conf: Clean up virDomainDefParseCaps
Introduced a line:
if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
which causes a build failure with CLang
conf/domain_conf.c:19143:65: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
as the compiler is free to optimize away the "< 0" check due to the
assumption that the enum type is unsigned and always in range.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
src/conf/domain_conf.h | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_process.c | 4 +++-
4 files changed, 6 insertions(+), 4 deletions(-)
Pushing as a build fix for CLang
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c27c874d9e..f94a90fbcc 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15075,7 +15075,7 @@ virDomainVideoDefaultRAM(const virDomainDef *def,
int
virDomainVideoDefaultType(const virDomainDef *def)
{
- switch (def->virtType) {
+ switch ((virDomainVirtType)def->virtType) {
case VIR_DOMAIN_VIRT_TEST:
case VIR_DOMAIN_VIRT_XEN:
if (def->os.type == VIR_DOMAIN_OSTYPE_XEN ||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a804e86f6c..c1dfa37fdf 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2386,7 +2386,7 @@ struct _virDomainVirtioOptions {
typedef struct _virDomainDef virDomainDef;
typedef virDomainDef *virDomainDefPtr;
struct _virDomainDef {
- virDomainVirtType virtType;
+ int virtType; /* enum virDomainVirtType */
int id;
unsigned char uuid[VIR_UUID_BUFLEN];
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ae45c45b7f..d148db90fa 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7163,7 +7163,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, "-machine");
virBufferAdd(&buf, def->os.machine, -1);
- switch (def->virtType) {
+ switch ((virDomainVirtType)def->virtType) {
case VIR_DOMAIN_VIRT_QEMU:
virBufferAddLit(&buf, ",accel=tcg");
break;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 27bd8b9465..c4e33723d1 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7191,6 +7191,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virCapsPtr caps = NULL;
bool active = false;
+ virDomainVirtType virtType;
VIR_DEBUG("Beginning VM attach process");
@@ -7342,8 +7343,9 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
goto exit_monitor;
if (qemuMonitorGetStatus(priv->mon, &running, &reason) < 0)
goto exit_monitor;
- if (qemuMonitorGetVirtType(priv->mon, &vm->def->virtType) < 0)
+ if (qemuMonitorGetVirtType(priv->mon, &virtType) < 0)
goto exit_monitor;
+ vm->def->virtType = virtType;
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto error;
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] qemu_monitor: Fix regression in getting disk capacity
by Michal Privoznik
In dbf990fd31e8 the qemuMonitorJSONBlockStatsUpdateCapacityOne()
was split. However, due to a bug the return value was never set
to something meaningful.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 75d0738b5d..9acf62e0bb 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2492,14 +2492,15 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image,
goto cleanup;
if (backingChain &&
- (backing = virJSONValueObjectGetObject(image, "backing-image"))) {
- ret = qemuMonitorJSONBlockStatsUpdateCapacityOne(backing,
- dev_name,
- depth + 1,
- stats,
- true);
- }
+ (backing = virJSONValueObjectGetObject(image, "backing-image")) &&
+ qemuMonitorJSONBlockStatsUpdateCapacityOne(backing,
+ dev_name,
+ depth + 1,
+ stats,
+ true) < 0)
+ goto cleanup;
+ ret = 0;
cleanup:
VIR_FREE(entry_name);
return ret;
--
2.16.4
6 years, 5 months
[libvirt] [PATCH] conf: Fix typo in error msg of virDomainVideoDefValidate
by Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1607825
Fix typo of error msg when 'none' type is not the only video device
defined in VM.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 33b0b4ab68..c2ccbcca91 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5687,7 +5687,7 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
if (def->videos[i]->type == VIR_DOMAIN_VIDEO_TYPE_NONE &&
def->nvideos > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("a '%s' video type must be the only video device "
+ _("a 'none' video type must be the only video device "
"defined for the domain"));
return -1;
}
--
2.18.0
6 years, 5 months
[libvirt] [PATCH 0/7] conf: Replace SKIP_OSTYPE with SKIP_VALIDATE
by Cole Robinson
The SKIP_OSTYPE domain parse flag is largely redundant nowadays
since we have SKIP_VALIDATE. This series smoothes out some of
the SKIP_OSTYPE weirdness so we can drop it
Cole Robinson (7):
conf: Break out virDomainDefParseCaps
conf: Clean up virDomainDefParseCaps
tests: qemuhotplug: Fix segfault when XML loading fails
conf: Drop unneccessary caps parsing logic
conf: Sync caps data even when SKIP_OSTYPE_CHECKS
tests: Remove redundant lxc test
conf: Replace SKIP_OSTYPE_CHECKS with SKIP_VALIDATE
src/conf/domain_conf.c | 175 +++++++++++----------
src/conf/domain_conf.h | 13 +-
src/conf/snapshot_conf.c | 2 -
src/conf/virdomainobjlist.c | 2 -
tests/lxcxml2xmltest.c | 2 -
tests/qemuhotplugtest.c | 2 +
tests/qemuxml2argvdata/missing-machine.xml | 2 +-
tests/qemuxml2argvtest.c | 5 +-
tests/qemuxml2xmltest.c | 1 -
tests/testutils.c | 13 +-
tests/testutilsqemu.c | 18 +++
tests/vircapstest.c | 2 -
12 files changed, 132 insertions(+), 105 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [dbus PATCH v2 0/2] Make correct use of setup fixtures & cleanup
by Katerina Koukiou
diff from v1:
* fixtures patch merged
* fixed reminder flake8 issues
* added patch introducing syntax-check target in the Makefile
Katerina Koukiou (2):
tests: fix all coding style issues to comply with flake8
Add syntax-check target in Makefile.am
HACKING.md | 9 ++++++++-
Makefile.am | 6 ++++++
tests/libvirttest.py | 9 +++++----
tests/test_connect.py | 2 +-
tests/test_domain.py | 5 +++--
tests/test_interface.py | 12 +++++++-----
tests/test_network.py | 8 ++++----
tests/test_storage.py | 1 +
8 files changed, 35 insertions(+), 17 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [dbus PATCH 0/2] Make correct use of setup fixtures & cleanup
by Katerina Koukiou
Katerina Koukiou (2):
tests: {interface, node_device}_create should be used as setup
fixtures
tests: fix all coding style issues to comply with pep8
tests/libvirttest.py | 1 +
tests/test_connect.py | 9 +++++----
tests/test_domain.py | 5 +++--
tests/test_interface.py | 23 +++++++++++++----------
tests/test_network.py | 8 ++++----
tests/test_nodedev.py | 16 ++++++++--------
tests/test_storage.py | 1 +
7 files changed, 35 insertions(+), 28 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [PATCH 0/5] Couple of LXC fixes & improvements
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (5):
lxc: Refresh capabilities on virConnectGetCapabilities
lxc: Report supported huge pages
lxc: Enable under valgrind again
lxc: Don't leak @veths in virLXCProcessStart
lxc: Don't mangle @cfg refs in virLXCProcessBuildControllerCmd
src/lxc/lxc_conf.c | 4 ++++
src/lxc/lxc_driver.c | 13 +------------
src/lxc/lxc_process.c | 15 +++++++++------
3 files changed, 14 insertions(+), 18 deletions(-)
--
2.16.4
6 years, 5 months