[libvirt] [PATCH] build: avoid compiler failure
by Eric Blake
GCC complained about a C99 for-loop declaration outside of C99 mode
when compiling on RHEL 5.
* src/qemu/qemu_driver.c (qemudDomainPinVcpuFlags): Avoid C99 for
loop, since gcc 4.1.2 hates it.
---
Pushing under the build-breaker rule.
src/qemu/qemu_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 01587e8..2f416c8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2952,6 +2952,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
bool isActive;
qemuDomainObjPrivatePtr priv;
bool canResetting = true;
+ int pcpu;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -3011,7 +3012,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
/* pinning to all physical cpus means resetting,
* so check if we can reset setting.
*/
- for (int pcpu = 0; pcpu < hostcpus; pcpu++) {
+ for (pcpu = 0; pcpu < hostcpus; pcpu++) {
if ((cpumap[pcpu/8] & (1 << (pcpu % 8))) == 0) {
canResetting = false;
break;
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH v2] Support reboots with the QEMU driver
by Daniel P. Berrange
For controlled shutdown we issue a 'system_powerdown' command
to the QEMU monitor. This triggers an ACPI event which (most)
guest OS wire up to a controlled shutdown. There is no equiv
ACPI event to trigger a controlled reboot. This patch attempts
to fake a reboot.
- In qemuDomainObjPrivatePtr we have a bool fakeReboot
flag.
- The virDomainReboot method sets this flag and then
triggers a normal 'system_powerdown'.
- The QEMU process is started with '-no-shutdown'
so that the guest CPUs pause when it powers off the
guest
- When we receive the 'POWEROFF' event from QEMU JSON
monitor if fakeReboot is not set we invoke the
qemuProcessKill command and shutdown continues
normally
- If fakeReboot was set, we spawn a background thread
which issues 'system_reset' to perform a warm reboot
of the guest hardware. Then it issues 'cont' to
start the CPUs again
In v2:
- Fix unref of virDomainObjPtr when thread creation fails
* src/qemu/qemu_command.c: Add -no-shutdown flag if
we have JSON support
* src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
qemuDomainObjPrivate struct
* src/qemu/qemu_driver.c: Fake reboot using the
system_powerdown command if JSON support is available
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
binding for system_reset command
* src/qemu/qemu_process.c: Reset the guest & start CPUs if
fakeReboot is set
---
src/qemu/qemu_command.c | 7 +++
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 65 ++++++++++++++++++++++++++-
src/qemu/qemu_monitor.c | 19 ++++++++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 19 ++++++++
src/qemu/qemu_monitor_json.h | 1 +
src/qemu/qemu_monitor_text.c | 13 +++++
src/qemu/qemu_monitor_text.h | 1 +
src/qemu/qemu_process.c | 100 +++++++++++++++++++++++++++++++++++++++++-
10 files changed, 224 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b517e1a..7ac1faf 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3222,6 +3222,13 @@ qemuBuildCommandLine(virConnectPtr conn,
def->onReboot != VIR_DOMAIN_LIFECYCLE_RESTART)
virCommandAddArg(cmd, "-no-reboot");
+ /* If JSON monitor is enabled, we can receive an event
+ * when QEMU stops. If we use no-shutdown, then we can
+ * watch for this event and do a soft/warm reboot.
+ */
+ if (monitor_json)
+ virCommandAddArg(cmd, "-no-shutdown");
+
if (!(def->features & (1 << VIR_DOMAIN_FEATURE_ACPI)))
virCommandAddArg(cmd, "-no-acpi");
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 3d041fc..f282df2 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -91,6 +91,8 @@ struct _qemuDomainObjPrivate {
virBitmapPtr qemuCaps;
char *lockState;
+
+ bool fakeReboot;
};
struct qemuDomainWatchdogEvent
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 01587e8..624f57d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1428,7 +1428,7 @@ cleanup:
}
-static int qemudDomainShutdown(virDomainPtr dom) {
+static int qemuDomainShutdown(virDomainPtr dom) {
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -1460,6 +1460,8 @@ static int qemudDomainShutdown(virDomainPtr dom) {
ret = qemuMonitorSystemPowerdown(priv->mon);
qemuDomainObjExitMonitor(vm);
+ priv->fakeReboot = false;
+
endjob:
if (qemuDomainObjEndJob(vm) == 0)
vm = NULL;
@@ -1471,11 +1473,66 @@ cleanup:
}
+static int qemuDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED) {
+ struct qemud_driver *driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ int ret = -1;
+ qemuDomainObjPrivatePtr priv;
+
+ qemuDriverLock(driver);
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ qemuDriverUnlock(driver);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(dom->uuid, uuidstr);
+ qemuReportError(VIR_ERR_NO_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ goto cleanup;
+ }
+ priv = vm->privateData;
+
+#if HAVE_YAJL
+ if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
+ if (qemuDomainObjBeginJob(vm) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto endjob;
+ }
+
+ qemuDomainObjEnterMonitor(vm);
+ ret = qemuMonitorSystemPowerdown(priv->mon);
+ qemuDomainObjExitMonitor(vm);
+
+ priv->fakeReboot = true;
+
+ endjob:
+ if (qemuDomainObjEndJob(vm) == 0)
+ vm = NULL;
+ } else {
+#endif
+ qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("Reboot is not supported without the JSON monitor"));
+#if HAVE_YAJL
+ }
+#endif
+
+cleanup:
+ if (vm)
+ virDomainObjUnlock(vm);
+ return ret;
+}
+
+
static int qemudDomainDestroy(virDomainPtr dom) {
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
+ qemuDomainObjPrivatePtr priv;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -1487,6 +1544,9 @@ static int qemudDomainDestroy(virDomainPtr dom) {
goto cleanup;
}
+ priv = vm->privateData;
+ priv->fakeReboot = false;
+
/* Although qemuProcessStop does this already, there may
* be an outstanding job active. We want to make sure we
* can kill the process even if a job is active. Killing
@@ -8335,7 +8395,8 @@ static virDriver qemuDriver = {
.domainLookupByName = qemudDomainLookupByName, /* 0.2.0 */
.domainSuspend = qemudDomainSuspend, /* 0.2.0 */
.domainResume = qemudDomainResume, /* 0.2.0 */
- .domainShutdown = qemudDomainShutdown, /* 0.2.0 */
+ .domainShutdown = qemuDomainShutdown, /* 0.2.0 */
+ .domainReboot = qemuDomainReboot, /* 0.9.3 */
.domainDestroy = qemudDomainDestroy, /* 0.2.0 */
.domainGetOSType = qemudDomainGetOSType, /* 0.2.2 */
.domainGetMaxMemory = qemudDomainGetMaxMemory, /* 0.4.2 */
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 89a3f64..2aa5c9a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1095,6 +1095,25 @@ int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
}
+int qemuMonitorSystemReset(qemuMonitorPtr mon)
+{
+ int ret;
+ VIR_DEBUG("mon=%p", mon);
+
+ if (!mon) {
+ qemuReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
+ if (mon->json)
+ ret = qemuMonitorJSONSystemReset(mon);
+ else
+ ret = qemuMonitorTextSystemReset(mon);
+ return ret;
+}
+
+
int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
int **pids)
{
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 3bb0269..ae74a3c 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -194,6 +194,7 @@ int qemuMonitorStartCPUs(qemuMonitorPtr mon,
int qemuMonitorStopCPUs(qemuMonitorPtr mon);
int qemuMonitorGetStatus(qemuMonitorPtr mon, bool *running);
+int qemuMonitorSystemReset(qemuMonitorPtr mon);
int qemuMonitorSystemPowerdown(qemuMonitorPtr mon);
int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 56ec65b..6cc6ea7 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -947,6 +947,25 @@ int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon)
}
+int qemuMonitorJSONSystemReset(qemuMonitorPtr mon)
+{
+ int ret;
+ virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("system_reset", NULL);
+ virJSONValuePtr reply = NULL;
+ if (!cmd)
+ return -1;
+
+ ret = qemuMonitorJSONCommand(mon, cmd, &reply);
+
+ if (ret == 0)
+ ret = qemuMonitorJSONCheckError(cmd, reply);
+
+ virJSONValueFree(cmd);
+ virJSONValueFree(reply);
+ return ret;
+}
+
+
/*
* [ { "CPU": 0, "current": true, "halted": false, "pc": 3227107138 },
* { "CPU": 1, "current": false, "halted": true, "pc": 7108165 } ]
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 393d8fc..a72bf7c 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -49,6 +49,7 @@ int qemuMonitorJSONStopCPUs(qemuMonitorPtr mon);
int qemuMonitorJSONGetStatus(qemuMonitorPtr mon, bool *running);
int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon);
+int qemuMonitorJSONSystemReset(qemuMonitorPtr mon);
int qemuMonitorJSONGetCPUInfo(qemuMonitorPtr mon,
int **pids);
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index a16ea91..67333aa 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -417,6 +417,19 @@ int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) {
}
+int qemuMonitorTextSystemReset(qemuMonitorPtr mon) {
+ char *info;
+
+ if (qemuMonitorHMPCommand(mon, "system_reset", &info) < 0) {
+ qemuReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("system reset operation failed"));
+ return -1;
+ }
+ VIR_FREE(info);
+ return 0;
+}
+
+
int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
int **pids)
{
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index 4fa5064..7536557 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -46,6 +46,7 @@ int qemuMonitorTextStopCPUs(qemuMonitorPtr mon);
int qemuMonitorTextGetStatus(qemuMonitorPtr mon, bool *running);
int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon);
+int qemuMonitorTextSystemReset(qemuMonitorPtr mon);
int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
int **pids);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b441137..c44c8e9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -353,13 +353,103 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
+/*
+ * Since we have the '-no-shutdown' flag set, the
+ * QEMU process will currently have guest OS shutdown
+ * and the CPUS stopped. To fake the reboot, we thus
+ * want todo a reset of the virtual hardware, followed
+ * by restart of the CPUs. This should result in the
+ * guest OS booting up again
+ */
+static void
+qemuProcessFakeReboot(void *opaque)
+{
+ struct qemud_driver *driver = qemu_driver;
+ virDomainObjPtr vm = opaque;
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+ virDomainEventPtr event = NULL;
+ int ret = -1;
+ VIR_DEBUG("vm=%p", vm);
+ qemuDriverLock(driver);
+ virDomainObjLock(vm);
+ if (qemuDomainObjBeginJob(vm) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("guest unexpectedly quit"));
+ goto endjob;
+ }
+
+ qemuDomainObjEnterMonitorWithDriver(driver, vm);
+ if (qemuMonitorSystemReset(priv->mon) < 0) {
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
+ goto endjob;
+ }
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
+
+ if (!virDomainObjIsActive(vm)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("guest unexpectedly quit"));
+ goto endjob;
+ }
+
+ if (qemuProcessStartCPUs(driver, vm, NULL,
+ VIR_DOMAIN_RUNNING_BOOTED) < 0) {
+ if (virGetLastError() == NULL)
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("resume operation failed"));
+ goto endjob;
+ }
+ event = virDomainEventNewFromObj(vm,
+ VIR_DOMAIN_EVENT_RESUMED,
+ VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
+
+ ret = 0;
+
+endjob:
+ if (qemuDomainObjEndJob(vm) == 0)
+ vm = NULL;
+
+cleanup:
+ if (vm) {
+ if (ret == -1)
+ qemuProcessKill(vm);
+ if (virDomainObjUnref(vm) > 0)
+ virDomainObjUnlock(vm);
+ }
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ qemuDriverUnlock(driver);
+}
+
+
static int
qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+ VIR_DEBUG("vm=%p", vm);
+
virDomainObjLock(vm);
- ((qemuDomainObjPrivatePtr) vm->privateData)->gotShutdown = true;
- virDomainObjUnlock(vm);
+ priv->gotShutdown = true;
+ if (priv->fakeReboot) {
+ virDomainObjRef(vm);
+ virThread th;
+ if (virThreadCreate(&th,
+ false,
+ qemuProcessFakeReboot,
+ vm) < 0) {
+ VIR_ERROR("Failed to create reboot thread, killing domain");
+ qemuProcessKill(vm);
+ if (virDomainObjUnref(vm) == 0)
+ vm = NULL;
+ }
+ } else {
+ qemuProcessKill(vm);
+ }
+ if (vm)
+ virDomainObjUnlock(vm);
return 0;
}
@@ -2087,6 +2177,11 @@ qemuProcessPrepareMonitorChr(struct qemud_driver *driver,
}
+/*
+ * Precondition: Both driver and vm must be locked,
+ * and a job must be active. This method will call
+ * {Enter,Exit}MonitorWithDriver
+ */
int
qemuProcessStartCPUs(struct qemud_driver *driver, virDomainObjPtr vm,
virConnectPtr conn, virDomainRunningReason reason)
@@ -2349,6 +2444,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
vm->def->id = driver->nextvmid++;
+ priv->fakeReboot = false;
/* Run an early hook to set-up missing devices */
if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH] documenting the 802.1Qbh parameters of a 'direct' interface
by David S. Wang
From: "David S. Wang" <dwang2(a)cisco.com>
This patch adds documentation about the 802.1Qbh related parameters
of the virtualport element for 'direct' interfaces.
Signed-off-by: David S. Wang <dwang2(a)cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu(a)cisco.com>
Signed-off-by: Christian Benvenuti <benve(a)cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri(a)cisco.com>
---
docs/formatdomain.html.in | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 267839b..57dafcd 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1540,6 +1540,35 @@
</devices>
...</pre>
+ <p>
+ The interface can have additional parameters as shown below
+ if the switch is conforming to the IEEE 802.1Qbh standard.
+ The values are network specific and should be provided by the
+ network administrator.
+ </p>
+ <dl>
+ <dt><code>profileid</code></dt>
+ <dd>The profile ID contains the name of the port profile that is to
+ be applied onto this interface. This name is resolved by the port
+ profile database into the network parameters from the port profile,
+ and those network parameters will be applied to this interface.
+ </dd>
+ </dl>
+ <pre>
+ ...
+ <devices>
+ <interface type='direct'/>
+ ...
+ <interface type='direct'>
+ <source dev='eth0' mode='private'/>
+ <virtualport type='802.1Qbh'>
+ <parameters profileid='finance'/>
+ </virtualport>
+ </interface>
+ </devices>
+ ...
+ </pre>
+
<h5><a name="elementsNICSMulticast">Multicast tunnel</a></h5>
<p>
13 years, 5 months
[libvirt] [PATCH] build: update to latest gnulib
by Eric Blake
Gnulib has been busy, with 392 commits; it's easier to update now
even without any known libvirt issue to be fixed, rather than
having to analyze an even larger changeset later on.
* .gnulib: Update to latest, for lots of changes.
* bootstrap: Synchronize to upstream.
---
* .gnulib 5bf7fda...90d0c49 (392):
> bootstrap: do not insert a blank line into each .gitignore file
> perror: test for output mismatch
> strerror_r: fix OpenBSD behavior on out-of-range
> strerror_r: fix OpenBSD behavior on 0
> perror: adjust array size
> strerror-override: reduce size
> pathmax: Ensure correct value for PATH_MAX on HP-UX.
> alloca: port to compilers that can optimize like GCC 4.6.0
> c-stack: stop worrying about stack direction
> test-stat: don't allocate PATH_MAX bytes
> float: Work around <float.h> bugs on FreeBSD/x86, AIX with GCC, IRIX.
> Tests for module 'float'.
> isinf: Coding style.
> linkat test: Avoid test failure on AIX 7.1.
> pread test: Avoid test failure on OpenBSD 4.9.
> sprintf-posix: Fix test failure on AIX 7.1.
> roundl-ieee: Fix test failure on AIX 7.1.
> round-ieee: Fix test failures on AIX 7.1 and OSF/1 5.1.
> roundf-ieee: Fix test failures on AIX 7.1 and OSF/1 5.1.
> ceilf-ieee: Work around bug on MacOS X 10.5.
> floor*-ieee, ceil*-ieee, trunc*-ieee, round*-ieee: More robust checks.
> ceilf-ieee: Work around bug on AIX 7.1.
> ceil-ieee: Work around bug on AIX 7.1.
> fsync test: Avoid test failure on MacOS X and AIX.
> openat, fdopendir tests: Fix link errors.
> Doc update.
> getcwd tests: Avoid compilation error on HP-UX 11.31.
> isfinite, isinf: Fix link error on AIX 6 and 7.
> getloadavg: Don't clobber LIBS. Regression from previous commit.
> clean-temp: Improve documentation.
> pread, pwrite: Avoid cc warning on AIX.
> spawn-pipe tests: Fix link error.
> Tests: Remove unnecessary dependency.
> spawn-pipe tests: Fix link error.
> Fix tests link errors.
> crypto/gc-sha1: Fix recent regression.
> crypto/gc-md5: Fix recent regression.
> crypto/gc-md4: Fix recent regression.
> crypto/gc-arctwo: Fix recent regression.
> crypto/gc-rijndael: Fix recent regression.
> crypto/gc-hmac-sha1: Fix recent regression.
> crypto/gc-hmac-md5: Fix recent regression.
> crypto/gc-des: Fix recent regression.
> crypto/gc-arcfour: Fix recent regression.
> * m4/lstat.m4 (gl_FUNC_LSTAT): Fix typo in prerequisite.
> fprintftime: Move AC_LIBOBJ invocations to module description.
> tmpfile-safer: Finish 2011-05-23 commit.
> syntax-check: Fix typo.
> syntax-check: add a rule to help enforce the no-AC_LIBOBJ-in-m4/ policy
> yesno: Move AC_LIBOBJ invocations to module description.
> xstrtol: Move AC_LIBOBJ invocations to module description.
> xstrtold: Move AC_LIBOBJ invocations to module description.
> xstrtod: Move AC_LIBOBJ invocations to module description.
> xnanosleep: Move AC_LIBOBJ invocations to module description.
> xgetcwd: Move AC_LIBOBJ invocations to module description.
> xalloc: Move AC_LIBOBJ invocations to module description.
> write-any-file: Move AC_LIBOBJ invocations to module description.
> utimens: Move AC_LIBOBJ invocations to module description.
> utimecmp: Move AC_LIBOBJ invocations to module description.
> userspec: Move AC_LIBOBJ invocations to module description.
> unlinkdir: Move AC_LIBOBJ invocations to module description.
> unistd-safer: Move AC_LIBOBJ invocations to module description.
> tempname: Move AC_LIBOBJ invocations to module description.
> strftime: Move AC_LIBOBJ invocations to module description.
> stdlib-safer: Move AC_LIBOBJ invocations to module description.
> tmpfile-safer: Move AC_LIBOBJ invocations to module description.
> popen-safer: Move AC_LIBOBJ invocations to module description.
> freopen-safer: Move AC_LIBOBJ invocations to module description.
> fopen-safer: Move AC_LIBOBJ invocations to module description.
> crypto/sha512: Move AC_LIBOBJ invocations to module description.
> crypto/sha256: Move AC_LIBOBJ invocations to module description.
> crypto/sha1: Move AC_LIBOBJ invocations to module description.
> settime: Move AC_LIBOBJ invocations to module description.
> savedir: Move AC_LIBOBJ invocations to module description.
> save-cwd: Move AC_LIBOBJ invocations to module description.
> same: Move AC_LIBOBJ invocations to module description.
> safe-write: Move AC_LIBOBJ invocations to module description.
> safe-read: Move AC_LIBOBJ invocations to module description.
> safe-alloc: Move AC_LIBOBJ invocations to module description.
> crypto/rijndael: Move AC_LIBOBJ invocations to module description.
> readtokens: Move AC_LIBOBJ invocations to module description.
> read-file: Move AC_LIBOBJ invocations to module description.
> quotearg: Move AC_LIBOBJ invocations to module description.
> quote: Move AC_LIBOBJ invocations to module description.
> posixver: Move AC_LIBOBJ invocations to module description.
> posixtm: Move AC_LIBOBJ invocations to module description.
> physmem: Move AC_LIBOBJ invocations to module description.
> pagealign_alloc: Move AC_LIBOBJ invocations to module description.
> mpsort: Move AC_LIBOBJ invocations to module description.
> modechange: Move AC_LIBOBJ invocations to module description.
> mkdir-p: Move AC_LIBOBJ invocations to module description.
> mkancesdirs: Move AC_LIBOBJ invocations to module description.
> mgetgroups: Move AC_LIBOBJ invocations to module description.
> memxor: Move AC_LIBOBJ invocations to module description.
> memcoll: Move AC_LIBOBJ invocations to module description.
> memcasecmp: Move AC_LIBOBJ invocations to module description.
> crypto/md5: Move AC_LIBOBJ invocations to module description.
> crypto/md4: Move AC_LIBOBJ invocations to module description.
> crypto/md2: Move AC_LIBOBJ invocations to module description.
> long-options: Move AC_LIBOBJ invocations to module description.
> i-ring: Move AC_LIBOBJ invocations to module description.
> idcache: Move AC_LIBOBJ invocations to module description.
> human: Move AC_LIBOBJ invocations to module description.
> crypto/hmac-sha1: Move AC_LIBOBJ invocations to module description.
> crypto/hmac-md5: Move AC_LIBOBJ invocations to module description.
> hash: Move AC_LIBOBJ invocations to module description.
> hard-locale: Move AC_LIBOBJ invocations to module description.
> getugroups: Move AC_LIBOBJ invocations to module description.
> gettime: Move AC_LIBOBJ invocations to module description.
> getndelim2: Move AC_LIBOBJ invocations to module description.
> crypto/gc-pbkdf2-sha1: Move AC_LIBOBJ invocations to module description.
> fts: Move AC_LIBOBJ invocations to module description.
> file-type: Move AC_LIBOBJ invocations to module description.
> filenamecat*: Respect rules for use of AC_LIBOBJ.
> filemode: Move AC_LIBOBJ invocations to module description.
> openat-safer: Move AC_LIBOBJ invocations to module description.
> fcntl-safer: Move AC_LIBOBJ invocations to module description.
> exclude: Move AC_LIBOBJ invocations to module description.
> dirname*: Respect rules for use of AC_LIBOBJ.
> dirent-safer: Move AC_LIBOBJ invocations to module description.
> crypto/des: Move AC_LIBOBJ invocations to module description.
> cycle-check: Move AC_LIBOBJ invocations to module description.
> c-strtold: Move AC_LIBOBJ invocations to module description.
> c-strtod: Move AC_LIBOBJ invocations to module description.
> crc: Move AC_LIBOBJ invocations to module description.
> close-stream: Move AC_LIBOBJ invocations to module description.
> closeout: Move AC_LIBOBJ invocations to module description.
> closein: Move AC_LIBOBJ invocations to module description.
> cloexec: Move AC_LIBOBJ invocations to module description.
> check-version: Move AC_LIBOBJ invocations to module description.
> chdir-safer: Move AC_LIBOBJ invocations to module description.
> canonicalize: Move AC_LIBOBJ invocations to module description.
> canon-host: Move AC_LIBOBJ invocations to module description.
> backupfile: Move AC_LIBOBJ invocations to module description.
> argmatch: Move AC_LIBOBJ invocations to module description.
> crypto/arctwo: Move AC_LIBOBJ invocations to module description.
> crypto/arcfour: Move AC_LIBOBJ invocations to module description.
> write: Move AC_LIBOBJ invocations to module description.
> wmemset: Move AC_LIBOBJ invocations to module description.
> wmemmove: Move AC_LIBOBJ invocations to module description.
> wmemcpy: Move AC_LIBOBJ invocations to module description.
> wmemcmp: Move AC_LIBOBJ invocations to module description.
> wmemchr: Move AC_LIBOBJ invocations to module description.
> wcswidth: Move AC_LIBOBJ invocations to module description.
> wcwidth: Respect rules for use of AC_LIBOBJ.
> wctype: Move AC_LIBOBJ invocations to module description.
> wctrans: Move AC_LIBOBJ invocations to module description.
> wctomb: Move AC_LIBOBJ invocations to module description.
> wctob: Move AC_LIBOBJ invocations to module description.
> wcsxfrm: Move AC_LIBOBJ invocations to module description.
> wcstok: Move AC_LIBOBJ invocations to module description.
> wcsstr: Move AC_LIBOBJ invocations to module description.
> wcsspn: Move AC_LIBOBJ invocations to module description.
> wcsrtombs: Move AC_LIBOBJ invocations to module description.
> wcsrchr: Move AC_LIBOBJ invocations to module description.
> wcspbrk: Move AC_LIBOBJ invocations to module description.
> wcsnrtombs: Move AC_LIBOBJ invocations to module description.
> wcsnlen: Move AC_LIBOBJ invocations to module description.
> wcsncpy: Move AC_LIBOBJ invocations to module description.
> wcsncmp: Move AC_LIBOBJ invocations to module description.
> wcsncat: Move AC_LIBOBJ invocations to module description.
> wcsncasecmp: Move AC_LIBOBJ invocations to module description.
> wcslen: Move AC_LIBOBJ invocations to module description.
> wcsdup: Move AC_LIBOBJ invocations to module description.
> wcscspn: Move AC_LIBOBJ invocations to module description.
> wcscpy: Move AC_LIBOBJ invocations to module description.
> wcscoll: Move AC_LIBOBJ invocations to module description.
> wcscmp: Move AC_LIBOBJ invocations to module description.
> wcschr: Move AC_LIBOBJ invocations to module description.
> wcscat: Move AC_LIBOBJ invocations to module description.
> wcscasecmp: Move AC_LIBOBJ invocations to module description.
> wcrtomb: Move AC_LIBOBJ invocations to module description.
> wcpncpy: Move AC_LIBOBJ invocations to module description.
> wcpcpy: Move AC_LIBOBJ invocations to module description.
> waitpid: Move AC_LIBOBJ invocations to module description.
> utimensat: Move AC_LIBOBJ invocations to module description.
> usleep: Move AC_LIBOBJ invocations to module description.
> unlockpt: Move AC_LIBOBJ invocations to module description.
> unlink: Respect rules for use of AC_LIBOBJ.
> uname: Move AC_LIBOBJ invocations to module description.
> ttyname_r: Move AC_LIBOBJ invocations to module description.
> tsearch: Move AC_LIBOBJ invocations to module description.
> towctrans: Move AC_LIBOBJ invocations to module description.
> tmpfile: Move AC_LIBOBJ invocations to module description.
> times: Move AC_LIBOBJ invocations to module description.
> time_r: Move AC_LIBOBJ invocations to module description.
> timegm: Move AC_LIBOBJ invocations to module description.
> tcgetsid: Move AC_LIBOBJ invocations to module description.
> symlinkat: Move AC_LIBOBJ invocations to module description.
> symlink: Move AC_LIBOBJ invocations to module description.
> strverscmp: Move AC_LIBOBJ invocations to module description.
> strtok_r: Move AC_LIBOBJ invocations to module description.
> strtoumax: Move AC_LIBOBJ invocations to module description.
> strtoimax: Move AC_LIBOBJ invocations to module description.
> strtoull: Move AC_LIBOBJ invocations to module description.
> strtoll: Move AC_LIBOBJ invocations to module description.
> strtoul: Move AC_LIBOBJ invocations to module description.
> strtol: Move AC_LIBOBJ invocations to module description.
> strtod: Move AC_LIBOBJ invocations to module description.
> strstr*: Move AC_LIBOBJ invocations to module description.
> strsignal: Move AC_LIBOBJ invocations to module description.
> strsep: Move AC_LIBOBJ invocations to module description.
> strptime: Move AC_LIBOBJ invocations to module description.
> strpbrk: Move AC_LIBOBJ invocations to module description.
> strnlen: Move AC_LIBOBJ invocations to module description.
> strndup: Move AC_LIBOBJ invocations to module description.
> strncat: Move AC_LIBOBJ invocations to module description.
> strdup, strdup-posix: Move AC_LIBOBJ invocations to module description.
> strcspn: Move AC_LIBOBJ invocations to module description.
> strchrnul: Move AC_LIBOBJ invocations to module description.
> strcasestr*: Move AC_LIBOBJ invocations to module description.
> strcase: Move AC_LIBOBJ invocations to module description.
> stpncpy: Move AC_LIBOBJ invocations to module description.
> stpcpy: Move AC_LIBOBJ invocations to module description.
> stat: Move AC_LIBOBJ invocations to module description.
> sleep: Move AC_LIBOBJ invocations to module description.
> signbit: Move AC_LIBOBJ invocations to module description.
> sigprocmask: Move AC_LIBOBJ invocations to module description.
> sigaction: Move AC_LIBOBJ invocations to module description.
> sig2str: Move AC_LIBOBJ invocations to module description.
> setlocale: Move AC_LIBOBJ invocations to module description.
> unsetenv: Move AC_LIBOBJ invocations to module description.
> setenv: Move AC_LIBOBJ invocations to module description.
> selinux-h: Move AC_LIBOBJ invocations to module description.
> select: Respect rules for use of AC_LIBOBJ.
> scandir: Move AC_LIBOBJ invocations to module description.
> rpmatch: Move AC_LIBOBJ invocations to module description.
> rmdir: Respect rules for use of AC_LIBOBJ.
> renameat: Move AC_LIBOBJ invocations to module description.
> rename: Respect rules for use of AC_LIBOBJ.
> remove: Move AC_LIBOBJ invocations to module description.
> relocatable-lib: Move AC_LIBOBJ invocations to module description.
> relocatable-prog: Move AC_LIBOBJ invocations to module description.
> regex: Move AC_LIBOBJ invocations to module description.
> realloc-*: Move AC_LIBOBJ invocations to module description.
> readutmp: Move AC_LIBOBJ invocations to module description.
> readlinkat: Move AC_LIBOBJ invocations to module description.
> readlink: Move AC_LIBOBJ invocations to module description.
> readline: Move AC_LIBOBJ invocations to module description.
> read: Move AC_LIBOBJ invocations to module description.
> rawmemchr: Move AC_LIBOBJ invocations to module description.
> random_r: Move AC_LIBOBJ invocations to module description.
> pwrite: Move AC_LIBOBJ invocations to module description.
> putenv: Move AC_LIBOBJ invocations to module description.
> login_tty: Move AC_LIBOBJ invocations to module description.
> openpty: Move AC_LIBOBJ invocations to module description.
> forkpty: Move AC_LIBOBJ invocations to module description.
> ptsname: Move AC_LIBOBJ invocations to module description.
> pread: Move AC_LIBOBJ invocations to module description.
> posix_spawn*: Move AC_LIBOBJ invocations to module description.
> popen: Move AC_LIBOBJ invocations to module description.
> poll: Move AC_LIBOBJ invocations to module description.
> pipe-posix: Move AC_LIBOBJ invocations to module description.
> openat: Respect rules for use of AC_LIBOBJ.
> obstack-printf*: Move AC_LIBOBJ invocations to module description.
> nl_langinfo: Move AC_LIBOBJ invocations to module description.
> nanosleep: Move AC_LIBOBJ invocations to module description.
> mountlist: Move AC_LIBOBJ invocations to module description.
> mktime: Respect rules for use of AC_LIBOBJ.
> mkstemps: Move AC_LIBOBJ invocations to module description.
> mkstemp: Move AC_LIBOBJ invocations to module description.
> mkostemps: Move AC_LIBOBJ invocations to module description.
> mkostemp: Move AC_LIBOBJ invocations to module description.
> mknod: Move AC_LIBOBJ invocations to module description.
> mkfifoat: Move AC_LIBOBJ invocations to module description.
> mkfifo: Respect rules for use of AC_LIBOBJ.
> mkdtemp: Move AC_LIBOBJ invocations to module description.
> mkdir: Move AC_LIBOBJ invocations to module description.
> memset: Move AC_LIBOBJ invocations to module description.
> memrchr: Move AC_LIBOBJ invocations to module description.
> mempcpy: Move AC_LIBOBJ invocations to module description.
> memmove: Move AC_LIBOBJ invocations to module description.
> memmem*: Move AC_LIBOBJ invocations to module description.
> memcpy: Move AC_LIBOBJ invocations to module description.
> memcmp: Simplify autoconf macro.
> memcmp: Move AC_LIBOBJ invocations to module description.
> memchr: Respect rules for use of AC_LIBOBJ.
> mbtowc: Move AC_LIBOBJ invocations to module description.
> mbsrtowcs: Move AC_LIBOBJ invocations to module description.
> mbsnrtowcs: Move AC_LIBOBJ invocations to module description.
> mbsinit: Move AC_LIBOBJ invocations to module description.
> mbrlen: Move AC_LIBOBJ invocations to module description.
> mbrtowc: Respect rules for use of AC_LIBOBJ.
> malloc-*: Move AC_LIBOBJ invocations to module description.
> lstat, openat: Respect rules for use of AC_LIBOBJ.
> lseek: Move AC_LIBOBJ invocations to module description.
> linkat: Move AC_LIBOBJ invocations to module description.
> link: Respect rules for use of AC_LIBOBJ.
> lchown: Move AC_LIBOBJ invocations to module description.
> iswctype: Move AC_LIBOBJ invocations to module description.
> iswblank: Move AC_LIBOBJ invocations to module description.
> atanl: Move AC_LIBOBJ invocations to module description.
> acosl: Move AC_LIBOBJ invocations to module description.
> asinl: Respect rules for use of AC_LIBOBJ.
> tanl: Move AC_LIBOBJ invocations to module description.
> cosl: Move AC_LIBOBJ invocations to module description.
> sinl: Move AC_LIBOBJ invocations to module description.
> logl: Move AC_LIBOBJ invocations to module description.
> expl: Move AC_LIBOBJ invocations to module description.
> roundl: Move AC_LIBOBJ invocations to module description.
> round: Move AC_LIBOBJ invocations to module description.
> roundf: Move AC_LIBOBJ invocations to module description.
> truncl: Move AC_LIBOBJ invocations to module description.
> trunc: Move AC_LIBOBJ invocations to module description.
> truncf: Move AC_LIBOBJ invocations to module description.
> ceill: Move AC_LIBOBJ invocations to module description.
> ceil: Move AC_LIBOBJ invocations to module description.
> ceilf: Move AC_LIBOBJ invocations to module description.
> floorl: Respect rules for use of AC_LIBOBJ.
> floor: Respect rules for use of AC_LIBOBJ.
> floorf: Move AC_LIBOBJ invocations to module description.
> sqrtl: Respect rules for use of AC_LIBOBJ.
> ldexpl: Respect rules for use of AC_LIBOBJ.
> frexpl*: Respect rules for use of AC_LIBOBJ.
> frexp, frexp-nolibm: Move AC_LIBOBJ invocations to module description.
> isnan: Respect rules for use of AC_LIBOBJ.
> isnanl*: Respect rules for use of AC_LIBOBJ.
> isnand*: Move AC_LIBOBJ invocations to module description.
> isnanf*: Move AC_LIBOBJ invocations to module description.
> isnan*: Separate the AC_LIBOBJ invocations.
> isinf: Move AC_LIBOBJ invocations to module description.
> isfinite: Move AC_LIBOBJ invocations to module description.
> isblank: Move AC_LIBOBJ invocations to module description.
> isapipe: Move AC_LIBOBJ invocations to module description.
> ioctl: Move AC_LIBOBJ invocations to module description.
> imaxdiv: Move AC_LIBOBJ invocations to module description.
> imaxabs: Move AC_LIBOBJ invocations to module description.
> getaddrinfo: Move AC_LIBOBJ invocations to module description.
> inet_pton. getaddrinfo: Respect rules for use of AC_LIBOBJ.
> inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
> iconv_open: Move AC_LIBOBJ invocations to module description.
> iconv_open, iconv_open-utf: Respect rules for use of AC_LIBOBJ.
> group-member: Move AC_LIBOBJ invocations to module description.
> grantpt: Move AC_LIBOBJ invocations to module description.
> glob: Move AC_LIBOBJ invocations to module description.
> getusershell: Move AC_LIBOBJ invocations to module description.
> gettimeofday: Move AC_LIBOBJ invocations to module description.
> gettimeofday, tzset: Respect rules for use of AC_LIBOBJ.
> getsubopt: Move AC_LIBOBJ invocations to module description.
> getpass-gnu: Move AC_LIBOBJ invocations to module description.
> getpass: Move AC_LIBOBJ invocations to module description.
> getpagesize: Move AC_LIBOBJ invocations to module description.
> getopt: Move AC_LIBOBJ invocations to module description.
> getopt, argp: Respect rules for use of AC_LIBOBJ.
> getlogin_r: Move AC_LIBOBJ invocations to module description.
> getlogin: Move AC_LIBOBJ invocations to module description.
> getloadavg: Move AC_LIBOBJ invocations to module description.
> gethrxtime: Move AC_LIBOBJ invocations to module description.
> gethostname: Move AC_LIBOBJ invocations to module description.
> getgroups: Move AC_LIBOBJ invocations to module description.
> getdtablesize: Move AC_LIBOBJ invocations to module description.
> getdomainname: Move AC_LIBOBJ invocations to module description.
> getline: Move AC_LIBOBJ invocations to module description.
> getline: Simplify.
> getdelim: Move AC_LIBOBJ invocations to module description.
> getcwd: Move AC_LIBOBJ invocations to module description.
> getcwd-lgpl: Move AC_LIBOBJ invocations to module description.
> crypto/gc: Move AC_LIBOBJ invocations to module description.
> fwriting: Move AC_LIBOBJ invocations to module description.
> fwritable: Move AC_LIBOBJ invocations to module description.
> futimens: Move AC_LIBOBJ invocations to module description.
> ftruncate: Move AC_LIBOBJ invocations to module description.
> fsync: Move AC_LIBOBJ invocations to module description.
> fsusage: Move AC_LIBOBJ invocations to module description.
> freopen: Move AC_LIBOBJ invocations to module description.
> free: Move AC_LIBOBJ invocations to module description.
> freadable: Move AC_LIBOBJ invocations to module description.
> fpurge: Move AC_LIBOBJ invocations to module description.
> fpending: Move AC_LIBOBJ invocations to module description.
> fopen: Move AC_LIBOBJ invocations to module description.
> fnmatch, fnmatch-gnu: Move AC_LIBOBJ invocations to module description.
> flock: Move AC_LIBOBJ invocations to module description.
> fileblocks: Move AC_LIBOBJ invocations to module description.
> fflush: Move AC_LIBOBJ invocations to module description.
> fdopendir: Move AC_LIBOBJ invocations to module description.
> _Exit: Move AC_LIBOBJ invocations to module description.
> euidaccess: Respect rules for use of AC_LIBOBJ.
> error: Move AC_LIBOBJ invocations to module description.
> duplocale: Move AC_LIBOBJ invocations to module description.
> dirfd: Move AC_LIBOBJ invocations to module description.
> chown: Respect rules for use of AC_LIBOBJ.
> chdir-long: Move AC_LIBOBJ invocations to module description.
> canonicalize-lgpl: Move AC_LIBOBJ invocations to module description.
> calloc-posix, calloc-gnu: Move AC_LIBOBJs to module description.
> btowc: Move AC_LIBOBJ invocations to module description.
> atexit: Move AC_LIBOBJ invocations to module description.
> atoll: Move AC_LIBOBJ invocations to module description.
> argz: Move AC_LIBOBJ invocations to module description.
> alphasort: Move AC_LIBOBJ invocations to module description.
> verify: new macro verify_expr; verify_true deprecated
> fnmatch, fnmatch-gnu: Move AC_LIBOBJ invocations to module description.
> flock: Move AC_LIBOBJ invocations to module description.
> fileblocks: Move AC_LIBOBJ invocations to module description.
> fflush: Move AC_LIBOBJ invocations to module description.
> fdopendir: Move AC_LIBOBJ invocations to module description.
> _Exit: Move AC_LIBOBJ invocations to module description.
> euidaccess: Respect rules for use of AC_LIBOBJ.
> error: Move AC_LIBOBJ invocations to module description.
> duplocale: Move AC_LIBOBJ invocations to module description.
> dirfd: Move AC_LIBOBJ invocations to module description.
> chown: Respect rules for use of AC_LIBOBJ.
> chdir-long: Move AC_LIBOBJ invocations to module description.
> canonicalize-lgpl: Move AC_LIBOBJ invocations to module description.
> calloc-posix, calloc-gnu: Move AC_LIBOBJs to module description.
> btowc: Move AC_LIBOBJ invocations to module description.
> atexit: Move AC_LIBOBJ invocations to module description.
> atoll: Move AC_LIBOBJ invocations to module description.
> argz: Move AC_LIBOBJ invocations to module description.
> alphasort: Move AC_LIBOBJ invocations to module description.
> verify: new macro verify_expr; verify_true deprecated
> init.sh: give more portable redirection-related advice in a comment
> Fix ChangeLog typo in my previous commit.
.gnulib | 2 +-
bootstrap | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gnulib b/.gnulib
index 5bf7fda..90d0c49 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 5bf7fda437a10cc10cbd1be1bd06b374a581f0dd
+Subproject commit 90d0c4909f2b77d711ea6332a99a9332ff1bab36
diff --git a/bootstrap b/bootstrap
index 522ac70..b286beb 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2011-05-16.16; # UTC
+scriptversion=2011-06-22.06; # UTC
# Bootstrap this package from checked-out sources.
@@ -290,7 +290,7 @@ sort_patterns() {
P
x
s/^\n//
- }'
+ }' | sed '/^$/d'
}
# If $STR is not already on a line by itself in $FILE, insert it,
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH v2] lxc: Fail connection attempt if cgroups not mounted
by Cole Robinson
Currently a user can connect to lxc:/// if cgroups aren't mounted, but
they can't do a whole lot: starting and even stopping guests doesn't work
(the latter only if cgroups were unmounted behind libvirt's back). To make
matters worse, even after mounting cgroups, libvirt must be restarted
to actually notice.
This is frustrating for users who may make it all the way to the end of
the virt-manager 'New VM' wizard only to receive an error that requires
a libvirtd restart.
Fix this by checking for cgroup mounts at lxc:/// connect time, and
if none are found, fail the connection.
v2:
Track 'privileged' in lxc driver even though it isn't much useful
at the moment. If it ever becomes useful we want things to just work.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/lxc/lxc_conf.h | 1 +
src/lxc/lxc_driver.c | 33 ++++++++++++++++++++++++++-------
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index 66aa469..7276699 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -54,6 +54,7 @@ struct __lxc_driver {
char *logDir;
int log_libvirtd;
int have_netns;
+ int privileged : 1;
virDomainEventStatePtr domainEventState;
};
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index d0f7158..55e562e 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -107,6 +107,20 @@ static void lxcDomainEventFlush(int timer, void *opaque);
static void lxcDomainEventQueue(lxc_driver_t *driver,
virDomainEventPtr event);
+static int lxcGetCgroup(lxc_driver_t *driver)
+{
+ if (driver->cgroup)
+ return 0;
+
+ int rc = virCgroupForDriver("lxc", &driver->cgroup, driver->privileged, 1);
+ if (rc < 0) {
+ char buf[1024];
+ VIR_DEBUG("Unable to create cgroup for LXC driver: %s",
+ virStrerror(-rc, buf, sizeof(buf)));
+ }
+
+ return rc;
+}
static virDrvOpenStatus lxcOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
@@ -146,6 +160,15 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
"%s", _("lxc state driver is not active"));
return VIR_DRV_OPEN_ERROR;
}
+
+ /* Driver loaded, but no cgroup stuff mounted. Refresh the data
+ * but error if nothing available */
+ if (lxcGetCgroup(lxc_driver) < 0) {
+ lxcError(VIR_ERR_INTERNAL_ERROR,
+ _("The 'cpuacct', 'devices' & 'memory' cgroups "
+ "controllers must be mounted"));
+ return VIR_DRV_OPEN_ERROR;
+ }
}
conn->privateData = lxc_driver;
@@ -2063,11 +2086,9 @@ cleanup:
virDomainObjUnlock(vm);
}
-
static int lxcStartup(int privileged)
{
char *ld;
- int rc;
/* Valgrind gets very annoyed when we clone containers, so
* disable LXC when under valgrind
@@ -2100,6 +2121,8 @@ static int lxcStartup(int privileged)
}
lxcDriverLock(lxc_driver);
+ lxc_driver->privileged = privileged;
+
if (virDomainObjListInit(&lxc_driver->domains) < 0)
goto cleanup;
@@ -2113,11 +2136,7 @@ static int lxcStartup(int privileged)
lxc_driver->log_libvirtd = 0; /* by default log to container logfile */
lxc_driver->have_netns = lxcCheckNetNsSupport();
- rc = virCgroupForDriver("lxc", &lxc_driver->cgroup, privileged, 1);
- if (rc < 0) {
- char buf[1024];
- VIR_DEBUG("Unable to create cgroup for LXC driver: %s",
- virStrerror(-rc, buf, sizeof(buf)));
+ if (lxcGetCgroup(lxc_driver) < 0) {
/* Don't abort startup. We will explicitly report to
* the user when they try to start a VM
*/
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH 2/2] lxc: Fail connection attempt if cgroups not mounted
by Cole Robinson
Currently a user can connect to lxc:/// if cgroups aren't mounted, but
they can't do a whole lot: starting and even stopping guests doesn't work
(the latter only if cgroups were unmounted behind libvirts back). To make
matters worse, even after mounting cgroups, libvirt must be restarted
to actually notice.
This is frustrating for users who may make it all the way to the end of
the virt-manager 'New VM' wizard only to receive an error that requires
a libvirtd restart.
Fix this by checking for cgroup mounts at lxc:/// connect time, and
if none are found, fail the connection.
I'm not sure if there are any negative consequences to putting this
logic in lxcOpen...
---
src/lxc/lxc_driver.c | 33 ++++++++++++++++++++++++++-------
1 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index d0f7158..770bdf0 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -107,6 +107,22 @@ static void lxcDomainEventFlush(int timer, void *opaque);
static void lxcDomainEventQueue(lxc_driver_t *driver,
virDomainEventPtr event);
+static int lxcGetCgroup(lxc_driver_t *driver)
+{
+ int privileged = 1;
+
+ if (driver->cgroup)
+ return 0;
+
+ int rc = virCgroupForDriver("lxc", &driver->cgroup, privileged, 1);
+ if (rc < 0) {
+ char buf[1024];
+ VIR_DEBUG("Unable to create cgroup for LXC driver: %s",
+ virStrerror(-rc, buf, sizeof(buf)));
+ }
+
+ return rc;
+}
static virDrvOpenStatus lxcOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
@@ -146,6 +162,15 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
"%s", _("lxc state driver is not active"));
return VIR_DRV_OPEN_ERROR;
}
+
+ /* Driver loaded, but no cgroup stuff mounted. Refresh the data
+ * but error if nothing available */
+ if (lxcGetCgroup(lxc_driver) < 0) {
+ lxcError(VIR_ERR_INTERNAL_ERROR,
+ _("The 'cpuacct', 'devices' & 'memory' cgroups "
+ "controllers must be mounted"));
+ return VIR_DRV_OPEN_ERROR;
+ }
}
conn->privateData = lxc_driver;
@@ -2063,11 +2088,9 @@ cleanup:
virDomainObjUnlock(vm);
}
-
static int lxcStartup(int privileged)
{
char *ld;
- int rc;
/* Valgrind gets very annoyed when we clone containers, so
* disable LXC when under valgrind
@@ -2113,11 +2136,7 @@ static int lxcStartup(int privileged)
lxc_driver->log_libvirtd = 0; /* by default log to container logfile */
lxc_driver->have_netns = lxcCheckNetNsSupport();
- rc = virCgroupForDriver("lxc", &lxc_driver->cgroup, privileged, 1);
- if (rc < 0) {
- char buf[1024];
- VIR_DEBUG("Unable to create cgroup for LXC driver: %s",
- virStrerror(-rc, buf, sizeof(buf)));
+ if (lxcGetCgroup(lxc_driver) < 0) {
/* Don't abort startup. We will explicitly report to
* the user when they try to start a VM
*/
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH 1/2] set HAVE_LIBNL in config.h
by Stefan Berger
Set HAVE_LIBNL to be able to conditionally compile libnl code.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
configure.ac | 3 +++
1 file changed, 3 insertions(+)
Index: libvirt-acl/configure.ac
===================================================================
--- libvirt-acl.orig/configure.ac
+++ libvirt-acl/configure.ac
@@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then
], [
AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support])
])
+ have_libnl=yes
+ AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available])
fi
+AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS])
AC_SUBST([LIBNL_LIBS])
13 years, 5 months
[libvirt] Appending REJECT rules.
by Stephen O'Dor
Greetings folks,
I've patched the libvirt iptables interface to append it's REJECT
rules rather than insert at the head. Idea being that I'm not the only
person who usually puts the REJECTs at the end of a chain.
In my particular case any custom ACCEPT rules involving the bridge
interfaces would get pushed below the rules that libvirt puts in to
REJECT everything on the bridge interface.
I'm using the routed network mode, I have no idea if this hurts any
other network mode.
Thanks,
-Steve
--- iptables.c 2011-02-28 23:03:32.000000000 -0800
+++ iptables.c_new 2011-05-18 14:00:59.110855881 -0700
@@ -51,7 +51,8 @@
enum {
ADD = 0,
- REMOVE
+ REMOVE,
+ APPEND
};
typedef struct
@@ -111,7 +112,7 @@
? IP6TABLES_PATH : IPTABLES_PATH);
virCommandAddArgList(cmd, "--table", rules->table,
- action == ADD ? "--insert" : "--delete",
+ action == ADD ? "--insert" : action ==
REMOVE ? "--delete" : "--append",
rules->chain, arg, NULL);
va_start(args, arg);
@@ -666,7 +667,7 @@
int family,
const char *iface)
{
- return iptablesForwardRejectOut(ctx, family, iface, ADD);
+ return iptablesForwardRejectOut(ctx, family, iface, APPEND);
}
/**
@@ -722,7 +723,7 @@
int family,
const char *iface)
{
- return iptablesForwardRejectIn(ctx, family, iface, ADD);
+ return iptablesForwardRejectIn(ctx, family, iface, APPEND);
}
/**
13 years, 5 months
[libvirt] [PATCH 2/2] fix compilation on systems missing libnl and new includes
by Stefan Berger
This patch fixes the compilation of netlink.c and interface.c on those
systems missing either libnl or that have an older linux/if_link.h
include file not supporting macvtap or VF_PORTS.
WITH_MACVTAP is '1' if newer include files were detected, '0' otherwise.
IFLA_PORT_MAX is defined in linux/if_link.h if yet more functionality is
supported.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/util/interface.c | 31 +++++++++++++++++++++++++++----
src/util/netlink.c | 6 +++++-
src/util/netlink.h | 4 +++-
3 files changed, 35 insertions(+), 6 deletions(-)
Index: libvirt-acl/src/util/interface.c
===================================================================
--- libvirt-acl.orig/src/util/interface.c
+++ libvirt-acl/src/util/interface.c
@@ -510,7 +510,7 @@ ifaceSetMacaddr(const char *ifname ATTRI
*
* Returns 0 on success, -1 on fatal error.
*/
-#if __linux__
+#if defined(__linux__) && WITH_MACVTAP
int
ifaceMacvtapLinkAdd(const char *type,
const unsigned char *macaddress, int macaddrsize,
@@ -649,8 +649,14 @@ ifaceMacvtapLinkAdd(const char *type ATT
int *retry ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceMacvtapLinkAdd is not supported since the include "
+ "files were too old"));
+# else
_("ifaceMacvtapLinkAdd is not supported on non-linux "
"platforms"));
+# endif
+
return -1;
}
@@ -666,7 +672,7 @@ ifaceMacvtapLinkAdd(const char *type ATT
*
* Returns 0 on success, -1 on fatal error.
*/
-#if __linux__
+#if defined( __linux__) && WITH_MACVTAP
int
ifaceLinkDel(const char *ifname)
{
@@ -751,14 +757,20 @@ int
ifaceLinkDel(const char *ifname ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceLinkDel is not supported since the include files "
+ "were too old"));
+# else
_("ifaceLinkDel is not supported on non-linux platforms"));
+# endif
return -1;
}
#endif
-#if __linux__
+#if defined(__linux__) && defined(IFLA_PORT_MAX)
+
static struct nla_policy ifla_policy[IFLA_MAX + 1] =
{
[IFLA_VF_PORTS] = { .type = NLA_NESTED },
@@ -894,8 +906,14 @@ ifaceMacvtapLinkDump(bool nltarget_kerne
uint32_t (*getPidFunc)(void) ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !defined(IFLA_PORT_MAX)
+ _("ifaceMacvtapLinkDump is not supported since the include "
+ "files were too old"));
+# else
_("ifaceMacvtapLinkDump is not supported on non-linux "
"platforms"));
+# endif
+
return -1;
}
@@ -920,7 +938,7 @@ ifaceMacvtapLinkDump(bool nltarget_kerne
*
* Return 0 on success, != 0 otherwise
*/
-#if __linux__
+#if defined(__linux__) && WITH_MACVTAP
int
ifaceGetNthParent(int ifindex, const char *ifname, unsigned int nthParent,
int *parent_ifindex, char *parent_ifname,
@@ -981,7 +999,12 @@ ifaceGetNthParent(int ifindex ATTRIBUTE_
unsigned int *nth ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceGetNthParent is not supported since the include files "
+ "were too old"));
+# else
_("ifaceGetNthParent is not supported on non-linux platforms"));
+# endif
return -1;
}
Index: libvirt-acl/src/util/netlink.c
===================================================================
--- libvirt-acl.orig/src/util/netlink.c
+++ libvirt-acl/src/util/netlink.c
@@ -55,7 +55,7 @@
* Returns 0 on success, -1 on error. In case of error, no response
* buffer will be returned.
*/
-#if __linux__
+#if defined(__linux__) && WITH_MACVTAP
int nlComm(struct nl_msg *nl_msg,
unsigned char **respbuf, unsigned int *respbuflen,
int nl_pid)
@@ -143,7 +143,11 @@ int nlComm(struct nl_msg *nl_msg ATTRIBU
int nl_pid ATTRIBUTE_UNUSED)
{
netlinkError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !defined(HAVE_LIBNL)
+ _("nlComm is not supported since libnl was not available"));
+# else
_("nlComm is not supported on non-linux platforms"));
+# endif
return -1;
}
Index: libvirt-acl/src/util/netlink.h
===================================================================
--- libvirt-acl.orig/src/util/netlink.h
+++ libvirt-acl/src/util/netlink.h
@@ -20,7 +20,9 @@
#ifndef __VIR_NETLINK_H__
# define __VIR_NETLINK_H__
-# if __linux__
+# include "config.h"
+
+# if defined(__linux__) && defined(HAVE_LIBNL)
# include <netlink/msg.h>
13 years, 5 months
[libvirt] [PATCH 1/2] python: Generate virStreamFree but don't expose in bindings
by Cole Robinson
Turns out I was right in removing this the first time :) This is
needed in our custom __del__ function, but the C code wasn't
being generated. Add new infrastructure to do what we want
---
python/generator.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/python/generator.py b/python/generator.py
index 7a04d18..a3ebcf9 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -393,7 +393,6 @@ skip_function = (
'virSaveLastError', # We have our own python error wrapper
'virFreeError', # Only needed if we use virSaveLastError
- 'virStreamFree', # Overridden in libvirt-override-virStream.py
'virStreamRecvAll', # Pure python libvirt-override-virStream.py
'virStreamSendAll', # Pure python libvirt-override-virStream.py
'virStreamRecv', # overridden in libvirt-override-virStream.py
@@ -423,6 +422,12 @@ skip_function = (
"virStorageVolGetConnect",
)
+# Generate C code, but skip python impl
+function_skip_python_impl = {
+ "virStreamFree", # Needed in custom virStream __del__, but free shouldn't
+ # be exposed in bindings
+}
+
function_skip_index_one = (
"virDomainRevertToSnapshot",
)
@@ -433,6 +438,7 @@ def print_function_wrapper(name, output, export, include):
global unknown_types
global functions
global skipped_modules
+ global function_skip_python_impl
try:
(desc, ret, args, file, cond) = functions[name]
@@ -585,6 +591,9 @@ def print_function_wrapper(name, output, export, include):
include.write("#endif /* %s */\n" % cond)
export.write("#endif /* %s */\n" % cond)
output.write("#endif /* %s */\n" % cond)
+
+ if name in function_skip_python_impl:
+ return 0
return 1
def buildStubs():
--
1.7.4.4
13 years, 5 months