[libvirt] [PATCH] conf: Don't drop console definition on domain restart
by Michal Privoznik
One of my latest patches 2e37bf42d28d8bb5d045b206587c64643c64d02a
copy serial console definition. On domain shutdown we save this
info into state XML. However, later on the daemon start we simply
drop this info and since we are not re-reading qemu log,
vm->def->consoles[0] does not get populated with copy. Therefore
we need to avoid dropping console definition if it is just alias
for serial console.
---
src/conf/domain_conf.c | 76 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 69 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d365cee..f04e477 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1042,6 +1042,57 @@ void virDomainChrSourceDefFree(virDomainChrSourceDefPtr def)
VIR_FREE(def);
}
+/* virDomainChrSourceDefIsEqual:
+ * @src: Source
+ * @tgt: Target
+ *
+ * Compares source and target if they contain
+ * the same information.
+ */
+static bool
+virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
+ const virDomainChrSourceDef *tgt)
+{
+ if (tgt->type != src->type)
+ return false;
+
+ switch (src->type) {
+ case VIR_DOMAIN_CHR_TYPE_PTY:
+ case VIR_DOMAIN_CHR_TYPE_DEV:
+ case VIR_DOMAIN_CHR_TYPE_FILE:
+ case VIR_DOMAIN_CHR_TYPE_PIPE:
+ return STREQ_NULLABLE(src->data.file.path, tgt->data.file.path);
+ break;
+ case VIR_DOMAIN_CHR_TYPE_UDP:
+ return STREQ_NULLABLE(src->data.udp.bindHost, tgt->data.udp.bindHost) &&
+ STREQ_NULLABLE(src->data.udp.bindService, tgt->data.udp.bindService) &&
+ STREQ_NULLABLE(src->data.udp.connectHost, tgt->data.udp.connectHost) &&
+ STREQ_NULLABLE(src->data.udp.connectService, tgt->data.udp.connectService);
+ break;
+ case VIR_DOMAIN_CHR_TYPE_TCP:
+ return src->data.tcp.listen == tgt->data.tcp.listen &&
+ src->data.tcp.protocol == tgt->data.tcp.protocol &&
+ STREQ_NULLABLE(src->data.tcp.host, tgt->data.tcp.host) &&
+ STREQ_NULLABLE(src->data.tcp.service, tgt->data.tcp.service);
+ break;
+ case VIR_DOMAIN_CHR_TYPE_UNIX:
+ return src->data.nix.listen == tgt->data.nix.listen &&
+ STREQ_NULLABLE(src->data.nix.path, tgt->data.nix.path);
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_VC:
+ case VIR_DOMAIN_CHR_TYPE_STDIO:
+ case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
+ /* nada */
+ return true;
+ }
+
+ /* This should happen only on new,
+ * yet unhandled type */
+
+ return false;
+}
+
void virDomainChrDefFree(virDomainChrDefPtr def)
{
if (!def)
@@ -7308,6 +7359,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
goto no_memory;
for (i = 0 ; i < n ; i++) {
+ bool create_stub = true;
virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
def,
nodes[i],
@@ -7325,7 +7377,9 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
* So if we see that this console device should
* be a serial device, then we move the config
* over to def->serials[0] (or discard it if
- * that already exists
+ * that already exists). However, given console
+ * can already be filled with aliased data of
+ * def->serials[0]. Keep it then.
*
* We then fill def->consoles[0] with a stub
* just so we get sequencing correct for consoles
@@ -7341,7 +7395,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
/* Either discard or move this chr to the serial config */
if (def->nserials != 0) {
- virDomainChrDefFree(chr);
+ if (virDomainChrSourceDefIsEqual(&def->serials[0]->source,
+ &chr->source)) {
+ /* Alias to def->serial[0]. Skip it */
+ create_stub = false;
+ } else {
+ virDomainChrDefFree(chr);
+ }
} else {
if (VIR_ALLOC_N(def->serials, 1) < 0) {
virDomainChrDefFree(chr);
@@ -7353,11 +7413,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
chr->target.port = 0;
}
- /* And create a stub placeholder */
- if (VIR_ALLOC(chr) < 0)
- goto no_memory;
- chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
- chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+ if (create_stub) {
+ /* And create a stub placeholder */
+ if (VIR_ALLOC(chr) < 0)
+ goto no_memory;
+ chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+ chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+ }
}
chr->target.port = i;
--
1.7.3.4
13 years
[libvirt] [PATCH] examples: Use virConnectOpenAuth in events-c
by Jiri Denemark
---
examples/domain-events/events-c/event-test.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index 7c99222..cb1b568 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -353,7 +353,9 @@ int main(int argc, char **argv)
virEventRegisterDefaultImpl();
virConnectPtr dconn = NULL;
- dconn = virConnectOpenReadOnly (argv[1] ? argv[1] : NULL);
+ dconn = virConnectOpenAuth(argc > 1 ? argv[1] : NULL,
+ virConnectAuthPtrDefault,
+ VIR_CONNECT_RO);
if (!dconn) {
printf("error opening\n");
return -1;
--
1.7.8.rc3
13 years
[libvirt] [PATCH] build: Properly generate and check virkeepaliveprotocol-structs
by Jiri Denemark
This fixes make dist broken by recent keepalive series
---
src/Makefile.am | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index e8f20de..33a32a8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -247,14 +247,15 @@ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
# The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
+struct_prefix = (remote_|qemu_|virNet|keepalive_)
PDWTAGS = \
$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
pdwtags --verbose $(<:.lo=.$(OBJEXT)) \
| perl -0777 -n \
-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {' \
- -e ' if ($$p =~ /^(struct|enum) (remote_|qemu_|virNet)/ ||' \
- -e ' $$p =~ /^enum {/) {' \
+ -e ' if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||' \
+ -e ' $$p =~ /^enum {/) {' \
-e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \
-e ' $$p =~ s!\s+\n!\n!sg;' \
-e ' $$p =~ s!\s+$$!!;' \
@@ -267,7 +268,7 @@ PDWTAGS = \
-e ' print "/* -*- c -*- */\n";' \
-e '}' \
-e 'END {' \
- -e ' if ($$n < 3) {' \
+ -e ' if ($$n < 1) {' \
-e ' warn "WARNING: your pdwtags program is too old\n";' \
-e ' warn "WARNING: skipping the $@ test\n";' \
-e ' warn "WARNING: install dwarves-1.3 or newer\n";' \
@@ -295,6 +296,7 @@ $(srcdir)/%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
$(srcdir)/virnetprotocol-structs: libvirt_net_rpc_la-virnetprotocol.lo
$(PDWTAGS)
$(srcdir)/virkeepaliveprotocol-structs: libvirt_net_rpc_la-virkeepaliveprotocol.lo
+ $(PDWTAGS)
else !WITH_REMOTE
# These generated files must live in git, because they cannot be re-generated
# when configured --without-remote.
--
1.7.8.rc3
13 years
[libvirt] [PATCH] Fix version numbers for isAlive and setKeepAlive driver APIs
by Jiri Denemark
---
Pushed as trivial.
src/esx/esx_driver.c | 2 +-
src/hyperv/hyperv_driver.c | 2 +-
src/libxl/libxl_driver.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/openvz/openvz_driver.c | 2 +-
src/phyp/phyp_driver.c | 2 +-
src/qemu/qemu_driver.c | 2 +-
src/remote/remote_driver.c | 4 ++--
src/test/test_driver.c | 2 +-
src/uml/uml_driver.c | 2 +-
src/vbox/vbox_tmpl.c | 2 +-
src/vmware/vmware_driver.c | 2 +-
src/xen/xen_driver.c | 2 +-
src/xenapi/xenapi_driver.c | 2 +-
14 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 0b39ef1..f8b3c7a 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -5013,7 +5013,7 @@ static virDriver esxDriver = {
.domainSnapshotCurrent = esxDomainSnapshotCurrent, /* 0.8.0 */
.domainRevertToSnapshot = esxDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = esxDomainSnapshotDelete, /* 0.8.0 */
- .isAlive = esxIsAlive, /* 0.9.7 */
+ .isAlive = esxIsAlive, /* 0.9.8 */
};
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 7665a76..27c8747 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1293,7 +1293,7 @@ static virDriver hypervDriver = {
.domainManagedSave = hypervDomainManagedSave, /* 0.9.5 */
.domainHasManagedSaveImage = hypervDomainHasManagedSaveImage, /* 0.9.5 */
.domainManagedSaveRemove = hypervDomainManagedSaveRemove, /* 0.9.5 */
- .isAlive = hypervIsAlive, /* 0.9.7 */
+ .isAlive = hypervIsAlive, /* 0.9.8 */
};
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f21afe1..7cc32ad 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3957,7 +3957,7 @@ static virDriver libxlDriver = {
.domainIsUpdated = libxlDomainIsUpdated, /* 0.9.0 */
.domainEventRegisterAny = libxlDomainEventRegisterAny, /* 0.9.0 */
.domainEventDeregisterAny = libxlDomainEventDeregisterAny, /* 0.9.0 */
- .isAlive = libxlIsAlive, /* 0.9.7 */
+ .isAlive = libxlIsAlive, /* 0.9.8 */
};
static virStateDriver libxlStateDriver = {
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 30305d8..a219539 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3279,7 +3279,7 @@ static virDriver lxcDriver = {
.domainEventRegisterAny = lxcDomainEventRegisterAny, /* 0.8.0 */
.domainEventDeregisterAny = lxcDomainEventDeregisterAny, /* 0.8.0 */
.domainOpenConsole = lxcDomainOpenConsole, /* 0.8.6 */
- .isAlive = lxcIsAlive, /* 0.9.7 */
+ .isAlive = lxcIsAlive, /* 0.9.8 */
};
static virStateDriver lxcStateDriver = {
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 7872c0b..03bf21a 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -1718,7 +1718,7 @@ static virDriver openvzDriver = {
.domainIsActive = openvzDomainIsActive, /* 0.7.3 */
.domainIsPersistent = openvzDomainIsPersistent, /* 0.7.3 */
.domainIsUpdated = openvzDomainIsUpdated, /* 0.8.6 */
- .isAlive = openvzIsAlive, /* 0.9.7 */
+ .isAlive = openvzIsAlive, /* 0.9.8 */
};
int openvzRegister(void) {
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index cab2812..e08b1b6 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -3812,7 +3812,7 @@ static virDriver phypDriver = {
.isEncrypted = phypIsEncrypted, /* 0.7.3 */
.isSecure = phypIsSecure, /* 0.7.3 */
.domainIsUpdated = phypIsUpdated, /* 0.8.6 */
- .isAlive = phypIsAlive, /* 0.9.7 */
+ .isAlive = phypIsAlive, /* 0.9.8 */
};
static virStorageDriver phypStorageDriver = {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 375cf89..6cfdd1d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10912,7 +10912,7 @@ static virDriver qemuDriver = {
.domainGetBlockJobInfo = qemuDomainGetBlockJobInfo, /* 0.9.4 */
.domainBlockJobSetSpeed = qemuDomainBlockJobSetSpeed, /* 0.9.4 */
.domainBlockPull = qemuDomainBlockPull, /* 0.9.4 */
- .isAlive = qemuIsAlive, /* 0.9.7 */
+ .isAlive = qemuIsAlive, /* 0.9.8 */
};
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 915b02f..cc8f580 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4616,8 +4616,8 @@ static virDriver remote_driver = {
.domainGetBlockJobInfo = remoteDomainGetBlockJobInfo, /* 0.9.4 */
.domainBlockJobSetSpeed = remoteDomainBlockJobSetSpeed, /* 0.9.4 */
.domainBlockPull = remoteDomainBlockPull, /* 0.9.4 */
- .setKeepAlive = remoteSetKeepAlive, /* 0.9.7 */
- .isAlive = remoteIsAlive, /* 0.9.7 */
+ .setKeepAlive = remoteSetKeepAlive, /* 0.9.8 */
+ .isAlive = remoteIsAlive, /* 0.9.8 */
};
static virNetworkDriver network_driver = {
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 180f365..ce94a17 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5629,7 +5629,7 @@ static virDriver testDriver = {
.domainIsUpdated = testDomainIsUpdated, /* 0.8.6 */
.domainEventRegisterAny = testDomainEventRegisterAny, /* 0.8.0 */
.domainEventDeregisterAny = testDomainEventDeregisterAny, /* 0.8.0 */
- .isAlive = testIsAlive, /* 0.9.7 */
+ .isAlive = testIsAlive, /* 0.9.8 */
};
static virNetworkDriver testNetworkDriver = {
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index aedf650..30c2086 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2603,7 +2603,7 @@ static virDriver umlDriver = {
.domainEventRegisterAny = umlDomainEventRegisterAny, /* 0.9.4 */
.domainEventDeregisterAny = umlDomainEventDeregisterAny, /* 0.9.4 */
.domainOpenConsole = umlDomainOpenConsole, /* 0.8.6 */
- .isAlive = umlIsAlive, /* 0.9.7 */
+ .isAlive = umlIsAlive, /* 0.9.8 */
};
static int
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 58c8af6..9b74a7b 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -9199,7 +9199,7 @@ virDriver NAME(Driver) = {
.domainSnapshotCurrent = vboxDomainSnapshotCurrent, /* 0.8.0 */
.domainRevertToSnapshot = vboxDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = vboxDomainSnapshotDelete, /* 0.8.0 */
- .isAlive = vboxIsAlive, /* 0.9.7 */
+ .isAlive = vboxIsAlive, /* 0.9.8 */
};
virNetworkDriver NAME(NetworkDriver) = {
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 987a7a8..a9873ba 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -996,7 +996,7 @@ static virDriver vmwareDriver = {
.domainUndefineFlags = vmwareDomainUndefineFlags, /* 0.9.4 */
.domainIsActive = vmwareDomainIsActive, /* 0.8.7 */
.domainIsPersistent = vmwareDomainIsPersistent, /* 0.8.7 */
- .isAlive = vmwareIsAlive, /* 0.9.7 */
+ .isAlive = vmwareIsAlive, /* 0.9.8 */
};
int
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 6b54a65..c0d4505 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2256,7 +2256,7 @@ static virDriver xenUnifiedDriver = {
.domainEventRegisterAny = xenUnifiedDomainEventRegisterAny, /* 0.8.0 */
.domainEventDeregisterAny = xenUnifiedDomainEventDeregisterAny, /* 0.8.0 */
.domainOpenConsole = xenUnifiedDomainOpenConsole, /* 0.8.6 */
- .isAlive = xenUnifiedIsAlive, /* 0.9.7 */
+ .isAlive = xenUnifiedIsAlive, /* 0.9.8 */
};
/**
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 8017894..78137d4 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -1956,7 +1956,7 @@ static virDriver xenapiDriver = {
.nodeGetCellsFreeMemory = xenapiNodeGetCellsFreeMemory, /* 0.8.0 */
.nodeGetFreeMemory = xenapiNodeGetFreeMemory, /* 0.8.0 */
.domainIsUpdated = xenapiDomainIsUpdated, /* 0.8.6 */
- .isAlive = xenapiIsAlive, /* 0.9.7 */
+ .isAlive = xenapiIsAlive, /* 0.9.8 */
};
/**
--
1.7.8.rc3
13 years
[libvirt] 'savevm/loadvm' monitor command sequence losing mouse state across a VM restore
by Vincent Passaro
All
eblake on #virt requested that I ask the question here before posting on
bugzilla, so I wanted to check if anyone has seen this issue.
I create a vm snapshot (with F16) using virsh snapshot-create
I then restore the vm with virsh snapshot-restore
After the restore succeeds I loose the ability to interact with the vm via
mouse. Keyboard remains functioning, I can send commands to it via the
Spice Console (CTRL-DEL), etc.
I have tired killing X and restarting the machine with no success. To
restore keyboard functionality I have had to restart libvirtd.
Thoughts?
R/
Vince
13 years
[libvirt] [PATCH] redefine pool after pool creation failure
by Wen Ruo Lv
Redefine pool after pool creation failure,give out err msg for non-exsisted vg when starting pool.
ref:
http://www.redhat.com/archives/libvir-list/2011-November/msg01152.html
http://www.redhat.com/archives/libvir-list/2011-November/msg01152.html
src/storage/storage_backend_logical.c:just give out err msg for non-exsisted vg,not combine pool-build in pool-create ,since undo build for kinds of pool(iscsi,multipath) when err occours cause a lot of trouble.
src/storage/storage_driver.c:add redefinition of pool,pool may change in pool-start,redefine it after free the pool
Signed-off-by: Wen Ruo Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/storage/storage_backend_logical.c | 10 ++++++++++
src/storage/storage_driver.c | 29 +++++++++++++++++++++++++----
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 3c3e736..994c792 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -50,6 +50,16 @@ virStorageBackendLogicalSetActive(virStoragePoolObjPtr pool,
{
const char *cmdargv[4];
+ cmdargv[0] = VGS;
+ cmdargv[1] = pool->def->source.name;
+ cmdargv[2] = NULL;
+
+ if (virRun(cmdargv, NULL) < 0) {
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR,
+ _("vg '%s' does not exsist,try pool-build"), pool->def->source.name);
+ return -1;
+ }
+
cmdargv[0] = VGCHANGE;
cmdargv[1] = on ? "-ay" : "-an";
cmdargv[2] = pool->def->source.name;
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 8c2d6e1..a5cbafe 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -526,6 +526,7 @@ storagePoolCreate(virConnectPtr conn,
virStoragePoolObjPtr pool = NULL;
virStoragePoolPtr ret = NULL;
virStorageBackendPtr backend;
+ int duppool;
virCheckFlags(0, NULL);
@@ -533,7 +534,7 @@ storagePoolCreate(virConnectPtr conn,
if (!(def = virStoragePoolDefParseString(xml)))
goto cleanup;
- if (virStoragePoolObjIsDuplicate(&driver->pools, def, 1) < 0)
+ if ((duppool = virStoragePoolObjIsDuplicate(&driver->pools, def, 1)) < 0)
goto cleanup;
if (virStoragePoolSourceFindDuplicate(&driver->pools, def) < 0)
@@ -544,26 +545,46 @@ storagePoolCreate(virConnectPtr conn,
if (!(pool = virStoragePoolObjAssignDef(&driver->pools, def)))
goto cleanup;
- def = NULL;
if (backend->startPool &&
backend->startPool(conn, pool) < 0) {
virStoragePoolObjRemove(&driver->pools, pool);
- pool = NULL;
+
+ if (duppool) {
+ if (!(def = virStoragePoolDefParseString(xml)))
+ goto cleanup;
+
+ pool = virStoragePoolObjAssignDef(&driver->pools, def);
+ }
+ else
+ pool = NULL;
+
+ def = NULL;
goto cleanup;
}
if (backend->refreshPool(conn, pool) < 0) {
if (backend->stopPool)
backend->stopPool(conn, pool);
+
virStoragePoolObjRemove(&driver->pools, pool);
- pool = NULL;
+
+ if (duppool) {
+ if (!(def = virStoragePoolDefParseString(xml)))
+ goto cleanup;
+ pool = virStoragePoolObjAssignDef(&driver->pools, def);
+ }
+ else
+ pool = NULL;
+
+ def = NULL;
goto cleanup;
}
VIR_INFO("Creating storage pool '%s'", pool->def->name);
pool->active = 1;
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid);
+ def = NULL;
cleanup:
virStoragePoolDefFree(def);
--
1.7.4.1
13 years
[libvirt] [PATCH v4 00/13] Implement keepalive protocol for libvirt RPC
by Jiri Denemark
This patchset can also be found at
https://gitorious.org/~jirka/libvirt/jirka-staging/commits/keepalive
This allows us to detect broken connections between server and client without
waiting for TCP timeout and dead deamon/client. By default a connection is
considered broken after about 30 seconds of no messages received from remote
party. After that period, the connection is automatically closed.
The main reason for implementing this is that peer-to-peer migration can now be
canceled when a connection between source and target breaks. Although this will
really work only after qemu fixes migrate_cancel command so that it doesn't
block when outgoing TCP buffers are full.
Version 4 addresses comments from Daniel and Matthias. Although most of the
patches were already (conditionally) acked, I'm sending all of them to provide
a complete picture of the change. Patches that were already acked are
explicitly marked so in the Notes section so anyone can just skip them if they
like.
Jiri Denemark (13):
Define keepalive protocol
Implement common keepalive handling
Introduce virConnectSetKeepAlive
virsh: Always run event loop
Implement keepalive protocol in libvirt daemon
Add support for non-blocking calls in client RPC
Add support for async close of client RPC socket
Implement keepalive protocol in remote driver
Introduce virConnectIsAlive API
Implement virConnectIsAlive in all drivers
Add keepalive support into domain-events examples
qemu: Add support for keepalive messages during p2p migration
qemu: Cancel p2p migration when connection breaks
.gitignore | 1 +
daemon/libvirtd.aug | 5 +
daemon/libvirtd.c | 15 +
daemon/libvirtd.conf | 25 ++
daemon/libvirtd.h | 1 +
daemon/remote.c | 48 ++-
examples/domain-events/events-c/event-test.c | 9 +-
examples/domain-events/events-python/event-test.py | 4 +-
include/libvirt/libvirt.h.in | 5 +
po/POTFILES.in | 1 +
src/Makefile.am | 20 +-
src/driver.h | 8 +
src/esx/esx_driver.c | 18 +
src/hyperv/hyperv_driver.c | 18 +
src/libvirt.c | 93 ++++
src/libvirt_internal.h | 10 +-
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 2 +
src/libxl/libxl_driver.c | 8 +
src/lxc/lxc_driver.c | 7 +
src/openvz/openvz_driver.c | 7 +
src/phyp/phyp_driver.c | 18 +
src/probes.d | 12 +
src/qemu/libvirtd_qemu.aug | 2 +
src/qemu/qemu.conf | 22 +
src/qemu/qemu_conf.c | 11 +
src/qemu/qemu_conf.h | 3 +
src/qemu/qemu_driver.c | 6 +
src/qemu/qemu_migration.c | 43 ++-
src/qemu/test_libvirtd_qemu.aug | 6 +
src/remote/remote_driver.c | 70 +++
src/remote/remote_protocol.x | 2 +-
src/rpc/virkeepalive.c | 448 ++++++++++++++++++++
src/rpc/virkeepalive.h | 56 +++
src/rpc/virkeepaliveprotocol.x | 7 +
src/rpc/virnetclient.c | 428 ++++++++++++++++---
src/rpc/virnetclient.h | 6 +
src/rpc/virnetserver.c | 22 +
src/rpc/virnetserver.h | 5 +
src/rpc/virnetserverclient.c | 143 ++++++-
src/rpc/virnetserverclient.h | 7 +
src/test/test_driver.c | 6 +
src/uml/uml_driver.c | 7 +
src/util/event.c | 6 +-
src/vbox/vbox_tmpl.c | 6 +
src/vmware/vmware_driver.c | 7 +
src/xen/xen_driver.c | 8 +
src/xenapi/xenapi_driver.c | 12 +
tools/console.c | 17 +-
tools/virsh.c | 31 ++
50 files changed, 1621 insertions(+), 103 deletions(-)
create mode 100644 src/rpc/virkeepalive.c
create mode 100644 src/rpc/virkeepalive.h
create mode 100644 src/rpc/virkeepaliveprotocol.x
--
1.7.7.1
13 years
[libvirt] Release schedule for libvirt 0.9.8
by Daniel Veillard
To try to keep the monthly release schedule, I would suggest the
following:
- enter freeze in a week from now i.e. Dec 1st
- try to push the release on Dec 6 or 7
Which means that we have one week to push the new APIs under review
(S3/S4 support, various block io changes, ...), maybe with a bit of luck
we can get the PPC KVM support in too.
So let's focuse on reviewing, finalizing and pushing the existing
patch sets :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
13 years