[libvirt] Checkpoint VMs
by Maximilian Wilhelm
Hi!
Some months ago there were some mails about ideas of adding new API
functions for checkpointing of domains.
For the project group Virtualized SuperComputer (the crazy guys with
the ESX driver) we would like to have such a feature and would be
willing to propose API patches and anything the like.
As we have to deal with many VMs at the same time which belong to one
computation job (think: virtualized HPC cluster) we are facing the
problem to checkpoint a set of VMs at the same time.
So besides a usual checkpoint we would be interested in something like
checkpointAt (host, vm, timestamp)
restoreFromCheckpointAt (host, vm, timestamp)
an let the hypervisor / libvirtd / whatever piece of software on the
host face the problem to execute the checkpoint/restore command at
<timestamp>.
The main idea behind this is to checkpoint or restore the set of VMs
as simultaniously as possible.
As far as I got it ESX for examples is able to execute tasks at a
given point of time once or recurring as far as you have a Virtual
Center with all your hosts belong^Wconnected to it.
Any opinions on such new functions?
I guess more people could be interested in this functionality.
Comments welcome.
Ciao
Max
--
Follow the white penguin.
15 years, 5 months
[libvirt] Can't Pass Through USB Device To Ubuntu 9.05 Guest OS
by Robert L Cochran
Greetings!
I created Bug 504444
<https://bugzilla.redhat.com/show_bug.cgi?id=504444> which is partially
quoted in this post:
----------------------------------------------------------------
Coding this xml:
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x0403'/>
<product id='0x6001'/>
</source>
</hostdev>
should let my Ubuntu 9.04 guest have access to the device, which in this case
is a USB-to-Serial UART (based on an FTDI FT232RL chip.) However the guest does
not "see" the device or recognize it in any way. It does not show up in the
guest's /var/log/messages or in the output of lsusb. I would like the guest to
have access to this device.
This is what virsh seems to be seeing:
# virsh dumpxml Ubuntu9
<domain type='kvm'>
<name>Ubuntu9</name>
<uuid>cb8c3d15-fe92-1bf2-5676-03370743e815</uuid>
<memory>1572864</memory>
<currentMemory>1572864</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/Ubuntu9.img'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='network'>
<mac address='54:52:00:74:32:2f'/>
<source network='default'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='es1370'/>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x0403'/>
<product id='0x6001'/>
</source>
</hostdev>
</devices>
</domain>
Version-Release number of selected component (if applicable):
libvirt-0.6.2-11.fc11.x86_64
----------------------------------
Any suggestions for fixing this problem? Is there a clear procedure for
getting a Fedora virtualization guest to recognize a USB device?
Thanks for your help!
Bob Cochran
15 years, 5 months
[libvirt] Release of libvirt-0.6.4
by Daniel Veillard
The monthly release is out !
There is a number of new things in that release, but as happens in
time-based releases some are not fully complete, for example the
OpenNebula driver was added but it still need a bit of work on the
detection code and a bit of cleanup to avoid a GPL/AFS licencing
issue, so please don't enable it except for test builds. We also
have a new set of Interface config APIs but they are not yet
implemented by a driver and the XML import/export routines are not
there yet. Still there is a lot of things to use and discover in this
release as you can see below:
* New features:
- new API virStorageVolCreateXMLFrom (Cole Robinson)
- full VBox graphic capabilities (Pritesh Kothari)
- Interface config APIs (Laine Stump)
- APIs for domain XML conversions (Daniel Berrange)
- initial version of OpenNebula driver (Abel Miguez Rodriguez)
* Portability:
- better compiler warning selection (Daniel Berrange)
- Win32 portability fixes (Daniel Berrange)
* Documentation:
- documentation for <sound> device XML format (Cole Robinson)
- storage format documentation fixes (Ryota Ozaki)
- docs for XML conversion APIs (Daniel Berrange)
- inconsistencies in storage volume docs and schemas (Ryota Ozaki)
* Bug fixes:
- fix hostdev managed handling (Mark McLoughlin)
- lxc_controller should not cash without args (Guido Gunther)
- bug fixes in I/O routines (Guido Gunther)
- fix migrationsave/restore for QEmu 0.10.0 (Daniel Berrange)
- avoid crash on VBox init (Guido Gunther)
- fix dev and cgroup init in LXC (Ryota Ozaki)
- QEmu startup fix (Cole Robinson)
- block node reboots from LXCs (Ryota Ozaki)
- QEmu argv detection fix for recent kvm (Daniel Berrange)
- fix watch/timer event deletion (Daniel Berrange)
- fix XML escaping bug
- various locking bugs (Daniel Berrange)
- avoid a deadlock in HAL nodedev driver (Cole Robinson)
- detection of node device media insert/eject (Cole Robinson)
- broken networking with new QEMU/KVM >= 86 (Daniel Berrange)
- various fixes in domain and network startup error report (Cole
Robinson)
- double free on unexpected client disconnect (Daniel Berrange)
* Improvements:
- cleanups and doc on virExec (Cole Robinson)
- error reporting in QEmu migrations (Cole Robinson)
- better path and driver detection in VBox (Pritesh Kothari)
- avoid caching QEMU driver capabilities(Cole Robinson)
- multiple graphics elements definitions (Pritesh Kothari)
- LSB init header init.d improvements (Frederik Himpe)
- special erro code for invalid operations (Daniel Berrange)
- dlopen error logging (Daniel Berrange)
- fix UUID and name uniqueness (Daniel Berrange)
- improvement on VBox initialization (Pritesh Kothari and Dan Berrange)
- "Host only" and "Internal" network in VBox (Pritesh Kothari)
- add utility virExecDaemonize (Cole Robinson)
- enable bridges without IP (Ludwig Nussel)
- 'make -s' silencing (Daniel Berrange)
- test case for exercising the event loop (Daniel Berrange)
- virsh commands vol-clone and vol-create-from (Cole Robinson)
- new xend don't use [] around cpumaps (Tatsuro Enokura)
- add the CIL mutex lock checker (Daniel Berrange)
- fix some LXC error code (Amy Griffis)
- virInterface python bindings (Daniel Berrange)
- fix to the example code for event handling (Pritesh Kothari)
- always add location informations to logging (Daniel Berrange)
- python domain events example and binding (Daniel Berrange)
- PPC Qemu Machine Type update (Thomas Baker)
* Cleanups:
- strings bug in virsh (Daniel Berrange)
- various cleanups in storage code (Cole Robinson)
- rpm spec cleanups
- destructors data cleanups (Laine Stump)
- some QEmu code refactoring (Daniel Berrange)
- avoid dependancy on libcap (Daniel Berrange)
- python import cleanup (Cole Robinson)
- virAsprintf based cleanups in storage code (Cole Robinson)
- fix some direct stderr logging
- OpenNebula driver cleanups (Daniel Berrange)
Thanks everybody for the contributions for this new release !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years, 5 months
[libvirt] Regression in createQemuImg()@storage_backend_fs.c of 0.6.4
by Ryota Ozaki
Hi,
I've found a regression in using a backing store of a volume (qcow2)
in a pool (dir). The following code of 0.6.4 hits my system that works
with 0.6.3.
static int createQemuImg(virConnectPtr conn,
virStorageVolDefPtr vol,
virStorageVolDefPtr inputvol) {
(snip)
const char *inputBackingPath = (inputvol ? inputvol->backingStore.path
: NULL);
(snip)
/* XXX: Not strictly required: qemu-img has an option a different
* backing store, not really sure what use it serves though, and it
* may cause issues with lvm. Untested essentially.
*/
if (!inputBackingPath ||
!STREQ(inputBackingPath, vol->backingStore.path)) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("a different backing store can not "
"be specified."));
return -1;
}
The inputBackingPath will be always NULL when it is called via
virStorageBackendFileSystemVolBuild(). (The third argument is
passed to that of createQemuImg as it is.)
static int
virStorageBackendFileSystemVolBuild(virConnectPtr conn,
virStorageVolDefPtr vol) {
return _virStorageBackendFileSystemVolBuild(conn, vol, NULL);
}
I've addressed the regression with the patch
- if (!inputBackingPath ||
+ if (inputBackingPath &&
However, I'm not sure whether this fix satisfies the aim of
the original code. Any idea?
Thanks in advance,
ozaki-r
15 years, 5 months
[libvirt] IPv6 subnet on virbr0
by Bernie Innocenti
Hello,
in a common scenario where there aren't enough public IPv4 addresses for
all domains, I have elaborated this workaround:
- the host operates a sixxs.net IPv6 tunnel with aiccu.
- the virbr0 interface is manually configured an IPv6 address
within a /64 subnet delegated by sixxs.net. (I do this from
/etc/rc.local for lack of a better place)
- radvd runs on the host to autoconfigure IPv6 for the guests
on virbr0 and advertise the host as a gateway
With this setup, all machines are globally addressable from the IPv6
internet, which is still quite useful for backstage services such as a
build farm.
In order to automate this setup, libvirt should support configuring an
IPv6 address on bridged interfaces, and possibly multiple addresses for
dual stack setups. Automatically running radvd would make a nice goodie.
--
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/
15 years, 5 months
[libvirt] virsh edit error
by Doug Goldstein
In an attempt to rename a kvm vm (which was powered off) I performed
the following:
$ virsh edit old-name
Then changed <name>old-name</name> to <name>new-name</name> and saved
and quit from the editor.
$ virsh list --all
Id Name State
----------------------------------
- old-name shut off
- new-name shut off
Performing an edit on each of these shows they're completely
identical. Even the <name> section shows the old-name on both of them.
I've performed restarts of libvirtd as well.
If the action I did is truly invalid, we should catch that an error
out on it. However I think VM renaming can be a valid use case and we
have the UUID to match off of for the rename. Basically, I'm
contacting the list to see if my use case was invalid and I should
write my patch to spit an error, or if I should write my patch to
correct the improper handling. Patch to follow based on responses.
Thanks all.
--
Doug Goldstein
15 years, 5 months
[libvirt] PATCH: Fix redetection of transient QEMU VMs on daemon restarts
by Daniel P. Berrange
When the libvirtd daemon starts up, it reads all config files from
/etc/libvirt/qemu. For each config file loaded, it then probes for
a pidfile / live status XML config in /var/run/libvirt/qemu.
In retrospect there is an obvious problem with this approach: it misses
all transient VMs which don't ever have config files in /etc/libvirt/qemu.
The core goal of this patch, is thus to change the way we deal with startup
to apply the following logic.
- Scan & load all status files in /var/run/libvirt/qemu for running VMs
- Reconnect to the monitor for all VMs, and re-detect VCPU threads.
- Scan & load all inactive configs in /etc/libvirt/qemu
This ensures we always re-detect all inactive and running VMs, whether
transient or persistent.
It also fixes two other bugs, first we forgot to detect VCPU threads,
so vCPU affinity functions were broken, and it also re-reserves the MCS
category with selinux so it is not re-used later.
Finally, if the attempt to reconnect to the QEMU monitor for a running
VM fails, then we explicitly kill off that VM, rather than just ignoring
it. This avoids leaving orphaned QEMU processes.
The patch is larger than anticipated, because I moved all the status
file code out of QEMU driver into the generic domain_conf.c file. This
enables both scanning loops to be done via the single method
virDomainLoadAllConfigs, just by pasing different directories. I also
want to re-use this code in the LXC and UML drivers to improve bugs in
their logic
domain_conf.c | 314 ++++++++++++++++++++++++++++++++++++++++++++++-----
domain_conf.h | 17 ++
libvirt_private.syms | 1
lxc_driver.c | 2
qemu_conf.c | 190 ------------------------------
qemu_conf.h | 18 --
qemu_driver.c | 178 +++++++++++++---------------
security.h | 3
security_selinux.c | 39 ++++++
uml_driver.c | 4
10 files changed, 431 insertions(+), 335 deletions(-)
Daniel
diff --git a/src/domain_conf.c b/src/domain_conf.c
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -39,6 +39,7 @@
#include "util.h"
#include "buf.h"
#include "c-ctype.h"
+#include "logging.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN
@@ -511,6 +512,31 @@ void virDomainObjListFree(virDomainObjLi
vms->count = 0;
}
+
+static virDomainObjPtr virDomainObjNew(virConnectPtr conn)
+{
+ virDomainObjPtr domain;
+
+ if (VIR_ALLOC(domain) < 0) {
+ virReportOOMError(conn);
+ return NULL;
+ }
+
+ if (virMutexInit(&domain->lock) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot initialize mutex"));
+ VIR_FREE(domain);
+ return NULL;
+ }
+
+ virDomainObjLock(domain);
+ domain->state = VIR_DOMAIN_SHUTOFF;
+ domain->monitorWatch = -1;
+ domain->monitor = -1;
+
+ return domain;
+}
+
virDomainObjPtr virDomainAssignDef(virConnectPtr conn,
virDomainObjListPtr doms,
const virDomainDefPtr def)
@@ -530,29 +556,15 @@ virDomainObjPtr virDomainAssignDef(virCo
return domain;
}
- if (VIR_ALLOC(domain) < 0) {
- virReportOOMError(conn);
- return NULL;
- }
-
- if (virMutexInit(&domain->lock) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot initialize mutex"));
- VIR_FREE(domain);
- return NULL;
- }
-
- virDomainObjLock(domain);
- domain->state = VIR_DOMAIN_SHUTOFF;
+ if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
+ virReportOOMError(conn);
+ return NULL;
+ }
+
+ if (!(domain = virDomainObjNew(conn)))
+ return NULL;
+
domain->def = def;
- domain->monitorWatch = -1;
- domain->monitor = -1;
-
- if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
- virReportOOMError(conn);
- VIR_FREE(domain);
- return NULL;
- }
doms->objs[doms->count] = domain;
doms->count++;
@@ -2621,6 +2633,68 @@ no_memory:
return NULL;
}
+
+static virDomainObjPtr virDomainObjParseXML(virConnectPtr conn,
+ virCapsPtr caps,
+ xmlXPathContextPtr ctxt)
+{
+ char *tmp = NULL;
+ long val;
+ xmlNodePtr config;
+ xmlNodePtr oldctxt;
+ virDomainObjPtr obj;
+
+ if (!(obj = virDomainObjNew(conn)))
+ return NULL;
+
+ if (!(config = virXPathNode(conn, "./domain", ctxt))) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no domain config"));
+ goto error;
+ }
+
+ oldctxt = ctxt->node;
+ ctxt->node = config;
+ obj->def = virDomainDefParseXML(conn, caps, ctxt, 0);
+ ctxt->node = oldctxt;
+ if (!obj->def)
+ goto error;
+
+ if (!(tmp = virXPathString(conn, "string(./@state)", ctxt))) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing domain state"));
+ goto error;
+ }
+ if ((obj->state = virDomainStateTypeFromString(tmp)) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("invalid domain state '%s'"), tmp);
+ VIR_FREE(tmp);
+ goto error;
+ }
+ VIR_FREE(tmp);
+
+ if ((virXPathLong(conn, "string(./@pid)", ctxt, &val)) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid pid"));
+ goto error;
+ }
+ obj->pid = (pid_t)val;
+
+ if(!(obj->monitorpath =
+ virXPathString(conn, "string(./monitor[1]/@path)", ctxt))) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no monitor path"));
+ goto error;
+ }
+
+ return obj;
+
+error:
+ virDomainObjFree(obj);
+ return NULL;
+}
+
+
/* Called from SAX on parsing errors in the XML. */
static void
catchXMLError (void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
@@ -2753,6 +2827,78 @@ cleanup:
xmlXPathFreeContext(ctxt);
return def;
}
+
+
+virDomainObjPtr virDomainObjParseFile(virConnectPtr conn,
+ virCapsPtr caps,
+ const char *filename)
+{
+ xmlParserCtxtPtr pctxt;
+ xmlDocPtr xml = NULL;
+ xmlNodePtr root;
+ virDomainObjPtr obj = NULL;
+
+ /* Set up a parser context so we can catch the details of XML errors. */
+ pctxt = xmlNewParserCtxt ();
+ if (!pctxt || !pctxt->sax)
+ goto cleanup;
+ pctxt->sax->error = catchXMLError;
+ pctxt->_private = conn;
+
+ if (conn) virResetError (&conn->err);
+ xml = xmlCtxtReadFile (pctxt, filename, NULL,
+ XML_PARSE_NOENT | XML_PARSE_NONET |
+ XML_PARSE_NOWARNING);
+ if (!xml) {
+ if (virGetLastError() == NULL)
+ virDomainReportError(conn, VIR_ERR_XML_ERROR,
+ "%s", _("failed to parse xml document"));
+ goto cleanup;
+ }
+
+ if ((root = xmlDocGetRootElement(xml)) == NULL) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing root element"));
+ goto cleanup;
+ }
+
+ obj = virDomainObjParseNode(conn, caps, xml, root);
+
+cleanup:
+ xmlFreeParserCtxt (pctxt);
+ xmlFreeDoc (xml);
+ return obj;
+}
+
+
+virDomainObjPtr virDomainObjParseNode(virConnectPtr conn,
+ virCapsPtr caps,
+ xmlDocPtr xml,
+ xmlNodePtr root)
+{
+ xmlXPathContextPtr ctxt = NULL;
+ virDomainObjPtr obj = NULL;
+
+ if (!xmlStrEqual(root->name, BAD_CAST "domstatus")) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("incorrect root element"));
+ goto cleanup;
+ }
+
+ ctxt = xmlXPathNewContext(xml);
+ if (ctxt == NULL) {
+ virReportOOMError(conn);
+ goto cleanup;
+ }
+
+ ctxt->node = root;
+ obj = virDomainObjParseXML(conn, caps, ctxt);
+
+cleanup:
+ xmlXPathFreeContext(ctxt);
+ return obj;
+}
+
#endif /* ! PROXY */
/************************************************************************
@@ -3704,6 +3850,33 @@ char *virDomainDefFormat(virConnectPtr c
return NULL;
}
+char *virDomainObjFormat(virConnectPtr conn,
+ virDomainObjPtr obj,
+ int flags)
+{
+ char *config_xml = NULL, *xml = NULL;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+
+ virBufferVSprintf(&buf, "<domstatus state='%s' pid='%d'>\n",
+ virDomainStateTypeToString(obj->state),
+ obj->pid);
+ virBufferEscapeString(&buf, " <monitor path='%s'/>\n", obj->monitorpath);
+
+ if (!(config_xml = virDomainDefFormat(conn,
+ obj->def,
+ flags)))
+ goto cleanup;
+
+ virBufferAdd(&buf, config_xml, strlen(config_xml));
+ virBufferAddLit(&buf, "</domstatus>\n");
+
+ xml = virBufferContentAndReset(&buf);
+cleanup:
+ VIR_FREE(config_xml);
+ return xml;
+
+}
+
#ifndef PROXY
@@ -3779,6 +3952,27 @@ cleanup:
return ret;
}
+int virDomainSaveStatus(virConnectPtr conn,
+ const char *statusDir,
+ virDomainObjPtr obj)
+{
+ int ret = -1;
+ char *xml;
+
+ if (!(xml = virDomainObjFormat(conn,
+ obj,
+ VIR_DOMAIN_XML_SECURE)))
+ goto cleanup;
+
+ if (virDomainSaveXML(conn, statusDir, obj->def, xml))
+ goto cleanup;
+
+ ret = 0;
+cleanup:
+ VIR_FREE(xml);
+ return ret;
+}
+
virDomainObjPtr virDomainLoadConfig(virConnectPtr conn,
virCapsPtr caps,
@@ -3832,17 +4026,67 @@ error:
return NULL;
}
+static virDomainObjPtr virDomainLoadStatus(virConnectPtr conn,
+ virCapsPtr caps,
+ virDomainObjListPtr doms,
+ const char *statusDir,
+ const char *name,
+ virDomainLoadConfigNotify notify,
+ void *opaque)
+{
+ char *statusFile = NULL;
+ virDomainObjPtr obj = NULL;
+ virDomainObjPtr tmp = NULL;
+
+ if ((statusFile = virDomainConfigFile(conn, statusDir, name)) == NULL)
+ goto error;
+
+ if (!(obj = virDomainObjParseFile(conn, caps, statusFile)))
+ goto error;
+
+ tmp = virDomainFindByName(doms, obj->def->name);
+ if (tmp) {
+ virDomainObjUnlock(obj);
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unexpected domain %s already exists"), obj->def->name);
+ goto error;
+ }
+
+ if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
+ virReportOOMError(conn);
+ goto error;
+ }
+
+ doms->objs[doms->count] = obj;
+ doms->count++;
+
+ if (notify)
+ (*notify)(obj, 1, opaque);
+
+ VIR_FREE(statusFile);
+ return obj;
+
+error:
+ virDomainObjFree(obj);
+ VIR_FREE(statusFile);
+ return NULL;
+}
+
int virDomainLoadAllConfigs(virConnectPtr conn,
virCapsPtr caps,
virDomainObjListPtr doms,
const char *configDir,
const char *autostartDir,
+ int liveStatus,
virDomainLoadConfigNotify notify,
void *opaque)
{
DIR *dir;
struct dirent *entry;
+ VIR_INFO("Scanning for %s configs in %s",
+ liveStatus ? "live" : "persistent", configDir);
+
if (!(dir = opendir(configDir))) {
if (errno == ENOENT)
return 0;
@@ -3863,14 +4107,24 @@ int virDomainLoadAllConfigs(virConnectPt
/* NB: ignoring errors, so one malformed config doesn't
kill the whole process */
- dom = virDomainLoadConfig(conn,
- caps,
- doms,
- configDir,
- autostartDir,
- entry->d_name,
- notify,
- opaque);
+ VIR_INFO("Loading config file '%s.xml'", entry->d_name);
+ if (liveStatus)
+ dom = virDomainLoadStatus(conn,
+ caps,
+ doms,
+ configDir,
+ entry->d_name,
+ notify,
+ opaque);
+ else
+ dom = virDomainLoadConfig(conn,
+ caps,
+ doms,
+ configDir,
+ autostartDir,
+ entry->d_name,
+ notify,
+ opaque);
if (dom) {
virDomainObjUnlock(dom);
dom->persistent = 1;
diff --git a/src/domain_conf.h b/src/domain_conf.h
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -515,7 +515,6 @@ struct _virDomainObj {
int monitor;
char *monitorpath;
int monitorWatch;
- int logfile;
int pid;
int state;
@@ -589,10 +588,22 @@ virDomainDefPtr virDomainDefParseNode(vi
xmlDocPtr doc,
xmlNodePtr root,
int flags);
+
+virDomainObjPtr virDomainObjParseFile(virConnectPtr conn,
+ virCapsPtr caps,
+ const char *filename);
+virDomainObjPtr virDomainObjParseNode(virConnectPtr conn,
+ virCapsPtr caps,
+ xmlDocPtr xml,
+ xmlNodePtr root);
+
#endif
char *virDomainDefFormat(virConnectPtr conn,
virDomainDefPtr def,
int flags);
+char *virDomainObjFormat(virConnectPtr conn,
+ virDomainObjPtr obj,
+ int flags);
int virDomainCpuSetParse(virConnectPtr conn,
const char **str,
@@ -615,6 +626,9 @@ int virDomainSaveXML(virConnectPtr conn,
int virDomainSaveConfig(virConnectPtr conn,
const char *configDir,
virDomainDefPtr def);
+int virDomainSaveStatus(virConnectPtr conn,
+ const char *statusDir,
+ virDomainObjPtr obj);
typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom,
int newDomain,
@@ -634,6 +648,7 @@ int virDomainLoadAllConfigs(virConnectPt
virDomainObjListPtr doms,
const char *configDir,
const char *autostartDir,
+ int liveStatus,
virDomainLoadConfigNotify notify,
void *opaque);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -94,6 +94,7 @@ virDomainObjListFree;
virDomainRemoveInactive;
virDomainSaveXML;
virDomainSaveConfig;
+virDomainSaveStatus;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
diff --git a/src/lxc_driver.c b/src/lxc_driver.c
--- a/src/lxc_driver.c
+++ b/src/lxc_driver.c
@@ -1176,7 +1176,7 @@ static int lxcStartup(void)
&lxc_driver->domains,
lxc_driver->configDir,
lxc_driver->autostartDir,
- NULL, NULL) < 0)
+ 0, NULL, NULL) < 0)
goto cleanup;
for (i = 0 ; i < lxc_driver->domains.count ; i++) {
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -2765,193 +2765,3 @@ cleanup:
return def;
}
-
-/* Called from SAX on parsing errors in the XML. */
-static void
-catchXMLError (void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
-{
- xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-
- if (ctxt) {
- virConnectPtr conn = ctxt->_private;
-
- if (ctxt->lastError.level == XML_ERR_FATAL &&
- ctxt->lastError.message != NULL) {
- qemudReportError (conn, NULL, NULL, VIR_ERR_XML_DETAIL,
- _("at line %d: %s"),
- ctxt->lastError.line,
- ctxt->lastError.message);
- }
- }
-}
-
-
-/**
- * qemudDomainStatusParseFile
- *
- * read the last known status of a domain
- *
- * Returns 0 on success
- */
-qemudDomainStatusPtr
-qemudDomainStatusParseFile(virConnectPtr conn,
- virCapsPtr caps,
- const char *filename, int flags)
-{
- xmlParserCtxtPtr pctxt = NULL;
- xmlXPathContextPtr ctxt = NULL;
- xmlDocPtr xml = NULL;
- xmlNodePtr root, config_root;
- virDomainDefPtr def = NULL;
- char *tmp = NULL;
- long val;
- qemudDomainStatusPtr status = NULL;
-
- if (VIR_ALLOC(status) < 0) {
- virReportOOMError(conn);
- goto error;
- }
-
- /* Set up a parser context so we can catch the details of XML errors. */
- pctxt = xmlNewParserCtxt ();
- if (!pctxt || !pctxt->sax)
- goto error;
- pctxt->sax->error = catchXMLError;
- pctxt->_private = conn;
-
- if (conn) virResetError (&conn->err);
- xml = xmlCtxtReadFile (pctxt, filename, NULL,
- XML_PARSE_NOENT | XML_PARSE_NONET |
- XML_PARSE_NOWARNING);
- if (!xml) {
- if (conn && conn->err.code == VIR_ERR_NONE)
- qemudReportError(conn, NULL, NULL, VIR_ERR_XML_ERROR,
- "%s", _("failed to parse xml document"));
- goto error;
- }
-
- if ((root = xmlDocGetRootElement(xml)) == NULL) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing root element"));
- goto error;
- }
-
- ctxt = xmlXPathNewContext(xml);
- if (ctxt == NULL) {
- virReportOOMError(conn);
- goto error;
- }
-
- if (!xmlStrEqual(root->name, BAD_CAST "domstatus")) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
- goto error;
- }
-
- ctxt->node = root;
- if(!(tmp = virXPathString(conn, "string(./@state)", ctxt))) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("invalid domain state"));
- goto error;
- } else {
- status->state = virDomainStateTypeFromString(tmp);
- VIR_FREE(tmp);
- }
-
- if((virXPathLong(conn, "string(./@pid)", ctxt, &val)) < 0) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("invalid pid"));
- goto error;
- } else
- status->pid = (pid_t)val;
-
- if(!(tmp = virXPathString(conn, "string(./monitor[1]/@path)", ctxt))) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("no monitor path"));
- goto error;
- } else
- status->monitorpath = tmp;
-
- if(!(config_root = virXPathNode(conn, "./domain", ctxt))) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "%s", _("no domain config"));
- goto error;
- }
- if(!(def = virDomainDefParseNode(conn, caps, xml, config_root, flags)))
- goto error;
- else
- status->def = def;
-
-cleanup:
- xmlFreeParserCtxt (pctxt);
- xmlXPathFreeContext(ctxt);
- xmlFreeDoc (xml);
- return status;
-
-error:
- VIR_FREE(tmp);
- VIR_FREE(status);
- goto cleanup;
-}
-
-
-/**
- * qemudDomainStatusFormat
- *
- * Get the state of a running domain as XML
- *
- * Returns xml on success
- */
-static char*
-qemudDomainStatusFormat(virConnectPtr conn,
- virDomainObjPtr vm)
-{
- char *config_xml = NULL, *xml = NULL;
- virBuffer buf = VIR_BUFFER_INITIALIZER;
-
- virBufferVSprintf(&buf, "<domstatus state='%s' pid='%d'>\n",
- virDomainStateTypeToString(vm->state),
- vm->pid);
- virBufferEscapeString(&buf, " <monitor path='%s'/>\n", vm->monitorpath);
-
- if (!(config_xml = virDomainDefFormat(conn,
- vm->def,
- VIR_DOMAIN_XML_SECURE)))
- goto cleanup;
-
- virBufferAdd(&buf, config_xml, strlen(config_xml));
- virBufferAddLit(&buf, "</domstatus>\n");
-
- xml = virBufferContentAndReset(&buf);
-cleanup:
- VIR_FREE(config_xml);
- return xml;
-}
-
-
-/**
- * qemudSaveDomainStatus
- *
- * Save the current status of a running domain
- *
- * Returns 0 on success
- */
-int
-qemudSaveDomainStatus(virConnectPtr conn,
- struct qemud_driver *driver,
- virDomainObjPtr vm)
-{
- int ret = -1;
- char *xml = NULL;
-
- if (!(xml = qemudDomainStatusFormat(conn, vm)))
- goto cleanup;
-
- if ((ret = virDomainSaveXML(conn, driver->stateDir, vm->def, xml)))
- goto cleanup;
-
- ret = 0;
-cleanup:
- VIR_FREE(xml);
- return ret;
-}
diff --git a/src/qemu_conf.h b/src/qemu_conf.h
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -92,15 +92,6 @@ struct qemud_driver {
virSecurityDriverPtr securityDriver;
};
-/* Status needed to reconenct to running VMs */
-typedef struct _qemudDomainStatus qemudDomainStatus;
-typedef qemudDomainStatus *qemudDomainStatusPtr;
-struct _qemudDomainStatus {
- char *monitorpath;
- pid_t pid;
- int state;
- virDomainDefPtr def;
-};
/* Port numbers used for KVM migration. */
#define QEMUD_MIGRATION_FIRST_PORT 49152
@@ -141,13 +132,4 @@ virDomainDefPtr qemuParseCommandLine(vir
virDomainDefPtr qemuParseCommandLineString(virConnectPtr conn,
const char *args);
-const char *qemudVirtTypeToString (int type);
-qemudDomainStatusPtr qemudDomainStatusParseFile(virConnectPtr conn,
- virCapsPtr caps,
- const char *filename,
- int flags);
-int qemudSaveDomainStatus(virConnectPtr conn,
- struct qemud_driver *driver,
- virDomainObjPtr vm);
-
#endif /* __QEMUD_CONF_H */
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -125,6 +125,8 @@ static int qemudMonitorCommandExtra(cons
static int qemudDomainSetMemoryBalloon(virConnectPtr conn,
virDomainObjPtr vm,
unsigned long newmem);
+static int qemudDetectVcpuPIDs(virConnectPtr conn,
+ virDomainObjPtr vm);
static struct qemud_driver *qemu_driver = NULL;
@@ -287,79 +289,65 @@ static int qemudOpenMonitor(virConnectPt
const char *monitor,
int reconnect);
+
+/*
+ * Open an existing VM's monitor, and re-detect VCPUs
+ * threads
+ */
+static int
+qemuReconnectDomain(struct qemud_driver *driver,
+ virDomainObjPtr obj)
+{
+ int rc;
+
+ if ((rc = qemudOpenMonitor(NULL, driver, obj, obj->monitorpath, 1)) != 0) {
+ VIR_ERROR(_("Failed to reconnect monitor for %s: %d\n"),
+ obj->def->name, rc);
+ goto error;
+ }
+
+ if (qemudDetectVcpuPIDs(NULL, obj) < 0) {
+ goto error;
+ }
+
+ if (obj->def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
+ driver->securityDriver &&
+ driver->securityDriver->domainReserveSecurityLabel &&
+ driver->securityDriver->domainReserveSecurityLabel(NULL, obj) < 0)
+ return -1;
+
+ if (obj->def->id >= driver->nextvmid)
+ driver->nextvmid = obj->def->id + 1;
+
+ return 0;
+
+error:
+ return -1;
+}
+
/**
* qemudReconnectVMs
*
- * Reconnect running vms to the daemon process
- */
-static int
-qemudReconnectVMs(struct qemud_driver *driver)
+ * Try to re-open the resources for live VMs that we care
+ * about.
+ */
+static void
+qemuReconnectDomains(struct qemud_driver *driver)
{
int i;
for (i = 0 ; i < driver->domains.count ; i++) {
- virDomainObjPtr vm = driver->domains.objs[i];
- qemudDomainStatusPtr status = NULL;
- char *config = NULL;
- int rc;
-
- virDomainObjLock(vm);
- if ((rc = virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) == 0)
- DEBUG("Found pid %d for '%s'", vm->pid, vm->def->name);
- else
- goto next;
-
- if ((config = virDomainConfigFile(NULL,
- driver->stateDir,
- vm->def->name)) == NULL) {
- VIR_ERROR(_("Failed to read domain status for %s\n"),
- vm->def->name);
- goto next_error;
- }
-
- status = qemudDomainStatusParseFile(NULL, driver->caps, config, 0);
- if (status) {
- vm->newDef = vm->def;
- vm->def = status->def;
- } else {
- VIR_ERROR(_("Failed to parse domain status for %s\n"),
- vm->def->name);
- goto next_error;
- }
-
- if ((rc = qemudOpenMonitor(NULL, driver, vm, status->monitorpath, 1)) != 0) {
- VIR_ERROR(_("Failed to reconnect monitor for %s: %d\n"),
- vm->def->name, rc);
- goto next_error;
- }
-
- if ((vm->logfile = qemudLogFD(NULL, driver->logDir, vm->def->name)) < 0)
- goto next_error;
-
- if (vm->def->id >= driver->nextvmid)
- driver->nextvmid = vm->def->id + 1;
-
- vm->state = status->state;
- goto next;
-
-next_error:
- /* we failed to reconnect the vm so remove it's traces */
- vm->def->id = -1;
- qemudRemoveDomainStatus(NULL, driver, vm);
- /* Restore orignal def, if we'd loaded a live one */
- if (vm->newDef) {
- virDomainDefFree(vm->def);
- vm->def = vm->newDef;
- vm->newDef = NULL;
- }
-next:
- virDomainObjUnlock(vm);
- if (status)
- VIR_FREE(status->monitorpath);
- VIR_FREE(status);
- VIR_FREE(config);
- }
- return 0;
+ virDomainObjPtr obj = driver->domains.objs[i];
+
+ virDomainObjLock(obj);
+ if (qemuReconnectDomain(driver, obj) < 0) {
+ /* If we can't get the monitor back, then kill the VM
+ * so user has ability to start it again later without
+ * danger of ending up running twice */
+ qemudShutdownVMDaemon(NULL, driver, obj);
+ }
+ virDomainObjUnlock(obj);
+ }
}
static int
@@ -513,14 +501,25 @@ qemudStartup(void) {
goto error;
}
+ /* Get all the running persistent or transient configs first */
+ if (virDomainLoadAllConfigs(NULL,
+ qemu_driver->caps,
+ &qemu_driver->domains,
+ qemu_driver->stateDir,
+ NULL,
+ 1, NULL, NULL) < 0)
+ goto error;
+
+ qemuReconnectDomains(qemu_driver);
+
+ /* Then inactive persistent configs */
if (virDomainLoadAllConfigs(NULL,
qemu_driver->caps,
&qemu_driver->domains,
qemu_driver->configDir,
qemu_driver->autostartDir,
- NULL, NULL) < 0)
- goto error;
- qemudReconnectVMs(qemu_driver);
+ 0, NULL, NULL) < 0)
+ goto error;
qemuDriverUnlock(qemu_driver);
qemudAutostartConfigs(qemu_driver);
@@ -569,7 +568,7 @@ qemudReload(void) {
&qemu_driver->domains,
qemu_driver->configDir,
qemu_driver->autostartDir,
- qemudNotifyLoadDomain, qemu_driver);
+ 0, qemudNotifyLoadDomain, qemu_driver);
qemuDriverUnlock(qemu_driver);
qemudAutostartConfigs(qemu_driver);
@@ -1331,6 +1330,7 @@ static int qemudStartVMDaemon(virConnect
int pos = -1;
char ebuf[1024];
char *pidfile = NULL;
+ int logfile;
struct gemudHookData hookData;
hookData.conn = conn;
@@ -1372,7 +1372,7 @@ static int qemudStartVMDaemon(virConnect
goto cleanup;
}
- if((vm->logfile = qemudLogFD(conn, driver->logDir, vm->def->name)) < 0)
+ if ((logfile = qemudLogFD(conn, driver->logDir, vm->def->name)) < 0)
goto cleanup;
emulator = vm->def->emulator;
@@ -1421,29 +1421,29 @@ static int qemudStartVMDaemon(virConnect
tmp = progenv;
while (*tmp) {
- if (safewrite(vm->logfile, *tmp, strlen(*tmp)) < 0)
+ if (safewrite(logfile, *tmp, strlen(*tmp)) < 0)
VIR_WARN(_("Unable to write envv to logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
- if (safewrite(vm->logfile, " ", 1) < 0)
+ if (safewrite(logfile, " ", 1) < 0)
VIR_WARN(_("Unable to write envv to logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
tmp++;
}
tmp = argv;
while (*tmp) {
- if (safewrite(vm->logfile, *tmp, strlen(*tmp)) < 0)
+ if (safewrite(logfile, *tmp, strlen(*tmp)) < 0)
VIR_WARN(_("Unable to write argv to logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
- if (safewrite(vm->logfile, " ", 1) < 0)
+ if (safewrite(logfile, " ", 1) < 0)
VIR_WARN(_("Unable to write argv to logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
tmp++;
}
- if (safewrite(vm->logfile, "\n", 1) < 0)
+ if (safewrite(logfile, "\n", 1) < 0)
VIR_WARN(_("Unable to write argv to logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
- if ((pos = lseek(vm->logfile, 0, SEEK_END)) < 0)
+ if ((pos = lseek(logfile, 0, SEEK_END)) < 0)
VIR_WARN(_("Unable to seek to end of logfile: %s\n"),
virStrerror(errno, ebuf, sizeof ebuf));
@@ -1451,7 +1451,7 @@ static int qemudStartVMDaemon(virConnect
FD_SET(tapfds[i], &keepfd);
ret = virExecDaemonize(conn, argv, progenv, &keepfd, &child,
- stdin_fd, &vm->logfile, &vm->logfile,
+ stdin_fd, &logfile, &logfile,
VIR_EXEC_NONBLOCK,
qemudSecurityHook, &hookData,
pidfile);
@@ -1501,7 +1501,7 @@ static int qemudStartVMDaemon(virConnect
(qemudInitCpus(conn, vm, migrateFrom) < 0) ||
(qemudInitPasswords(conn, driver, vm) < 0) ||
(qemudDomainSetMemoryBalloon(conn, vm, vm->def->memory) < 0) ||
- (qemudSaveDomainStatus(conn, qemu_driver, vm) < 0)) {
+ (virDomainSaveStatus(conn, driver->stateDir, vm) < 0)) {
qemudShutdownVMDaemon(conn, driver, vm);
ret = -1;
/* No need for 'goto cleanup' now since qemudShutdownVMDaemon does enough */
@@ -1519,10 +1519,8 @@ cleanup:
vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
vm->def->graphics[0]->data.vnc.autoport)
vm->def->graphics[0]->data.vnc.port = -1;
- if (vm->logfile != -1) {
- close(vm->logfile);
- vm->logfile = -1;
- }
+ if (logfile != -1)
+ close(logfile);
vm->def->id = -1;
return -1;
}
@@ -1549,14 +1547,8 @@ static void qemudShutdownVMDaemon(virCon
vm->monitorWatch = -1;
}
- if (close(vm->logfile) < 0) {
- char ebuf[1024];
- VIR_WARN(_("Unable to close logfile: %s\n"),
- virStrerror(errno, ebuf, sizeof ebuf));
- }
if (vm->monitor != -1)
close(vm->monitor);
- vm->logfile = -1;
vm->monitor = -1;
/* shut it off for sure */
@@ -2260,7 +2252,7 @@ static int qemudDomainSuspend(virDomainP
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
VIR_FREE(info);
}
- if (qemudSaveDomainStatus(dom->conn, driver, vm) < 0)
+ if (virDomainSaveStatus(dom->conn, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
@@ -2310,7 +2302,7 @@ static int qemudDomainResume(virDomainPt
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
VIR_FREE(info);
}
- if (qemudSaveDomainStatus(dom->conn, driver, vm) < 0)
+ if (virDomainSaveStatus(dom->conn, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
@@ -4192,7 +4184,7 @@ static int qemudDomainAttachDevice(virDo
goto cleanup;
}
- if (!ret && qemudSaveDomainStatus(dom->conn, driver, vm) < 0)
+ if (!ret && virDomainSaveStatus(dom->conn, driver->stateDir, vm) < 0)
ret = -1;
cleanup:
@@ -4314,7 +4306,7 @@ static int qemudDomainDetachDevice(virDo
qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
"%s", _("only SCSI or virtio disk device can be detached dynamically"));
- if (!ret && qemudSaveDomainStatus(dom->conn, driver, vm) < 0)
+ if (!ret && virDomainSaveStatus(dom->conn, driver->stateDir, vm) < 0)
ret = -1;
cleanup:
diff --git a/src/security.h b/src/security.h
--- a/src/security.h
+++ b/src/security.h
@@ -38,6 +38,8 @@ typedef int (*virSecurityDomainSetImageL
virDomainDiskDefPtr disk);
typedef int (*virSecurityDomainGenLabel) (virConnectPtr conn,
virDomainObjPtr sec);
+typedef int (*virSecurityDomainReserveLabel) (virConnectPtr conn,
+ virDomainObjPtr sec);
typedef int (*virSecurityDomainGetLabel) (virConnectPtr conn,
virDomainObjPtr vm,
virSecurityLabelPtr sec);
@@ -57,6 +59,7 @@ struct _virSecurityDriver {
virSecurityDomainRestoreImageLabel domainRestoreSecurityImageLabel;
virSecurityDomainSetImageLabel domainSetSecurityImageLabel;
virSecurityDomainGenLabel domainGenSecurityLabel;
+ virSecurityDomainReserveLabel domainReserveSecurityLabel;
virSecurityDomainGetLabel domainGetSecurityLabel;
virSecurityDomainSetLabel domainSetSecurityLabel;
virSecurityDomainRestoreLabel domainRestoreSecurityLabel;
diff --git a/src/security_selinux.c b/src/security_selinux.c
--- a/src/security_selinux.c
+++ b/src/security_selinux.c
@@ -216,6 +216,44 @@ done:
}
static int
+SELinuxReserveSecurityLabel(virConnectPtr conn,
+ virDomainObjPtr vm)
+{
+ security_context_t pctx;
+ context_t ctx = NULL;
+ const char *mcs;
+
+ if (getpidcon(vm->pid, &pctx) == -1) {
+ char ebuf[1024];
+ virSecurityReportError(conn, VIR_ERR_ERROR, _("%s: error calling "
+ "getpidcon(): %s"), __func__,
+ virStrerror(errno, ebuf, sizeof ebuf));
+ return -1;
+ }
+
+ ctx = context_new(pctx);
+ VIR_FREE(pctx);
+ if (!ctx)
+ goto err;
+
+ mcs = context_range_get(ctx);
+ if (!mcs)
+ goto err;
+
+ mcsAdd(mcs);
+
+ context_free(ctx);
+
+ return 0;
+
+err:
+ context_free(ctx);
+ return -1;
+}
+
+
+
+static int
SELinuxSecurityDriverProbe(void)
{
return is_selinux_enabled() ? SECURITY_DRIVER_ENABLE : SECURITY_DRIVER_DISABLE;
@@ -422,6 +460,7 @@ virSecurityDriver virSELinuxSecurityDriv
.domainSetSecurityImageLabel = SELinuxSetSecurityImageLabel,
.domainRestoreSecurityImageLabel = SELinuxRestoreSecurityImageLabel,
.domainGenSecurityLabel = SELinuxGenSecurityLabel,
+ .domainReserveSecurityLabel = SELinuxReserveSecurityLabel,
.domainGetSecurityLabel = SELinuxGetSecurityLabel,
.domainRestoreSecurityLabel = SELinuxRestoreSecurityLabel,
.domainSetSecurityLabel = SELinuxSetSecurityLabel,
diff --git a/src/uml_driver.c b/src/uml_driver.c
--- a/src/uml_driver.c
+++ b/src/uml_driver.c
@@ -399,7 +399,7 @@ umlStartup(void) {
¨_driver->domains,
uml_driver->configDir,
uml_driver->autostartDir,
- NULL, NULL) < 0)
+ 0, NULL, NULL) < 0)
goto error;
umlAutostartConfigs(uml_driver);
@@ -438,7 +438,7 @@ umlReload(void) {
¨_driver->domains,
uml_driver->configDir,
uml_driver->autostartDir,
- NULL, NULL);
+ 0, NULL, NULL);
umlAutostartConfigs(uml_driver);
umlDriverUnlock(uml_driver);
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 5 months
[libvirt] libvirt one driver problem
by Thirupalu Annam
HI
I have downloaded and tried with both libvirt-0-6-2 %libvirt-0-6-4
versions to build the One Driver
from the source directory I executed the following commands to install
libvirt
>./autogen.sh -with-one=yes ------------>success
>make -----------------------> also succeeded
>make install -----------------------> also succeeded
>virsh -c one:/// execution is giving me the following error
hexagrid@hexagrid-desktop:~$ virsh -c one:///
error: failed to connect to the hypervisor
hexagrid@hexagrid-desktop:~$
let me know whether I have performed the right steps to install or anything
is missing. but I am able to connect to QEMU driver and the out of the
execution is as follows
hexagrid@hexagrid-desktop:~$ virsh -c qemu:///session
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
--
Thanks and Regards
Thirupalu Annam
----------------------------------------
Hexagrid Networks
Office :23350089, 40144654
Mob:9908377725
15 years, 5 months
[libvirt] Libtool problem
by Eduardo Otubo
Hello all,
I found this when compiling the last git commit
(0a29f59e3b8e2c1fb797d2fa93831f21a3e1711e). This is the first
compilation from my new Ubuntu instalation (9.04) so I cannot figure out
if it is a libvirt problem or if it is any configuration problem. I
configured the compilation with './configure --with-phyp=yes
--with-xen=no' and the make exit is the following:
otubo@lisa ~/develop/libvirt/src $ make
make all-recursive
make[1]: Entering directory `/home/otubo/develop/libvirt/src'
Making all in gnulib/lib
make[2]: Entering directory `/home/otubo/develop/libvirt/src/gnulib/lib'
make all-recursive
make[3]: Entering directory `/home/otubo/develop/libvirt/src/gnulib/lib'
make[4]: Entering directory `/home/otubo/develop/libvirt/src/gnulib/lib'
/bin/bash ../../mylibtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H
-I. -I../.. -I../../intl -g -O2 -MT c-ctype.lo -MD -MP
-MF .deps/c-ctype.Tpo -c -o c-ctype.lo c-ctype.c
(CC) -o c-ctype.lo c-ctype.c
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 847:
X--tag=CC: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 880:
libtool: ignoring unknown tag : command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 847:
X--mode=compile: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1014: ***
Warning: inferring the mode of operation is deprecated.: command not
found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1015: ***
Future versions of Libtool will require --mode=MODE be specified.:
command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
Xgcc: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-DHAVE_CONFIG_H: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-I.: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-I../..: No such file or directory
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-I../../intl: No such file or directory
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-g: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-O2: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-MT: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
Xc-ctype.lo: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-MD: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-MP: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-MF: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X.deps/c-ctype.Tpo: No such file or directory
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1158:
X-c: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1211:
Xc-ctype.lo: command not found
/home/otubo/develop/libvirt/src/gnulib/lib/../../libtool: line 1216:
libtool: compile: cannot determine name of library object from `':
command not found
make[4]: *** [c-ctype.lo] Error 1
make[4]: Leaving directory `/home/otubo/develop/libvirt/src/gnulib/lib'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/otubo/develop/libvirt/src/gnulib/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/otubo/develop/libvirt/src/gnulib/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/otubo/develop/libvirt/src'
make: *** [all] Error 2
It seems there is a strange error form libtool, it's not recognizing
some options, or some malformed options there is being passed to
libtool.
I am not acquainted to libtool so, if you guys could help me
understanding this issue I would be very glad.
Thanks,
[]'s
--
Eduardo Otubo
Software Engineer
Linux Technology Center
IBM Systems & Technology Group
Mobile: +55 19 8135 0885
otubo(a)linux.vnet.ibm.com
15 years, 5 months