[libvirt] [PATCH] libxl: support VIR_MIGRATE_PERSIST_DEST migration flag
by Jim Fehlig
By default, virt-manager (and likely other libvirt-based apps) sets
the VIR_MIGRATE_PERSIST_DEST flag when invoking the migrate API, which
fails in a Xen setup since the libxl driver does not support the flag.
Persisting a domain is a trivial task in the grand scheme of migration,
so be nice to libvirt apps and add support for VIR_MIGRATE_PERSIST_DEST
in the libxl driver.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_migration.c | 23 +++++++++++++++++++++++
src/libxl/libxl_migration.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index f1da251..3b0dc74 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -1021,6 +1021,29 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
event = NULL;
}
+ if (flags & VIR_MIGRATE_PERSIST_DEST) {
+ unsigned int oldPersist = vm->persistent;
+ virDomainDefPtr vmdef;
+
+ vm->persistent = 1;
+ if (!(vmdef = virDomainObjGetPersistentDef(cfg->caps,
+ driver->xmlopt, vm)))
+ goto cleanup;
+
+ if (virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef) < 0)
+ goto cleanup;
+
+ event = virDomainEventLifecycleNewFromObj(vm,
+ VIR_DOMAIN_EVENT_DEFINED,
+ oldPersist ?
+ VIR_DOMAIN_EVENT_DEFINED_UPDATED :
+ VIR_DOMAIN_EVENT_DEFINED_ADDED);
+ if (event) {
+ libxlDomainEventQueue(driver, event);
+ event = NULL;
+ }
+ }
+
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
goto cleanup;
diff --git a/src/libxl/libxl_migration.h b/src/libxl/libxl_migration.h
index c02026d..8a074a0 100644
--- a/src/libxl/libxl_migration.h
+++ b/src/libxl/libxl_migration.h
@@ -29,6 +29,7 @@
# define LIBXL_MIGRATION_FLAGS \
(VIR_MIGRATE_LIVE | \
VIR_MIGRATE_PEER2PEER | \
+ VIR_MIGRATE_PERSIST_DEST | \
VIR_MIGRATE_UNDEFINE_SOURCE | \
VIR_MIGRATE_PAUSED)
--
2.1.4
8 years, 3 months
[libvirt] [PATCH] qemu_process: show shutoff reasons when debug log disabled
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
We have a few of senarios that libvirtd would invoke qemuProcessStop
and leave a "shutting down" in /var/log/libvirt/qemu/$DOMAIN.log.
The shutoff reason showing in debug log is also very important
for us to know why VM shutting down in domain log,
as we seldom enable debug log of libvirtd.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.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 b10b053..73e9271 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5803,7 +5803,9 @@ void qemuProcessStop(virQEMUDriverPtr driver,
virDomainObjBroadcast(vm);
if ((timestamp = virTimeStringNow()) != NULL) {
- qemuDomainLogAppendMessage(driver, vm, "%s: shutting down\n", timestamp);
+ qemuDomainLogAppendMessage(driver, vm, "%s: shutting down, reason=%s\n",
+ timestamp,
+ virDomainShutoffReasonTypeToString(reason));
VIR_FREE(timestamp);
}
--
1.8.3.1
8 years, 3 months
[libvirt] [PATCH] qemu_process: move graphics validation into separate function
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_process.c | 56 +++++++++++++++++++++++++++++--------------------
1 file changed, 33 insertions(+), 23 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1f56883..b360f6b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4409,6 +4409,38 @@ qemuProcessStartWarnShmem(virDomainObjPtr vm)
}
}
+
+static int
+qemuProcessStartValidateGraphics(virDomainObjPtr vm)
+{
+ size_t i;
+
+ for (i = 0; i < vm->def->ngraphics; i++) {
+ virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
+
+ switch (graphics->type) {
+ case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
+ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ if (graphics->nListens > 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("QEMU does not support multiple listens for "
+ "one graphics device."));
+ return -1;
+ }
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
+ case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+ break;
+ }
+ }
+
+ return 0;
+}
+
+
static int
qemuProcessStartValidateXML(virQEMUDriverPtr driver,
virDomainObjPtr vm,
@@ -4456,8 +4488,6 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
virCapsPtr caps,
unsigned int flags)
{
- size_t i;
-
if (!(flags & VIR_QEMU_PROCESS_START_PRETEND)) {
if (vm->def->virtType == VIR_DOMAIN_VIRT_KVM) {
VIR_DEBUG("Checking for KVM availability");
@@ -4484,27 +4514,7 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
qemuProcessStartWarnShmem(vm);
- for (i = 0; i < vm->def->ngraphics; i++) {
- virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
-
- switch (graphics->type) {
- case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
- case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
- if (graphics->nListens > 1) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("QEMU does not support multiple listens for "
- "one graphics device."));
- return -1;
- }
- break;
-
- case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
- case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
- case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
- case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
- break;
- }
- }
+ qemuProcessStartValidateGraphics(vm);
return 0;
}
--
2.10.0
8 years, 3 months
[libvirt] [PATCH 0/2] bhyve: add e1000 nic support
by Roman Bogorodskiy
Fabian Freyer (1):
bhyve: Separate out checks from virBhyveProbeCaps
Roman Bogorodskiy (1):
bhyve: add e1000 nic support
src/bhyve/bhyve_capabilities.c | 58 ++++++++++++++++++----
src/bhyve/bhyve_capabilities.h | 1 +
src/bhyve/bhyve_command.c | 32 ++++++++++--
.../bhyvexml2argvdata/bhyvexml2argv-net-e1000.args | 9 ++++
.../bhyvexml2argv-net-e1000.ldargs | 3 ++
.../bhyvexml2argvdata/bhyvexml2argv-net-e1000.xml | 22 ++++++++
tests/bhyvexml2argvtest.c | 7 ++-
7 files changed, 118 insertions(+), 14 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-net-e1000.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-net-e1000.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-net-e1000.xml
--
2.9.2
8 years, 3 months
[libvirt] [PATCH] libvirt-nodedev.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/libvirt-nodedev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index e4e9836..59f020b 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -595,7 +595,7 @@ virNodeDeviceDetachFlags(virNodeDevicePtr dev,
* virNodeDeviceReAttach:
* @dev: pointer to the node device
*
- * Re-attach a previously dettached node device to the node so that it
+ * Re-attach a previously detached node device to the node so that it
* may be used by the node again.
*
* Depending on the hypervisor, this may involve operations such
--
2.1.0
8 years, 3 months
[libvirt] [PATCH] libvirt-admin.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/libvirt-admin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index 03245b6..88eef54 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -344,7 +344,7 @@ virAdmConnectRef(virAdmConnectPtr conn)
* @libVer: where to store the library version
*
* Provides version information. @libVer is the version of the library and will
- * allways be set unless an error occurs in which case an error code and a
+ * always be set unless an error occurs in which case an error code and a
* generic message will be returned. @libVer format is as follows:
* major * 1,000,000 + minor * 1,000 + release.
*
--
2.1.0
8 years, 3 months
[libvirt] [PATCH] domain_conf.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.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 ea246b0..28b81d2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -25447,7 +25447,7 @@ virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a,
}
/* Duplicate WWN/serial isn't usually problematic for the OS and
- * forbiding it would possibly inhibit using multipath configurations */
+ * forbidding it would possibly inhibit using multipath configurations */
return 0;
}
--
2.1.0
8 years, 3 months
[libvirt] [PATCH] driver.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/driver.c b/src/driver.c
index 1514a3b..67ac020 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -38,7 +38,7 @@ VIR_LOG_INIT("driver");
#ifdef WITH_DRIVER_MODULES
-/* XXX re-implment this for other OS, or use libtools helper lib ? */
+/* XXX re-implement this for other OS, or use libtools helper lib ? */
# include <dlfcn.h>
# define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
--
2.1.0
8 years, 3 months
[libvirt] [PATCH] domain_conf.c:fix the comment.
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
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 ebddf5f..7daf2fd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14091,9 +14091,9 @@ void
virDomainNetRemoveHostdev(virDomainDefPtr def,
virDomainNetDefPtr net)
{
- /* hostdev net devices are normally also be in the hostdevs
- * array, but might have already been removed by the time we
- * get here.
+ /* hostdev net devices are normally in the hostdevs
+ * array, but might have already been removed by the
+ * time we get here.
*/
virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net);
size_t i;
--
2.1.0
8 years, 3 months
[libvirt] [PATCH] domain_conf.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.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 a70be31..ebddf5f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13936,7 +13936,7 @@ void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
virDomainDiskDefPtr disk)
{
int idx;
- /* Tenatively plan to insert disk at the end. */
+ /* Tentatively plan to insert disk at the end. */
int insertAt = -1;
/* Then work backwards looking for disks on
--
2.1.0
8 years, 3 months