[libvirt] [RFC] DHCP Relay agent functionality
by TJ
Recently I needed to implement functionality to operate a DHCP relay instead of dnsmasq's DHCP server
on the virtual networks managed by libvirt.
The primary benefit of operating a relay is that the central DHCP and DNS servers for the physical
network can manage IP address allocation and hostname resolution for the entire network and, potentially, expose VMs via hostname and IP address
on the public network too, as well as being able to monitor VM instance creation for resource planning.
I originally implemented this functionality on libvirt 0.9.8 included with Ubuntu 12.04 as a hack to simply disable dnsmasq entirely and
use dhcp-helper[1] (the DHCP relay written by Simon Kelley, author of dnsmaq) although I've constructed it so that another relay-agent could be used. After proving it works well I've reworked the code
on the current libvirt master branch. If it's thought to be of use to the project please let me know.
[1] http://www.thekelleys.org.uk/dhcp-helper/
The following changes since commit 34f1a618a5c4507f27f3f467b723c9119c1db3c7:
conf: Avoid leaking of RNG device definition (2013-02-25 22:31:11 +0100)
are available in the git repository at:
git://github.com/iam-TJ/libvirt.git dhcp_relay_network
for you to fetch changes up to dfc0609403106712b205e60b53b29dc850cad68d:
docs: Describe the <dhcp> 'enable' and 'relay' attributes (2013-02-27 20:35:06 +0000)
----------------------------------------------------------------
TJ (10):
conf: DHCP - add state for DHCP Relay and On/Off switch
conf: Network - add ability to read/write XML DHCP state
conf: Network - add pointers to enabled virNetworkIpDef DHCP settings
conf: Network - keep track of active DHCP stanza in virNetworkDef
network: Bridge - use IPv4 and IPv6 active DHCP stanza pointers
network: Bridge - Add support for a DHCP Relay Agent
network: Bridge - don't offer dnsmasq DHCP services when DHCP relay is enabled
configure: Add DHCPRELAY to the set of external program definitions
Add copyright attribution for DHCP relay functionality
docs: Describe the <dhcp> 'enable' and 'relay' attributes
configure.ac | 4 +++
docs/formatnetwork.html.in | 22 +++++++++++++-
src/conf/network_conf.c | 36 +++++++++++++++++++---
src/conf/network_conf.h | 7 +++++
src/network/bridge_driver.c | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
5 files changed, 229 insertions(+), 55 deletions(-)
11 years, 9 months
[libvirt] [trivial PATCH 1/1] Fix a message typo
by Serge Hallyn
As pointed out in
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1034661
The sentence
"The function of PCI device addresses must less than 8"
does not quite make sense. Update that to read
"The function of PCI device addresses must be less than 8"
Signed-off-by: Serge Hallyn <serge.hallyn(a)ubuntu.com>
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f8f3ade..201fac1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1743,7 +1743,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
if (info->addr.pci.function > 7) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("The function of PCI device addresses must "
- "less than 8"));
+ "be less than 8"));
return -1;
}
} else {
--
1.8.1.2
11 years, 9 months
[libvirt] [PATCH] Revert hack for autodestroy in qemuProcessStop
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
This reverts the hack done in
commit 568a6cda277f04ab9baaeb97490e548b7b608aa6
Author: Jiri Denemark <jdenemar(a)redhat.com>
Date: Fri Feb 15 15:11:47 2013 +0100
qemu: Avoid deadlock in autodestroy
since we now have a fix which avoids the deadlock scenario
entirely
---
src/qemu/qemu_conf.h | 4 ----
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_process.c | 8 +-------
3 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index d547d97..6bb3dee 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -254,10 +254,6 @@ struct qemuDomainDiskInfo {
int io_status;
};
-/*
- * To avoid a certain deadlock this callback must never call any
- * virQEMUCloseCallbacks* API.
- */
typedef virDomainObjPtr (*virQEMUCloseCallback)(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 30e6b97..dacbb54 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -138,7 +138,6 @@ struct _qemuDomainObjPrivate {
bool gotShutdown;
bool beingDestroyed;
- bool autoDestroyed;
char *pidfile;
int nvcpupids;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1b9eede..9f1507a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4232,8 +4232,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
qemuDomainCleanupRun(driver, vm);
/* Stop autodestroy in case guest is restarted */
- if (!priv->autoDestroyed)
- qemuProcessAutoDestroyRemove(driver, vm);
+ qemuProcessAutoDestroyRemove(driver, vm);
/* now that we know it's stopped call the hook if present */
if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
@@ -4614,13 +4613,8 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver,
VIR_DEBUG("Killing domain");
- /* We need to prevent qemuProcessStop from removing this function from
- * closeCallbacks since that would cause a deadlock.
- */
- priv->autoDestroyed = true;
qemuProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED,
VIR_QEMU_PROCESS_STOP_MIGRATED);
- priv->autoDestroyed = false;
virDomainAuditStop(dom, "destroyed");
event = virDomainEventNewFromObj(dom,
--
1.7.11.7
11 years, 9 months
[libvirt] [PATCH] Fix deadlock in QEMU close callback APIs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
There is a lock ordering problem in the QEMU close callback
APIs.
When starting a guest we have a lock on the VM. We then
set a autodestroy callback, which acquires a lock on the
close callbacks.
When running auto-destroy, we obtain a lock on the close
callbacks, then run each callbacks - which obtains a lock
on the VM.
This causes deadlock if anyone tries to start a VM, while
autodestroy is taking place.
The fix is to do autodestroy in 2 phases. First obtain
all the callbacks and remove them from the list under
the close callback lock. Then invoke each callback
from outside the close callback lock.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_conf.c | 106 ++++++++++++++++++++++++++++++++++++++++++--------
src/util/virnetlink.c | 5 ++-
2 files changed, 92 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 1cd4b7c..f3b09cf 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -797,20 +797,37 @@ virQEMUCloseCallbacksGet(virQEMUCloseCallbacksPtr closeCallbacks,
return cb;
}
+
+typedef struct _virQEMUCloseCallbacksListEntry virQEMUCloseCallbacksListEntry;
+typedef virQEMUCloseCallbacksListEntry *virQEMUCloseCallbacksListEntryPtr;
+struct _virQEMUCloseCallbacksListEntry {
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ virQEMUCloseCallback callback;
+};
+
+
+typedef struct _virQEMUCloseCallbacksList virQEMUCloseCallbacksList;
+typedef virQEMUCloseCallbacksList *virQEMUCloseCallbacksListPtr;
+struct _virQEMUCloseCallbacksList {
+ size_t nentries;
+ virQEMUCloseCallbacksListEntryPtr entries;
+};
+
+
struct virQEMUCloseCallbacksData {
- virHashTablePtr list;
- virQEMUDriverPtr driver;
virConnectPtr conn;
+ virQEMUCloseCallbacksListPtr list;
+ bool oom;
};
+
static void
-virQEMUCloseCallbacksRunOne(void *payload,
+virQEMUCloseCallbacksGetOne(void *payload,
const void *key,
void *opaque)
{
struct virQEMUCloseCallbacksData *data = opaque;
qemuDriverCloseDefPtr closeDef = payload;
- virDomainObjPtr dom;
const char *uuidstr = key;
unsigned char uuid[VIR_UUID_BUFLEN];
@@ -823,35 +840,90 @@ virQEMUCloseCallbacksRunOne(void *payload,
if (data->conn != closeDef->conn || !closeDef->cb)
return;
- if (!(dom = virDomainObjListFindByUUID(data->driver->domains, uuid))) {
- VIR_DEBUG("No domain object with UUID %s", uuidstr);
+ if (VIR_EXPAND_N(data->list->entries,
+ data->list->nentries, 1) < 0) {
+ data->oom = true;
return;
}
- dom = closeDef->cb(data->driver, dom, data->conn);
- if (dom)
- virObjectUnlock(dom);
+ memcpy(data->list->entries[data->list->nentries - 1].uuid,
+ uuid, VIR_UUID_BUFLEN);
+ data->list->entries[data->list->nentries - 1].callback = closeDef->cb;
+}
+
+
+static virQEMUCloseCallbacksListPtr
+virQEMUCloseCallbacksGetForConn(virQEMUCloseCallbacksPtr closeCallbacks,
+ virConnectPtr conn)
+{
+ virQEMUCloseCallbacksListPtr list = NULL;
+ struct virQEMUCloseCallbacksData data;
+
+ if (VIR_ALLOC(list) < 0) {
+ virReportOOMError();
+ return NULL;
+ }
+
+ data.conn = conn;
+ data.list = list;
+ data.oom = false;
+
+ virHashForEach(closeCallbacks->list, virQEMUCloseCallbacksGetOne, &data);
- virHashRemoveEntry(data->list, uuid);
+ if (data.oom) {
+ VIR_FREE(list->entries);
+ VIR_FREE(list);
+ virReportOOMError();
+ return NULL;
+ }
+
+ return list;
}
+
void
virQEMUCloseCallbacksRun(virQEMUCloseCallbacksPtr closeCallbacks,
virConnectPtr conn,
virQEMUDriverPtr driver)
{
- struct virQEMUCloseCallbacksData data = {
- .driver = driver,
- .conn = conn
- };
+ virQEMUCloseCallbacksListPtr list;
+ size_t i;
VIR_DEBUG("conn=%p", conn);
- virObjectLock(closeCallbacks);
- data.list = closeCallbacks->list;
- virHashForEach(data.list, virQEMUCloseCallbacksRunOne, &data);
+ /* We must not hold the lock while running the callbacks,
+ * so first we obtain the list of callbacks, then remove
+ * them all from the hash. At that point we can release
+ * the lock and run the callbacks safely. */
+ virObjectLock(closeCallbacks);
+ list = virQEMUCloseCallbacksGetForConn(closeCallbacks, conn);
+ if (!list)
+ return;
+
+ for (i = 0 ; i < list->nentries ; i++) {
+ virHashRemoveEntry(closeCallbacks->list,
+ list->entries[i].uuid);
+ }
virObjectUnlock(closeCallbacks);
+
+ for (i = 0 ; i < list->nentries ; i++) {
+ virDomainObjPtr vm;
+
+ if (!(vm = virDomainObjListFindByUUID(driver->domains,
+ list->entries[i].uuid))) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(list->entries[i].uuid, uuidstr);
+ VIR_DEBUG("No domain object with UUID %s", uuidstr);
+ continue;
+ }
+
+ vm = list->entries[i].callback(driver, vm, conn);
+ if (vm)
+ virObjectUnlock(vm);
+ }
+ VIR_FREE(list->entries);
+ VIR_FREE(list);
}
struct _qemuSharedDiskEntry {
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 0b36fdc..8b47ede 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -335,8 +335,9 @@ virNetlinkEventCallback(int watch,
if (length == 0)
return;
if (length < 0) {
- virReportSystemError(errno,
- "%s", _("nl_recv returned with error"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("nl_recv returned with error: %s"),
+ nl_geterror(length));
return;
}
--
1.7.11.7
11 years, 9 months
[libvirt] [PATCH] Fix crash in QEMU auto-destroy with transient guests
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When the auto-destroy callback runs it is supposed to return
NULL if the virDomainObjPtr is no longer valid. It was not
doing this for transient guests, so we tried to virObjectUnlock
a mutex which had been freed. This often led to a crash.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index db95d6e..1b9eede 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4629,8 +4629,10 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver,
if (!qemuDomainObjEndJob(driver, dom))
dom = NULL;
- if (dom && !dom->persistent)
+ if (dom && !dom->persistent) {
qemuDomainRemoveInactive(driver, dom);
+ dom = NULL;
+ }
if (event)
qemuDomainEventQueue(driver, event);
--
1.7.11.7
11 years, 9 months
[libvirt] [PATCH v2] vl.c: Support multiple CPU ranges on -numa option
by Eduardo Habkost
This allows ":" to be used a separator between each CPU range, so the
command-line may look like:
-numa node,cpus=A-B:C-D
Note that the following format, currently used by libvirt:
-numa nodes,cpus=A-B,C-D
will _not_ work, as "," is the option separator for the command-line
option parser, and it would require changing the -numa option parsing
code to handle "cpus" as a special case.
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
Changes v2:
- Use ":" as separator
- Document the new format
---
qemu-options.hx | 10 ++++++++--
vl.c | 14 +++++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 4bc9c85..b135044 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -95,12 +95,18 @@ specifies the maximum number of hotpluggable CPUs.
ETEXI
DEF("numa", HAS_ARG, QEMU_OPTION_numa,
- "-numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node]\n", QEMU_ARCH_ALL)
+ "-numa node[,mem=size][,cpus=cpu[-cpu][:...]][,nodeid=node]\n", QEMU_ARCH_ALL)
STEXI
@item -numa @var{opts}
@findex -numa
Simulate a multi node NUMA system. If mem and cpus are omitted, resources
-are split equally.
+are split equally. Multiple CPU ranges in the "cpus" option may be separated
+by colons. e.g.:
+
+@example
+-numa node,mem=1024,cpus=0-1:4-5:8-9
+-numa node,mem=1024,cpus=2-3:6-7:10-11
+@end example
ETEXI
DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
diff --git a/vl.c b/vl.c
index 955d2ff..fe632db 100644
--- a/vl.c
+++ b/vl.c
@@ -1244,7 +1244,7 @@ char *get_boot_devices_list(size_t *size)
return list;
}
-static void numa_node_parse_cpus(int nodenr, const char *cpus)
+static void numa_node_parse_cpu_range(int nodenr, const char *cpus)
{
char *endptr;
unsigned long long value, endvalue;
@@ -1288,6 +1288,18 @@ error:
exit(1);
}
+static void numa_node_parse_cpus(int nodenr, const char *option)
+{
+ char **parts;
+ int i;
+
+ parts = g_strsplit(option, ":", 0);
+ for (i = 0; parts[i]; i++) {
+ numa_node_parse_cpu_range(nodenr, parts[i]);
+ }
+ g_strfreev(parts);
+}
+
static void numa_add(const char *optarg)
{
char option[128];
--
1.8.1
11 years, 9 months
[libvirt] [PATCHv2] qemu: fix graphics port allocation
by Ján Tomko
Only release ports that have been allocated before.
This fixes these issues:
* trying to release ports when qemuProcessStart fails before port
allocation
* trying to release the SPICE TLS port if spice_tls is 0
* failing to release SPICE port with autoport=off (when only one
of them is -1)
---
v1: https://www.redhat.com/archives/libvir-list/2013-February/msg01464.html
Use a pair of booleans in domain private data instead of a new field
in the domain definition.
src/qemu/qemu_domain.h | 5 +++++
src/qemu/qemu_process.c | 28 +++++++++++++++++++---------
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 30e6b97..bac4d8b 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -163,6 +163,11 @@ struct _qemuDomainObjPrivate {
qemuDomainCleanupCallback *cleanupCallbacks;
size_t ncleanupCallbacks;
size_t ncleanupCallbacks_max;
+
+ /* Track port allocation state for SPICE
+ * (only one device is allowed per domain) */
+ bool spicePortAllocated;
+ bool spiceTlsPortAllocated;
};
struct qemuDomainWatchdogEvent
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b9fdcd2..1442cc7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3633,6 +3633,7 @@ int qemuProcessStart(virConnectPtr conn,
}
graphics->data.spice.port = port;
+ priv->spicePortAllocated = true;
}
if (cfg->spiceTLS &&
(graphics->data.spice.autoport ||
@@ -3645,10 +3646,12 @@ int qemuProcessStart(virConnectPtr conn,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused port for SPICE TLS"));
virPortAllocatorRelease(driver->remotePorts, port);
+ priv->spicePortAllocated = false;
goto cleanup;
}
graphics->data.spice.tlsPort = tlsPort;
+ priv->spiceTlsPortAllocated = true;
}
}
@@ -4311,22 +4314,29 @@ retry:
qemuProcessRemoveDomainStatus(driver, vm);
- /* Remove VNC and Spice ports from port reservation bitmap, but only if
- they were reserved by the driver (autoport=yes)
+ /* Remove VNC and SPICE ports from port reservation bitmap, but only if
+ they were reserved by the driver:
+ autoport = yes and non-zero port for VNC,
+ priv->spice(Tls)PortAllocated for SPICE.
*/
for (i = 0 ; i < vm->def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
- graphics->data.vnc.autoport) {
+ graphics->data.vnc.autoport && graphics->data.vnc.port) {
ignore_value(virPortAllocatorRelease(driver->remotePorts,
graphics->data.vnc.port));
}
- if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
- graphics->data.spice.autoport) {
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.spice.port));
- ignore_value(virPortAllocatorRelease(driver->remotePorts,
- graphics->data.spice.tlsPort));
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ if (priv->spicePortAllocated) {
+ ignore_value(virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.spice.port));
+ priv->spicePortAllocated = false;
+ }
+ if (priv->spiceTlsPortAllocated) {
+ ignore_value(virPortAllocatorRelease(driver->remotePorts,
+ graphics->data.spice.tlsPort));
+ priv->spiceTlsPortAllocated = false;
+ }
}
}
--
1.7.12.4
11 years, 9 months
[libvirt] [PATCH 1/1] Clear PIIX3/PIIX4_USB capabilities for non-X86 platforms
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
Currently, PIIX3/PIIX4_USB capabilities are enabled for other platforms.
Actually, it is only supported for X86.
So this patch is to clear the capabilities for non-X86 platforms.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/conf/domain_conf.c | 1 +
src/qemu/qemu_capabilities.c | 3 +++
src/qemu/qemu_command.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 995cf0c..d57334a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10453,6 +10453,7 @@ virDomainDefParseXML(virCapsPtr caps,
VIR_FREE(nodes);
/* If graphics are enabled, there's an implicit PS2 mouse */
+ /* Todo: Add implicit USB mouse and keyboard for ppc64 */
if (def->ngraphics > 0) {
virDomainInputDefPtr input;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 40022c1..ef5c69a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1307,8 +1307,11 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "hda-micro", QEMU_CAPS_HDA_MICRO },
{ "ccid-card-emulated", QEMU_CAPS_CCID_EMULATED },
{ "ccid-card-passthru", QEMU_CAPS_CCID_PASSTHRU },
+#if defined (__x86_64__) || \
+ defined (__i386__)
{ "piix3-usb-uhci", QEMU_CAPS_PIIX3_USB_UHCI },
{ "piix4-usb-uhci", QEMU_CAPS_PIIX4_USB_UHCI },
+#endif
{ "usb-ehci", QEMU_CAPS_USB_EHCI },
{ "ich9-usb-ehci1", QEMU_CAPS_ICH9_USB_EHCI1 },
{ "vt82c686b-usb-uhci", QEMU_CAPS_VT82C686B_USB_UHCI },
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1c9bfc9..0b18be0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5784,6 +5784,8 @@ qemuBuildCommandLine(virConnectPtr conn,
} else if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
cont->model == -1 &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
+ /* usblegacy is used for ppc64 temporarily */
+ /* Todo: support -device xxx on ppc64 platform */
if (usblegacy) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Multiple legacy USB controllers are "
--
1.7.10.1
11 years, 9 months
[libvirt] [PATCHv3 0/5] snapshot revert-and-create
by Eric Blake
v2 was here:
https://www.redhat.com/archives/libvir-list/2012-November/msg00818.html
One patch from v2 has already been committed. This patch additionally
adds a qemu implementation for the new flag, and I have tested creation
of offline branches (I still need to test creation of a branch from a
disk-only or online external snapshot). I've also started documenting
my plans for a new revert FOLLOW flag, which updates to the current
state of external files (rather than reverting completely to the
point where the snapshot was taken); once that is working, then
implementing the combination of createXML(LIVE|BRANCH) will really
be creating the branch, then farming out to revert(FOLLOW) to switch
over to the new branch.
Eric Blake (5):
snapshot: add revert-and-create branching of external snapshots
snapshot: prepare to parse new XML
snapshot: actually compute branch definition from XML
snapshot: support revert-and-create branching in qemu
snapshot: add another revert API flag
docs/formatsnapshot.html.in | 16 ++++-
docs/schemas/domainsnapshot.rng | 45 ++++++------
include/libvirt/libvirt.h.in | 6 ++
src/conf/snapshot_conf.c | 118 ++++++++++++++++++++++++++++---
src/conf/snapshot_conf.h | 2 +
src/esx/esx_driver.c | 2 +-
src/libvirt.c | 41 +++++++++--
src/qemu/qemu_driver.c | 50 +++++++++++--
src/vbox/vbox_tmpl.c | 2 +-
tests/domainsnapshotxml2xmlin/branch.xml | 5 ++
tests/domainsnapshotxml2xmltest.c | 2 +-
tools/virsh-snapshot.c | 44 +++++++++---
tools/virsh.pod | 25 ++++++-
13 files changed, 300 insertions(+), 58 deletions(-)
create mode 100644 tests/domainsnapshotxml2xmlin/branch.xml
--
1.7.11.7
11 years, 9 months