[libvirt] [RFC/WIP] [PATCH 0/5] Add support for revert and delete operations to external disk snapshots
by Povilas Kanapickas
Hey all,
Currently libvirt only supports creation of external disk snapshots, but not
reversion and deletion which are essential for any serious use of this feature.
I've looked into implementing removal and reversion of external disk snapshots
and came up with some prototype code that works with my simple test VMs (see
attached patches).
I'd like to discuss about how these features could be implemented properly. As
I've never significantly contributed to libvirt yet, I wanted to delay the
discussion until I understand the problem space myself so that the discussion
could be productive.
My current approach is relatively simple. For snapshot deletion we either
simply remove the disk or use `qemu-img rebase` to reparent a snapshot on top
of the parent of the snapshot that is being deleted. For reversion we delete
the current overlay disk and create another that uses the image of the
snapshot we want to revert to as the backing disk.
Are the attached patches good in principle? Are there any major blockers aside
from lack of tests, code formatting, bugs and so on? Are there any design
issues which prevent a simple implementation of external disk snapshot
support that I didn't see?
If there aren't significant blockers, my plan would be to continue work on the
feature until I have something that could actually be reviewed and possibly
merged.
Regards,
Povilas
Povilas Kanapickas (5):
snapshot: Implement reverting for external disk snapshots
snapshot: Add VIR_DEBUG to qemuDomainSnapshotCreateXML()
snapshot: Support deleting external disk snapshots when deleting
snapshot: Extract qemuDomainSnapshotReparentChildrenMetadata()
snapshot: Support reparenting external disk snapshots when deleting
src/qemu/qemu_domain.c | 45 ++++-
src/qemu/qemu_driver.c | 372 +++++++++++++++++++++++++++++++++++++----
2 files changed, 379 insertions(+), 38 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] conf: fix build by using ret variable when returning from functions
by Pavel Hrdina
Introduced-by: c3a208af0d894daaa840177b749a0ecf35445a4b
Reported-by: Radoslaw Biernacki <radoslaw.biernacki(a)linaro.org>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under build-breaker rule.
src/conf/domain_conf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8cb9b2719c..13874837c2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -24512,7 +24512,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
cleanup:
virBufferFreeAndReset(&childBuf);
- return 0;
+ return ret;
}
@@ -25912,7 +25912,7 @@ virDomainSoundDefFormat(virBufferPtr buf,
cleanup:
virBufferFreeAndReset(&childBuf);
- return 0;
+ return ret;
}
@@ -25976,7 +25976,7 @@ virDomainMemballoonDefFormat(virBufferPtr buf,
cleanup:
virBufferFreeAndReset(&childrenBuf);
- return 0;
+ return ret;
}
static int
--
2.19.1
6 years, 5 months
[libvirt] [PATCH 0/3] conf: Fix some issues
by Andrea Bolognani
Fallout from merging the zPCI patches.
Andrea Bolognani (3):
conf: Fix error flow in virDomainPCIAddressEnsureAddr()
conf: Add several cleanup paths
conf: Perform error checking in virDomainDeviceInfoFormat()
src/conf/domain_addr.c | 16 ++-
src/conf/domain_conf.c | 234 +++++++++++++++++++++++++++++------------
2 files changed, 177 insertions(+), 73 deletions(-)
--
2.19.1
6 years, 5 months
[libvirt] [RFC 0/3] update NVDIMM support
by Luyao Zhong
Hi libvirt experts,
This is the RFC for updating NVDIMM support in libvirt.
QEMU has supported four more properties which libvirt has not introduced
yet, including 'align', 'pmem', 'nvdimm-persistences' and 'unarmed'.
The 'align' property allows users to specify the proper alignment. The
previous alignment can only be 4K because QEMU use pagesize as alignment.
But some backends may require alignments different from the pagesize.
The 'pmem' property allows users to specify whether the backend storage of
memory-backend-file is a real persistent memory. Then QEMU will know if
it needs to guarrantee the write persistence to the vNVDIMM backend.
The 'nvdimm-persistence' property allows users to set platform-supported
features about NVDIMM data persistence of a guest.
The 'unarmed' property allows users to mark vNVDIMM read-only. Only the
device DAX on the real NVDIMM can guarantee the guest write persistence,
so it's suggested to set 'unarmed' option to 'on' and then vNVDIMM device
will be marked as read-only.
Libvirt introduces 'alignsize', 'pmem', 'persistence' and 'unarmed' config
elements into xml corresponding to 'align', 'pmem', 'nvdimm-persistence'
and 'unarmed' properties in QEMU, and update xml parsing, formating and
qemu command-line generating process for NVDIMM.
Thanks,
Zhong, Luyao
Luyao Zhong (3):
xml: introduce more config elements for NVDIMM memory
xml: update xml parsing and formating about NVDIMM memory
qemu: update qemu command-line generating for NVDIMM memory
docs/formatdomain.html.in | 98 +++++++++++++++---
docs/schemas/domaincommon.rng | 31 +++++-
src/conf/domain_conf.c | 115 +++++++++++++++++++--
src/conf/domain_conf.h | 14 +++
src/libvirt_private.syms | 2 +
src/qemu/qemu_command.c | 25 +++++
.../memory-hotplug-nvdimm-align.args | 31 ++++++
.../memory-hotplug-nvdimm-align.xml | 58 +++++++++++
.../memory-hotplug-nvdimm-persistence.args | 31 ++++++
.../memory-hotplug-nvdimm-persistence.xml | 58 +++++++++++
.../memory-hotplug-nvdimm-pmem.args | 31 ++++++
.../memory-hotplug-nvdimm-pmem.xml | 58 +++++++++++
.../memory-hotplug-nvdimm-unarmed.args | 31 ++++++
.../memory-hotplug-nvdimm-unarmed.xml | 58 +++++++++++
tests/qemuxml2argvtest.c | 12 +++
.../memory-hotplug-nvdimm-align.xml | 1 +
.../memory-hotplug-nvdimm-persistence.xml | 1 +
.../memory-hotplug-nvdimm-pmem.xml | 1 +
.../memory-hotplug-nvdimm-unarmed.xml | 1 +
tests/qemuxml2xmltest.c | 4 +
20 files changed, 636 insertions(+), 25 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-persistence.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-unarmed.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-align.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-persistence.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-unarmed.xml
--
2.7.4
6 years, 5 months
[libvirt] [PATCH 0/2] rpc: fixing compilation error due to deprecated ssh_is_server_known()
by Julio Faracco
After 0.8.0 release, libssh deprecated ssh_is_server_known() method to
introduce ssh_session_is_known_server(). This commit check if
ssh_session_is_known_server() is available to use. If it is not, it creates
an alias to ssh_is_server_known() during the configuration.
The commits are similar to c9da6cbe and 463fa9c7.
Julio Faracco (2):
rpc: replacing ssh_is_server_known() by ssh_session_is_known_server().
m4: checking if ssh_session_is_known_server() exists.
m4/virt-libssh.m4 | 4 ++++
src/rpc/virnetlibsshsession.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
--
2.19.1
6 years, 5 months
[libvirt] [PATCH v4 00/15] Implement alternative metadata locking
by Michal Privoznik
v4 of:
https://www.redhat.com/archives/libvir-list/2018-October/msg00861.html
diff to v3:
- Introduced a config knob to enable/disable metadata locking (except
not really). We want to have a knob that enables/disables remembering
of original owner. This knob in turn enables metadata locking. The
reason is that metadata locking on its own doesn't make any sense.
Anyway, the qemu.conf change is not done (it'll be done in upcoming
patch set that implements original owner remembering), so if you want
to see these patches in action you'll need to apply the following
patch:
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 32da9a7351..0080b0d021 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -347,6 +347,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
if (!(cfg->namespaces = virBitmapNew(QEMU_DOMAIN_NS_LAST)))
goto error;
+ cfg->rememberOwner = true;
+
if (privileged &&
qemuDomainNamespaceAvailable(QEMU_DOMAIN_NS_MOUNT) &&
virBitmapSetBit(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) < 0)
- I've fixed small issues raised in review of v3.
Note that patches 01 and 02 are ACKed already but I'm sending them for
completeness (probably doesn't make much sense to merge them while this
is still under review, does it?).
Michal Prívozník (15):
virprocess: Introduce virProcessRunInFork
virprocess: Make virProcessRunInMountNamespace use virProcessRunInFork
qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr
qemu_domain: Track if domain remembers original owner
virSecurityManagerTransactionCommit: Do metadata locking iff enabled
in config
security_manager: Rework metadata locking
Revert "security_manager: Load lock plugin on init"
Revert "qemu_conf: Introduce metadata_lock_manager"
Revert "lock_manager: Allow disabling configFile for
virLockManagerPluginNew"
Revert "lock_driver: Introduce VIR_LOCK_MANAGER_ACQUIRE_ROLLBACK"
Revert "lock_driver: Introduce
VIR_LOCK_MANAGER_RESOURCE_TYPE_METADATA"
Revert "_virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom
union"
Revert "lock_driver: Introduce new
VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON"
Revert "lock_driver_lockd: Introduce
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_METADATA flag"
Revert "virlockspace: Allow caller to specify start and length offset
in virLockSpaceAcquireResource"
cfg.mk | 4 +-
src/libvirt_private.syms | 1 +
src/locking/lock_daemon_dispatch.c | 11 +-
src/locking/lock_driver.h | 12 -
src/locking/lock_driver_lockd.c | 421 ++++++++++-------------------
src/locking/lock_driver_lockd.h | 1 -
src/locking/lock_driver_sanlock.c | 44 +--
src/locking/lock_manager.c | 10 +-
src/lxc/lxc_controller.c | 3 +-
src/lxc/lxc_driver.c | 2 +-
src/qemu/qemu_conf.c | 1 -
src/qemu/qemu_conf.h | 2 +-
src/qemu/qemu_domain.c | 7 +
src/qemu/qemu_domain.h | 3 +
src/qemu/qemu_driver.c | 3 -
src/qemu/qemu_extdevice.c | 16 +-
src/qemu/qemu_extdevice.h | 4 +-
src/qemu/qemu_process.c | 9 +-
src/qemu/qemu_security.c | 87 ++++--
src/qemu/qemu_security.h | 4 +-
src/qemu/qemu_tpm.c | 24 +-
src/qemu/qemu_tpm.h | 4 +-
src/security/security_dac.c | 54 ++--
src/security/security_driver.h | 3 +-
src/security/security_manager.c | 259 +++++++++---------
src/security/security_manager.h | 22 +-
src/security/security_selinux.c | 53 ++--
src/security/security_stack.c | 5 +-
src/util/virlockspace.c | 15 +-
src/util/virlockspace.h | 4 -
src/util/virprocess.c | 82 ++++--
src/util/virprocess.h | 16 ++
tests/seclabeltest.c | 2 +-
tests/securityselinuxlabeltest.c | 2 +-
tests/securityselinuxtest.c | 2 +-
tests/testutilsqemu.c | 2 +-
tests/virlockspacetest.c | 29 +-
37 files changed, 573 insertions(+), 650 deletions(-)
--
2.18.1
6 years, 5 months
[libvirt] [PATCH v3 0/3] Add "memfd" memory backing type (resend)
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This is an alternative series from "[PATCH 0/5] Use memfd if
possible". Instead of automatically using memfd for anonymous memory
when available (as suggested by Daniel), it introduces the "memfd"
memory backing type.
Although using memfd transparently when possible is a good idea, it is
a source of various complications for migration & save/restore. This
could eventually be challenged in a different series.
*please*:
The first two patches have been modified and reviewed by John
Ferlan. Hopefully they can be merged early, regardless of the last
patch outcome, to avoid the painful rebase conflicts due to
capabilities checks introduction.
Thanks :)
v3:
- rebased, to fix capabilities check and ping the series
Marc-André Lureau (3):
qemu: add memory-backend-memfd capability check
qemu: check memory-backend-memfd.hugetlb capability
qemu: add memfd source type
docs/formatdomain.html.in | 9 +-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 10 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 69 +++++++----
src/qemu/qemu_domain.c | 12 +-
.../caps_2.12.0.aarch64.replies | 94 ++++++++++++---
.../caps_2.12.0.aarch64.xml | 4 +-
.../caps_2.12.0.ppc64.replies | 90 +++++++++++---
.../caps_2.12.0.ppc64.xml | 4 +-
.../caps_2.12.0.s390x.replies | 98 ++++++++++++----
.../caps_2.12.0.s390x.xml | 4 +-
.../caps_2.12.0.x86_64.replies | 110 +++++++++++++-----
.../caps_2.12.0.x86_64.xml | 4 +-
.../caps_3.0.0.ppc64.replies | 90 +++++++++++---
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 4 +-
.../caps_3.0.0.riscv32.replies | 86 +++++++++++---
.../caps_3.0.0.riscv32.xml | 2 +
.../caps_3.0.0.riscv64.replies | 86 +++++++++++---
.../caps_3.0.0.riscv64.xml | 2 +
.../caps_3.0.0.s390x.replies | 98 ++++++++++++----
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 4 +-
.../caps_3.0.0.x86_64.replies | 110 +++++++++++++-----
.../caps_3.0.0.x86_64.xml | 4 +-
.../memfd-memory-numa.x86_64-latest.args | 34 ++++++
tests/qemuxml2argvdata/memfd-memory-numa.xml | 36 ++++++
tests/qemuxml2argvtest.c | 2 +
29 files changed, 869 insertions(+), 204 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.xml
--
2.19.1.708.g4ede3d42df
6 years, 5 months
[libvirt] [PATCH] docs: Add notes for VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA
by Han Han
When listing snapshot with VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA, it
always returns 0 or no snapshot. Because we never implement funtions
to list no-metadata snapshot in virDomainSnapshotObjListGetNames():
if ((data.flags & VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA) ==
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA)
return 0;
Add notes for that flag.
Please update the comment and man page of that flag when no-metadata
snapshot list is implemented in the future.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
include/libvirt/libvirt-domain-snapshot.h | 5 ++++-
tools/virsh.pod | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt-domain-snapshot.h b/include/libvirt/libvirt-domain-snapshot.h
index 20771f9b1e..2e19a52a5c 100644
--- a/include/libvirt/libvirt-domain-snapshot.h
+++ b/include/libvirt/libvirt-domain-snapshot.h
@@ -93,7 +93,10 @@ char *virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
* of flag (1<<0) depends on which function it is passed to; but serves
* to toggle the per-call default of whether the listing is shallow or
* recursive. Remaining bits come in groups; if all bits from a group are
- * 0, then that group is not used to filter results. */
+ * 0, then that group is not used to filter results. Internal functions
+ * for listing no-metadata snapshots aren't implemented. Functions above
+ * will return 0 when VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA is used.
+ * */
typedef enum {
VIR_DOMAIN_SNAPSHOT_LIST_ROOTS = (1 << 0), /* Filter by snapshots
with no parents, when
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 86c041d575..b3d3840c2b 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -4689,6 +4689,9 @@ B<undefine> of a persistent domain, or be lost on B<destroy> of
a transient domain. Likewise, if I<--no-metadata> is specified,
the list will be filtered to just snapshots that exist without
the need for libvirt metadata.
+Note that - It will return no snapshot when I<--no-metadata> is
+used since internal functions for listing no-metadata snapshot
+are not implemented.
If I<--inactive> is specified, the list will be filtered to snapshots
that were taken when the domain was shut off. If I<--active> is
--
2.19.1
6 years, 5 months
[libvirt] [PATCH] [patch] docs: remove redundant words and blank lines
by luzhipeng@uniudc.com
From: ZhiPeng Lu <luzhipeng(a)uniudc.com>
Signed-off-by: ZhiPeng Lu <luzhipeng(a)uniudc.com>
---
docs/formatdomain.html.in | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 8a23b78..de25ad3 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2835,7 +2835,6 @@
</source>
<target dev='sdb' bus='scsi'/>
</disk>
- </disk>
<disk type='network' device='lun'>
<driver name='qemu' type='raw'/>
<source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
@@ -5216,7 +5215,6 @@
<virtualport>
<parameters instanceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
</virtualport>
-
</interface>
</devices>
...</pre>
@@ -5709,8 +5707,7 @@ qemu-kvm -net nic,model=? /dev/null
<host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/>
<guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
- </b>
- </interface>
+ </b></interface>
</devices>
...</pre>
@@ -6212,7 +6209,7 @@ qemu-kvm -net nic,model=? /dev/null
<b><route family='ipv4' address='192.168.122.0' prefix='24' gateway='192.168.122.1'/></b>
<b><route family='ipv4' address='192.168.122.8' gateway='192.168.122.1'/></b>
</hostdev>
-
+ ...
</devices>
...
</pre>
--
1.8.3.1
6 years, 5 months
[libvirt] [PATCH v2 0/5] qemu_domain, qemu_process: maxCpus check to non-x86 guests
by Daniel Henrique Barboza
v2:
- original patch was split in 3 patches as John Ferlan requested;
- patches 4 and 5 are cleanups;
- first patch link:
https://www.redhat.com/archives/libvir-list/2018-October/msg00251.html
Daniel Henrique Barboza (5):
qemu_process.c: adding maxCpus value to error message
qemu_process.c: make qemuValidateCpuCount public
qemu_domain.c: moving maxCpu validation to qemuDomainDefValidate
qemu_process.c: moving qemuValidateCpuCount to qemu_domain.c
qemu_process.c: removing qemuProcessStartValidateXML
src/qemu/qemu_domain.c | 27 +++++++++++++++++++
src/qemu/qemu_process.c | 57 ++++-------------------------------------
2 files changed, 32 insertions(+), 52 deletions(-)
--
2.19.1
6 years, 5 months