[libvirt] [PATCH v2 1/1] qemu: Tidy up job handling during live migration
by Sam Bobroff
During a QEMU live migration several warning messages about job
handling could be written to syslog on the destination host:
"entering monitor without asking for a nested job is dangerous"
The messages are written because the job handling during migration
uses hard coded asyncJob values in several places that are incorrect.
This patch passes the required asyncJob value around and prevents
the warnings as well as any issues that the warnings may be referring
to.
Signed-off-by: Sam Bobroff <sam.bobroff(a)au1.ibm.com>
---
v2:
* Handle failures from qemuDomainObjEnterMonitorAsync() rather than
ignoring them.
* Include qemuDomainChangeGraphicsPasswords().
src/qemu/qemu_domain.c | 6 ++++--
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_driver.c | 21 ++++++++++++---------
src/qemu/qemu_migration.c | 3 ++-
src/qemu/qemu_process.c | 46 ++++++++++++++++++++++++++++------------------
src/qemu/qemu_process.h | 1 +
6 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 4f63c88..59b2647 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2497,7 +2497,8 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
int
qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
- virDomainObjPtr vm)
+ virDomainObjPtr vm,
+ int asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char **aliases;
@@ -2505,7 +2506,8 @@ qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT))
return 0;
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ return -1;
if (qemuMonitorGetDeviceAliases(priv->mon, &aliases) < 0) {
qemuDomainObjExitMonitor(driver, vm);
return -1;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 67972b9..8736889 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -369,7 +369,7 @@ extern virDomainXMLNamespace virQEMUDriverDomainXMLNamespace;
extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig;
int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
- virDomainObjPtr vm);
+ virDomainObjPtr vm, int asyncJob);
bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
virDomainDefPtr src,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 33541d3..b0439d2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1616,7 +1616,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
goto cleanup;
}
- if (qemuProcessStart(conn, driver, vm, NULL, -1, NULL, NULL,
+ if (qemuProcessStart(conn, driver, vm, QEMU_ASYNC_JOB_NONE,
+ NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
start_flags) < 0) {
virDomainAuditStart(vm, "booted", false);
@@ -5446,7 +5447,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
}
/* Set the migration source and start it up. */
- ret = qemuProcessStart(conn, driver, vm, "stdio", *fd, path, NULL,
+ ret = qemuProcessStart(conn, driver, vm, QEMU_ASYNC_JOB_NONE,
+ "stdio", *fd, path, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_RESTORE,
VIR_QEMU_PROCESS_START_PAUSED);
@@ -6143,7 +6145,8 @@ qemuDomainObjStart(virConnectPtr conn,
}
}
- ret = qemuProcessStart(conn, driver, vm, NULL, -1, NULL, NULL,
+ ret = qemuProcessStart(conn, driver, vm, QEMU_ASYNC_JOB_NONE,
+ NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags);
virDomainAuditStart(vm, "booted", ret >= 0);
if (ret >= 0) {
@@ -6500,7 +6503,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
}
if (ret == 0)
- qemuDomainUpdateDeviceList(driver, vm);
+ qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
return ret;
}
@@ -6560,7 +6563,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
}
if (ret == 0)
- qemuDomainUpdateDeviceList(driver, vm);
+ qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
return ret;
}
@@ -14101,8 +14104,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
if (config)
virDomainObjAssignDef(vm, config, false, NULL);
- rc = qemuProcessStart(snapshot->domain->conn,
- driver, vm, NULL, -1, NULL, snap,
+ rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
+ QEMU_ASYNC_JOB_NONE, NULL, -1, NULL, snap,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
VIR_QEMU_PROCESS_START_PAUSED);
virDomainAuditStart(vm, "from-snapshot", rc >= 0);
@@ -14195,8 +14198,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
if (event)
qemuDomainEventQueue(driver, event);
- rc = qemuProcessStart(snapshot->domain->conn,
- driver, vm, NULL, -1, NULL, NULL,
+ rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
+ QEMU_ASYNC_JOB_NONE, NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
start_flags);
virDomainAuditStart(vm, "from-snapshot", rc >= 0);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 767d840..1c46b34 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2480,7 +2480,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
/* Start the QEMU daemon, with the same command-line arguments plus
* -incoming $migrateFrom
*/
- if (qemuProcessStart(dconn, driver, vm, migrateFrom, dataFD[0], NULL, NULL,
+ if (qemuProcessStart(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
+ migrateFrom, dataFD[0], NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START,
VIR_QEMU_PROCESS_START_PAUSED |
VIR_QEMU_PROCESS_START_AUTODESTROY) < 0) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8a6b384..690927e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1444,7 +1444,8 @@ static qemuMonitorCallbacks monitorCallbacks = {
};
static int
-qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int logfd)
+qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
+ int logfd)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
@@ -1495,7 +1496,8 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int logfd)
}
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ goto error;
ret = qemuMonitorSetCapabilities(priv->mon);
if (ret == 0 &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON))
@@ -1901,6 +1903,7 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
static int
qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ int asyncJob,
virQEMUCapsPtr qemuCaps,
off_t pos)
{
@@ -1926,7 +1929,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
}
VIR_DEBUG("Connect monitor to %p '%s'", vm, vm->def->name);
- if (qemuConnectMonitor(driver, vm, logfd) < 0)
+ if (qemuConnectMonitor(driver, vm, asyncJob, logfd) < 0)
goto cleanup;
/* Try to get the pty path mappings again via the monitor. This is much more
@@ -1938,7 +1941,8 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
goto cleanup;
priv = vm->privateData;
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ goto cleanup;
ret = qemuMonitorGetPtyPaths(priv->mon, paths);
qemuDomainObjExitMonitor(driver, vm);
@@ -1984,13 +1988,14 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
static int
qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver,
- virDomainObjPtr vm)
+ virDomainObjPtr vm, int asyncJob)
{
pid_t *cpupids = NULL;
int ncpupids;
qemuDomainObjPrivatePtr priv = vm->privateData;
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ return -1;
/* failure to get the VCPU<-> PID mapping or to execute the query
* command will not be treated fatal as some versions of qemu don't
* support this command */
@@ -2213,7 +2218,8 @@ qemuProcessSetEmulatorAffinities(virConnectPtr conn ATTRIBUTE_UNUSED,
static int
qemuProcessInitPasswords(virConnectPtr conn,
virQEMUDriverPtr driver,
- virDomainObjPtr vm)
+ virDomainObjPtr vm,
+ int asyncJob)
{
int ret = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -2254,7 +2260,8 @@ qemuProcessInitPasswords(virConnectPtr conn,
goto cleanup;
alias = vm->def->disks[i]->info.alias;
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ goto cleanup;
ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
VIR_FREE(secret);
qemuDomainObjExitMonitor(driver, vm);
@@ -3150,7 +3157,7 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver,
old = priv->qemuDevices;
priv->qemuDevices = NULL;
- if (qemuDomainUpdateDeviceList(driver, vm) < 0)
+ if (qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
goto cleanup;
if ((tmp = old)) {
@@ -3216,7 +3223,7 @@ qemuProcessReconnect(void *opaque)
virObjectRef(obj);
/* XXX check PID liveliness & EXE path */
- if (qemuConnectMonitor(driver, obj, -1) < 0)
+ if (qemuConnectMonitor(driver, obj, QEMU_ASYNC_JOB_NONE, -1) < 0)
goto error;
/* Failure to connect to agent shouldn't be fatal */
@@ -3655,6 +3662,7 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, virDomainObjPtr vm)
int qemuProcessStart(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ int asyncJob,
const char *migrateFrom,
int stdin_fd,
const char *stdin_path,
@@ -4137,7 +4145,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Waiting for monitor to show up");
- if (qemuProcessWaitForMonitor(driver, vm, priv->qemuCaps, pos) < 0)
+ if (qemuProcessWaitForMonitor(driver, vm, asyncJob, priv->qemuCaps, pos) < 0)
goto cleanup;
/* Failure to connect to agent shouldn't be fatal */
@@ -4160,7 +4168,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Detecting VCPU PIDs");
- if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
+ if (qemuProcessDetectVcpuPIDs(driver, vm, asyncJob) < 0)
goto cleanup;
VIR_DEBUG("Setting cgroup for each VCPU (if required)");
@@ -4180,7 +4188,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Setting any required VM passwords");
- if (qemuProcessInitPasswords(conn, driver, vm) < 0)
+ if (qemuProcessInitPasswords(conn, driver, vm, asyncJob) < 0)
goto cleanup;
/* If we have -device, then addresses are assigned explicitly.
@@ -4195,7 +4203,8 @@ int qemuProcessStart(virConnectPtr conn,
/* qemu doesn't support setting this on the command line, so
* enter the monitor */
VIR_DEBUG("Setting network link states");
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ goto cleanup;
if (qemuProcessSetLinkStates(vm) < 0) {
qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
@@ -4204,7 +4213,7 @@ int qemuProcessStart(virConnectPtr conn,
qemuDomainObjExitMonitor(driver, vm);
VIR_DEBUG("Fetching list of active devices");
- if (qemuDomainUpdateDeviceList(driver, vm) < 0)
+ if (qemuDomainUpdateDeviceList(driver, vm, asyncJob) < 0)
goto cleanup;
/* Technically, qemuProcessStart can be called from inside
@@ -4219,7 +4228,8 @@ int qemuProcessStart(virConnectPtr conn,
vm->def->mem.cur_balloon);
goto cleanup;
}
- qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ goto cleanup;
if (vm->def->memballoon && vm->def->memballoon->period)
qemuMonitorSetMemoryStatsPeriod(priv->mon, vm->def->memballoon->period);
if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) {
@@ -4764,7 +4774,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
vm->pid = pid;
VIR_DEBUG("Waiting for monitor to show up");
- if (qemuProcessWaitForMonitor(driver, vm, priv->qemuCaps, -1) < 0)
+ if (qemuProcessWaitForMonitor(driver, vm, QEMU_ASYNC_JOB_NONE, priv->qemuCaps, -1) < 0)
goto error;
/* Failure to connect to agent shouldn't be fatal */
@@ -4779,7 +4789,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
}
VIR_DEBUG("Detecting VCPU PIDs");
- if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
+ if (qemuProcessDetectVcpuPIDs(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
goto error;
/* If we have -device, then addresses are assigned explicitly.
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 9c78736..5948ea4 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -53,6 +53,7 @@ typedef enum {
int qemuProcessStart(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ int asyncJob,
const char *migrateFrom,
int stdin_fd,
const char *stdin_path,
--
2.0.2.731.g247b4d5
10 years, 8 months
[libvirt] [PATCH v2 0/2] bhyve: add volumes support
by Roman Bogorodskiy
Changes from v1:
- Add volume support for the bhyveload command as
well to allow booting from a volume
Roman Bogorodskiy (2):
conf: make disk source pool translation generic
bhyve: add volumes support
src/bhyve/bhyve_command.c | 16 ++-
src/bhyve/bhyve_command.h | 7 +-
src/bhyve/bhyve_driver.c | 4 +-
src/bhyve/bhyve_process.c | 4 +-
src/conf/domain_conf.c | 245 ++++++++++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_conf.c | 243 ---------------------------------------------
src/qemu/qemu_conf.h | 3 -
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_process.c | 4 +-
tests/bhyvexml2argvtest.c | 5 +-
tests/qemuxml2argvtest.c | 2 +-
14 files changed, 280 insertions(+), 265 deletions(-)
--
1.9.0
10 years, 8 months
[libvirt] [PATCH 00/66] vbox: Rewrite vbox domain driver
by Taowei
This series of patches rewrite the vbox's domain
driver. The driver is separated into two parts: the version
specified and the common part. The common driver use
vboxUniformedAPI to build a general driver for all vbox
versions. The vboxUniformedAPI take the responsiblity to
communicate with virtualbox. Since there are some incompatible
changes in virtualbox, vboxUniformedAPI should be aware of
these changes and provide a uniformed api for the upper layer.
The significant result of this patch is that we replace all
vir${vbox_version}Driver into one virCommonDriver. So, we will
have only one vbox driver implementation for all vbox versions
in libvirt.
PS: I have send part of my patches before:
https://www.redhat.com/archives/libvir-list/2014-July/msg00937.html
But I have to resend it beacuse I did some improvement on previous
patches:
*Remove the test case for vboxUniformedAPI, because it would raise
"break strict-aliasing rules" warning in some distibutions
*Merged the flag fdWatchNeedInitialize into domainEventCallbacks,
So, we use one flag to indicate whether vbox support callbacks
as well as we need to initialize variables for it.
Taowei (66):
vbox: Begin to rewrite, vboxConnectOpen
vbox: Rewrite vboxConnectClose
vbox: Rewrite vboxDomainSave
vbox: Rewrite vboxConnectGetVersion
vbox: Rewrite vboxConnectGetHostname
vbox: Rewrite vboxConnectIsSecure
vbox: Rewrite vboxConnectIsEncrypted
vbox: Rewrite vboxConnectIsAlive
vbox: Rewrite vboxConnectGetMaxVcpus
vbox: Rewrite vboxConnectGetCapabilities
vbox: Rewrite vboxConnectListDomains
vbox: Rewrite vboxConnectNumOfDomains
vbox: Rewrite vboxDomainLookupById
vbox: Rewrite vboxDomainLookupByUUID
vbox: Rewrite vboxDomainUndefineFlags
vbox: Rewrite vboxDomainDefineXML
vbox: Rewrite vboxDomainCreateWithFlags
vbox: Rewrite vboxDomainCreate
vbox: Rewrite vboxDomainCreateXML
vbox: Rewrite vboxDomainLookupByName
vbox: Rewrite vboxDomainIsActive
vbox: Rewrite vboxDomainIsPersistent
vbox: Rewrite vboxDomainIsUpdated
vbox: Rewrite vboxDomainSuspend
vbox: Rewrite vboxDomainResume
vbox: Rewrite vboxDomainShutdownFlags
vbox: Rewrite vboxDomainShutdown
vbox: Rewrite vboxDomainReboot
vbox: Rewrite vboxDomainDestroyFlags
vbox: Rewrite vboxDomainDestroy
vbox: Rewrite vboxDomainGetOSType
vbox: Rewrite vboxDomainSetMemory
vbox: Rewrite vboxDomainGetInfo
vbox: Rewrite vboxDomainGetState
vbox: Rewrite vboxDomainSetVcpusFlags
vbox: Rewrite vboxDomainSetVcpus
vbox: Rewrite vboxDomainGetVcpusFlags
vbox: Rewrite vboxDomainGetMaxVcpus
vbox: Add API for vboxDomainGetXMLDesc
vbox: Rewrite vboxDomainGetXMLDesc
vbox: Rewrite vboxConnectListDefinedDomains
vbox: Rewrite vboxConnectNumOfDefinedDomains
vbox: Rewrite vboxDomainUndefine
vbox: Rewrite vboxDomainAttachDevice
vbox: Rewrite vboxDomainAttachDeviceFlags
vbox: Rewrite vboxDomainUpdateDeviceFlags
vbox: Rewrite vboxDomainDetachDevice
vbox: Rewrite vboxDomainDetachDeviceFlags
vbox: Add API for vboxDomainSnapshotCreateXML
vbox: Rewrite vboxDomainSnapshotCreateXML
vbox: Rewrite vboxDomainSnapshotGetXMLDesc
vbox: Rewrite vboxDomainSnapshotNum
vbox: Rewrite vboxDomainSnapshotListNames
vbox: Rewrite vboxSnapshotLookupByName
vbox: Rewrite vboxDomainHasCurrentSnapshot
vbox: Rewrite vboxDomainSnapshotGetParent
vbox: Rewrite vboxDomainSnapshotCurrent
vbox: Rewrite vboxDomainSnapshotIsCurrent
vbox: Rewrite vboxDomainSnapshotHasMetadata
vbox: Rewrite vboxDomainRevertToSnapshot
vbox: Rewrite vboxDomainSnapshotDelete
vbox: Rewrite vboxDomainScreenshot
vbox: Rewrite vboxConnectListAllDomains
vbox: Rewrite vboxNode functions
vbox: Add registerDomainEvent
vbox: Introducing vboxCommonDriver
po/POTFILES.in | 1 +
src/Makefile.am | 5 +-
src/vbox/README | 7 +-
src/vbox/vbox_common.c | 7550 +++++++++++++++++++++
src/vbox/vbox_common.h | 306 +
src/vbox/vbox_driver.c | 40 +-
src/vbox/vbox_install_api.h | 26 +
src/vbox/vbox_tmpl.c |14557 +++++++++++++----------------------------
src/vbox/vbox_uniformed_api.h | 551 ++
9 files changed, 13186 insertions(+), 9857 deletions(-)
create mode 100644 src/vbox/vbox_common.c
create mode 100644 src/vbox/vbox_common.h
create mode 100644 src/vbox/vbox_install_api.h
create mode 100644 src/vbox/vbox_uniformed_api.h
--
1.7.9.5
10 years, 8 months
[libvirt] [PATCH] build: force configure failed when perl is missing
by Jincheng Miao
Perl is necessary to our build processing, it will invoke a lot of
generating script, like: gendispatch.pl. If perl is missing, it's
ok for build from git checkout, because autogen.sh will tell you.
But for compiling from a release tarball, configure will just record
a missing message, and continue, then build failed, like:
https://www.redhat.com/archives/libvirt-users/2014-August/msg00050.html
So need to enhance configure script to handle this negative case.
Reported-by: Hongbin Lu <hongbin(a)savinetwork.ca>
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
configure.ac | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 081f298..af3fe28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2173,6 +2173,9 @@ AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"])
dnl Allow perl/python overrides
AC_PATH_PROGS([PYTHON], [python2 python])
AC_PATH_PROG([PERL], [perl])
+if test -z "$PERL"; then
+ AC_MSG_ERROR([Failed to find perl.])
+fi
AC_ARG_WITH([test-suite],
[AS_HELP_STRING([--with-test-suite],
--
1.7.1
10 years, 9 months
[libvirt] [PATCH V5 00/12] xen_xm.c code refactor
by Kiarie Kahurani
Kiarie Kahurani (12):
src/xenxs: Export code for reuse
src/xenxs: Refactor code formating general VM config
src/xenxs: Refactor code formating memory config
src/xenxs: Refactor code formating virtual time config
src/xenxs: Refactor code formating event actions config
src/xenxs: Refactor code formating Char devices config
src/xenxs: Refactor code formating xm disk config
src/xenxs: Refactor code formating CPU features config
src/xenxs: Refactor code formating OS config
src/xenxs: Refactor code formating Vfb config
src/xenxs: Refactor code formating emulated devices config
src/xenxs: Export code
src/xenxs/xen_xm.c | 858 +++++++++++++--------
src/xenxs/xen_xm.h | 4 +
tests/xmconfigdata/test-escape-paths.cfg | 12 +-
tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-localtime.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-net-ioemu.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-net-netfront.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg | 10 +-
.../test-fullvirt-serial-dev-2-ports.cfg | 10 +-
.../test-fullvirt-serial-dev-2nd-port.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-file.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-null.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-pty.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.cfg | 10 +-
.../test-fullvirt-serial-tcp-telnet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-udp.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-unix.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-sound.cfg | 12 +-
tests/xmconfigdata/test-fullvirt-usbmouse.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-usbtablet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-utc.cfg | 10 +-
tests/xmconfigdata/test-no-source-cdrom.cfg | 10 +-
tests/xmconfigdata/test-paravirt-net-e1000.cfg | 2 +-
tests/xmconfigdata/test-paravirt-net-vifname.cfg | 2 +-
.../test-paravirt-new-pvfb-vncdisplay.cfg | 2 +-
tests/xmconfigdata/test-paravirt-new-pvfb.cfg | 2 +-
.../test-paravirt-old-pvfb-vncdisplay.cfg | 2 +-
tests/xmconfigdata/test-paravirt-old-pvfb.cfg | 2 +-
tests/xmconfigdata/test-paravirt-vcpu.cfg | 2 +-
tests/xmconfigdata/test-pci-devs.cfg | 10 +-
35 files changed, 663 insertions(+), 477 deletions(-)
This series refactor xen_xm.c code into functions for reuse
when writing a xen-xl parser.
Changes since V4
fixed SOB issue.
--
1.8.4.5
10 years, 9 months
[libvirt] [PATCH] qemu_process: fix memleak found by coverity
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed as trivial
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 13c396f..52d9052 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2323,8 +2323,10 @@ qemuProcessInitPasswords(virConnectPtr conn,
goto cleanup;
alias = vm->def->disks[i]->info.alias;
- if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) {
+ VIR_FREE(secret);
goto cleanup;
+ }
ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
VIR_FREE(secret);
qemuDomainObjExitMonitor(driver, vm);
--
1.8.5.5
10 years, 9 months
[libvirt] questions on backing chain file, block lun, active commit
by Eric Blake
While investigating active commit, I noticed that our code for probing
backing chains currently guesses at type="file" vs. type="block" solely
based on stat results (regular file vs. block device). Is a block
device allowed to be used as <disk type='block' device='lun'> at the
same time it has qcow2 format, or does use of device='lun' enforce that
the block device is used with raw format? My worry is that if a lun
device can be used with qcow2 format, then it can have a non-block
backing file, and an active commit would convert <disk type='block'
device='lun'> into <disk type='file' device='lun'> which is not valid.
On a related vein, that means that an active commit currently auto-picks
whether the <disk> will be listed as type='file' or type='block' solely
on the stat results. Elsewhere, we allow type='file' even for block
devices, where a noticeable difference is how virDomainGetBlockInfo()
reports allocation (for type='file', allocation is based on how sparse
the file is, but a block device is not sparse; for type='block',
allocation is based on asking qemu the maximum used cluster). Should we
be auto-converting to type='block' in other cases where we have stat
results? For example, I posted a patch today to let the user explicitly
request that virsh blockcopy to a block device will use type='block'
because the existing code has always used type='file', but if we were
doing things automatically, then the user would automatically get
type='block' for block device destinations instead of having to request
it; but has no way to forcefully list a file even when the destination
is a block (at least, not until I implement virDomainBlockCopy() that
takes an XML <disk> description).
One drawback of autoconversion is the XML changes - with type='file',
the host resource is located at xpath disk/source/@file, but with
type='block', it is at xpath disk/source/@dev. If we ever convert a
user's type='file' into a block device, but the user isn't expecting the
conversion, then they won't be able to find the source file name in the
output XML. So on that ground, autoprobing type='block' for active
commit is fishy; we really should be honoring the user's input for
<backingStore> rather than probing it ourselves every time. Until that
point, and given that I just proposed a patch to turn on type='block'
for blockcopy, where type='file' is used in all other cases, should we
have the same sort of flag for active commit?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 9 months
[libvirt] [PATCH] [RFC] net: don't segfault on Martin's setup
by Martin Kletzander
No, don't worry, this is not a real commit message, this is more like
an RFC about how to fix it. I'm not sure about this part of libvirt
codebase, so I'm rather asking for help. Apparently, I have a network
with netdef->forward.pfs == NULL, I suspect this is a network I have,
that doesn't have any <forward/> element.
With the following fix, everything works as expected, but I'm almost
certain this is not enough.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/network/bridge_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 1ba4c3d..3a40124 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2196,6 +2196,9 @@ networkCreateInterfacePool(virNetworkDefPtr netdef)
int ret = -1;
size_t i;
+ if (!netdef->forward.pfs)
+ return 0;
+
if ((virNetDevGetVirtualFunctions(netdef->forward.pfs->dev,
&vfNames, &virtFns, &numVirtFns)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
2.0.4
10 years, 9 months
[libvirt] [PATCH] Maximum vlanid should be 4095 in interface.rng
by Jianwei Hu
The correct vlanid range is 0~4095.
After merging this patch, we can not validate a interface xml with vlanid >= 4096.
[root@localhost ~]# cat vlan.xml
<interface type='vlan' name='eno1.4096'>
<start mode='onboot'/>
<protocol family='ipv4'>
<dhcp/>
</protocol>
<vlan tag='4096'>
<interface name='eno1'/>
</vlan>
</interface>
[root@localhost ~]# virt-xml-validate vlan.xml
vlan.xml:1: element interface: Relax-NG validity error : Invalid sequence in interleave
vlan.xml:6: element vlan: Relax-NG validity error : Element interface failed to validate content
vlan.xml:6: element vlan: Relax-NG validity error : Element vlan failed to validate attributes
vlan.xml fails to validate
[root@localhost ~]#
Here is a ip command help on this.
[root@localhost /]# ip link add link eno1 name eno1.90 type vlan help
Usage: ... vlan [ protocol VLANPROTO ] id VLANID [ FLAG-LIST ]
[ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]
VLANPROTO: [ 802.1Q / 802.1ad ]
VLANID := 0-4095
FLAG-LIST := [ FLAG-LIST ] FLAG
FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ]
[ loose_binding { on | off } ]
QOS-MAP := [ QOS-MAP ] QOS-MAPPING
QOS-MAPPING := FROM:TO
---
docs/schemas/interface.rng | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng
index 80962d4..0f577d6 100644
--- a/docs/schemas/interface.rng
+++ b/docs/schemas/interface.rng
@@ -440,7 +440,7 @@
<define name='vlan-id'>
<data type="unsignedInt">
- <param name="maxInclusive">4096</param>
+ <param name="maxInclusive">4095</param>
</data>
</define>
</grammar>
--
1.8.3.1
10 years, 9 months