[libvirt] [PATCH] 0/8 logging infrastructure for libvirt[d]
by Daniel Veillard
the following set of patches implement the logging infrastructure
based on the discussion about it last month. It is based on the
following interfaces, and in a large part reflects the log4j principles.
4 level of logging priorities:
typedef enum {
VIR_LOG_DEBUG = 1,
VIR_LOG_INFO,
VIR_LOG_WARN,
VIR_LOG_ERROR,
} virLogPriority;
An output is a channel to output logging informations and a filter is a
rule to allow or not log information to flow through.
At any given time a set of output and filters can be defined though
a public API (but I didn't put them yet in libvirt.h
that's still confined in logging.h ATM)
/**
* virLogOutputFunc:
* @data: extra output logging data
* @category: the category for the message
* @priority: the priority for the message
* @msg: the message to log, preformatted and zero terminated
* @len: the lenght of the message in bytes without the terminating zero
*
* Callback function used to output messages
*
* Returns the number of bytes written or -1 in case of error
*/
typedef int (*virLogOutputFunc) (void *data, const char *category,
int priority, const char *str, int len);
/**
* virLogCloseFunc:
* @data: extra output logging data
*
* Callback function used to close a log output
*/
typedef void (*virLogCloseFunc) (void *data);
extern int virLogSetDefaultPriority(int priority);
extern int virLogDefineFilter(const char *match, int priority, int
flags);
extern int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c,
void *data, int priority, int flags);
The default priority allows to set a default level of logging,
individual logs matching filters will follow the rules defined for the
filters, i.e. if the logged data is of a lower level than what the
first filter matching it then it is dropped.
The internal APIs defines a function to log a message:
extern void virLogMessage(const char *category, int priority, int flags,
const char *fmt, ...);
the category is in general the file name as defined by __FILE__
The matching is done against the category based on a substring,
for example "xen" would match all logs emitted by
xend_internal.c xen_inotify.c xen_internal.c xen_unified.c
Something more complex could be defined for example matching based on
regexp or based on the full message content and not just the category
but this gets heavier and could be done later using specific flags
in virLogDefineFilter.
The preferred user interface for setting the output and filters
is through environment variables for application linking to libvirt
LIBVIRT_DEBUG defines the default logging level from 1 to 4
LIBVIRT_LOG_FILTERS defines the set filters
LIBVIRT_LOG_OUTPUTS defines the set outputs
and though the configuration file libvirtd.conf for the daemon with
the corresponding values:
log_level
log_filters
log_outputs
The convenience internal functions virLogParseFilters and
virLogParseOutputs parse the format of the values for filters and
outputs, so they share the same format explained in libvirtd.conf:
------------------------------------------------------------------
# Logging filters:
# A filter allows to select a different logging level for a given
category
# of logs
# The format for a filter is:
# x:name
# where name is a match string e.g. remote or qemu
# the x prefix is the minimal level where matching messages should be
logged
# 1: DEBUG
# 2: INFO
# 3: WARNING
# 4: ERROR
#
# Multiple filter can be defined in a single @filters, they just need
to be
# separated by spaces.
#
# e.g:
# log_filters="3:remote 4:event"
# to only get warning or errors from the remote layer and only errors
from
# the event layer.
# Logging outputs:
# An output is one of the places to save logging informations
# The format for an output can be:
# x:stderr
# output goes to stderr
# x:syslog:name
# use syslog for the output and use the given name as the ident
# x:file:file_path
# output to a file, with the given filepath
# In all case the x prefix is the minimal level, acting as a filter
# 0: everything
# 1: DEBUG
# 2: INFO
# 3: WARNING
# 4: ERROR
#
# Multiple output can be defined , they just need to be separated by
spaces.
# e.g.:
# log_outputs="3:syslog:libvirtd"
# to log all warnings and errors to syslog under the libvirtd ident
-----------------------------------------------------------------------
In practice
export LIBVIRT_DEBUG=1
export LIBVIRT_LOG_OUTPUTS="0:file:virsh.log"
and then running virsh will accumulate all logging to the virsh.log
file in the current directory.
One thing which I feel is somewhat incomplete is that it's impossible
to remotely get debugging output from the libvirt daemon serving the
requests. Currently all logs are also accumulated in a cyclic logging
buffer, I would associate a dump function later to be hooked for example
to a signal handler in the daemon. But I'm unsure we should allow
dumping logging information to the remote end, probably not the whole
set.
So there is still room for a bit more development, but I think it's
usable as-is and already cleans quite a bit of the various logging
interface scattered in the various modules.
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/
16 years, 3 months
[libvirt] [PATCH] Correct comment type in the linker script
by john.levon@sun.com
# HG changeset patch
# User john.levon(a)sun.com
# Date 1229980017 28800
# Node ID 1521894aacfa409ec6017f4e1603a040f4866f64
# Parent 9d764ab75280a4ce9e4c3779b5848e670c7fc460
Correct comment type in the linker script
Use more-portable form.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/libvirt_sym.version.in b/src/libvirt_sym.version.in
--- a/src/libvirt_sym.version.in
+++ b/src/libvirt_sym.version.in
@@ -462,7 +462,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virRegisterStorageDriver;
virRegisterDeviceMonitor;
- /* logging.h */
+ # logging.h
virLogSetDefaultPriority;
virLogDefineFilter;
virLogDefineOutput;
16 years, 3 months
[libvirt] [PATCH] Unify pool-create-as and pool-define-as xml building
by Cole Robinson
The attached patch unifies the xml building and command line option
registering for the virsh pool-*-as commands, fixing a few bugs in the
process:
- pool-define-as was creating <host> without a name attribute
(rhbz 476708)
- pool-create-as wasn't adding a closing tag to its <host> block
- pool-create-as didn't have the source-name option
All seem like a good justification for not duplicating the logic. The
patch ends up looking a bit bizarre, but it's mostly just moving the xml
building from create-as into a separate function buildPoolXML, and then
wiring it up.
Thanks,
Cole
16 years, 3 months
[libvirt] [PATCH] fix numa-related (and kernel-dependent) test failures
by Jim Meyering
Following up on this thread,
http://thread.gmane.org/gmane.comp.emulators.libvirt/10402
Here's a patch that appears to work for kernels before
and after the CONFIG_NR_CPUS change. I've tested it via
a small stand-alone program on both kernels, but via libvirt
only on rawhide.
Dave, can you confirm the tests pass for you on the 2.6.27.x-based kernel?
>From b78a48c7a401ecdf37de95b0b01435578ad30e12 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 12 Dec 2008 16:22:34 +0100
Subject: [PATCH] fix numa-related (and kernel-dependent) test failures
This change is required on some kernels due to the way a change in
the kernel's CONFIG_NR_CPUS propagates through the numa library.
* src/qemu_conf.c (qemudCapsInitNUMA): Pass numa_all_cpus_ptr->size/8
as the buffer-length-in-bytes in the call to numa_node_to_cpus, since
that's what is required on second and subseqent calls.
* src/uml_conf.c (umlCapsInitNUMA): Likewise.
---
src/qemu_conf.c | 2 +-
src/uml_conf.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 59171e7..206fb0b 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -324,7 +324,7 @@ qemudCapsInitNUMA(virCapsPtr caps)
for (n = 0 ; n <= numa_max_node() ; n++) {
- if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0)
+ if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
goto cleanup;
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
diff --git a/src/uml_conf.c b/src/uml_conf.c
index 3659c6b..7eb630d 100644
--- a/src/uml_conf.c
+++ b/src/uml_conf.c
@@ -80,7 +80,7 @@ umlCapsInitNUMA(virCapsPtr caps)
for (n = 0 ; n <= numa_max_node() ; n++) {
- if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0)
+ if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
goto cleanup;
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
--
1.6.1.rc2.316.geb2f0
16 years, 3 months
[libvirt] [PATCH] avoid testcase failures due to LANG!=C
by Guido Günther
Hi,
some checks compare to the english error messages:
--- out 2008-12-18 15:36:44.000000000 +0100
+++ exp 2008-12-18 15:36:44.000000000 +0100
@@ -1,3 +1,3 @@
-libvir: Domain Config Fehler : failed Xen syscall Topologie-Syntaxfehler beim Cpuset
-Fehler: Fehler beim Definieren einer Domain von xml-invalid
+libvir: Domain Config error : failed Xen syscall topology cpuset syntax error
+error: Failed to define domain from xml-invalid
FAIL: cpuset
so we should set LC_ALL=C in the checks. Possible patch attached.
-- Guido
16 years, 3 months
[libvirt] virDomainInterfaceStats why is there a size?
by Stefan de Konink
Another simple question, what is the reasoning about the size field in
this call. I would really be a happy boy if anyone said:
if you put in path == NULL, it will fill your stats structure up to size
interfaces.
...but since this is not the case (yet) what is the reason behind it?
Stefan
16 years, 3 months
[libvirt] [PATCH 4/5] save domain status during vm creation and remove it on shutdown.
by Guido Günther
This patch does the actual saving and removal of the vm status. It does
so only at vm creation time at the moment. We need to update the config
every time the life config changes later.
---
src/qemu_driver.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 7804094..d8b87e4 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -182,6 +182,44 @@ qemudAutostartConfigs(struct qemud_driver *driver) {
virConnectClose(conn);
}
+
+/**
+ * qemudRemoveDomainStatus
+ *
+ * remove all state files of a domain from statedir
+ *
+ * Returns 0 on success
+ */
+static int
+qemudRemoveDomainStatus(virConnectPtr conn,
+ struct qemud_driver *driver,
+ virDomainObjPtr vm)
+{
+ int rc = -1;
+ char *file = NULL;
+
+ if (asprintf(&file, "%s/%s.xml", driver->stateDir, vm->def->name) < 0) {
+ qemudReportError(conn, vm, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for status file"));
+ goto cleanup;
+ }
+
+ if (unlink(file) < 0 && errno != ENOENT && errno != ENOTDIR) {
+ qemudReportError(conn, vm, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Failed to unlink status file %s"), file);
+ goto cleanup;
+ }
+
+ if(virFileDeletePid(driver->stateDir, vm->def->name))
+ goto cleanup;
+
+ rc = 0;
+cleanup:
+ VIR_FREE(file);
+ return rc;
+}
+
+
/**
* qemudStartup:
*
@@ -532,6 +570,12 @@ static int qemudOpenMonitor(virConnectPtr conn,
qemudCheckMonitorPrompt,
"monitor", 10000);
+ if (!(vm->monitorpath = strdup(monitor))) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for monitor path"));
+ goto error;
+ }
+
/* Keep monitor open upon success */
if (ret == 0)
return ret;
@@ -1046,6 +1090,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
return -1;
}
}
+ qemudSaveDomainStatus(conn, qemu_driver, vm);
return ret;
}
@@ -1108,6 +1153,7 @@ static void qemudShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
/* shut it off for sure */
kill(vm->pid, SIGKILL);
+ qemudRemoveDomainStatus(conn, driver, vm);
vm->pid = -1;
vm->def->id = -1;
--
1.6.0.2
16 years, 3 months
[libvirt] [PATCH 3/5] add XML parsing for vm status file
by Guido Günther
Functions to read and write vm status in $(statedir)/qemu/<domain>.xml.
Keeps the necessary to reconnect to a running domain state within
<domstate>...</domstate>. I kept most of the code in qemu_config.c for
now. We can easily move it should another hypervisor need to do
something similar.
---
src/domain_conf.c | 36 ++++++---
src/domain_conf.h | 6 ++
src/libvirt_sym.version.in | 2 +
src/qemu_conf.c | 191 ++++++++++++++++++++++++++++++++++++++++++++
src/qemu_conf.h | 17 ++++
5 files changed, 241 insertions(+), 11 deletions(-)
diff --git a/src/domain_conf.c b/src/domain_conf.c
index 32ed59f..1b53c09 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -430,6 +430,7 @@ void virDomainObjFree(virDomainObjPtr dom)
virDomainDefFree(dom->def);
virDomainDefFree(dom->newDef);
+ VIR_FREE(dom->monitorpath);
VIR_FREE(dom->vcpupids);
VIR_FREE(dom);
@@ -3224,11 +3225,11 @@ char *virDomainDefFormat(virConnectPtr conn,
#ifndef PROXY
-int virDomainSaveConfig(virConnectPtr conn,
- const char *configDir,
- virDomainDefPtr def)
+int virDomainSaveXML(virConnectPtr conn,
+ const char *configDir,
+ virDomainDefPtr def,
+ const char *xml)
{
- char *xml;
char *configFile = NULL;
int fd = -1, ret = -1;
size_t towrite;
@@ -3237,11 +3238,6 @@ int virDomainSaveConfig(virConnectPtr conn,
if ((configFile = virDomainConfigFile(conn, configDir, def->name)) == NULL)
goto cleanup;
- if (!(xml = virDomainDefFormat(conn,
- def,
- VIR_DOMAIN_XML_SECURE)))
- goto cleanup;
-
if ((err = virFileMakePath(configDir))) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
_("cannot create config directory %s: %s"),
@@ -3274,12 +3270,30 @@ int virDomainSaveConfig(virConnectPtr conn,
}
ret = 0;
-
cleanup:
- VIR_FREE(xml);
if (fd != -1)
close(fd);
+ return ret;
+}
+
+int virDomainSaveConfig(virConnectPtr conn,
+ const char *configDir,
+ virDomainDefPtr def)
+{
+ int ret = -1;
+ char *xml;
+ if (!(xml = virDomainDefFormat(conn,
+ def,
+ VIR_DOMAIN_XML_SECURE)))
+ goto cleanup;
+
+ if (virDomainSaveXML(conn, configDir, def, xml))
+ goto cleanup;
+
+ ret = 0;
+cleanup:
+ VIR_FREE(xml);
return ret;
}
diff --git a/src/domain_conf.h b/src/domain_conf.h
index 51cf6d5..d44e2ad 100644
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -462,6 +462,7 @@ struct _virDomainObj {
int stderr_fd;
int stderr_watch;
int monitor;
+ char *monitorpath;
int monitorWatch;
int logfile;
int pid;
@@ -553,6 +554,11 @@ int virDomainDiskQSort(const void *a, const void *b);
int virDomainDiskCompare(virDomainDiskDefPtr a,
virDomainDiskDefPtr b);
+int virDomainSaveXML(virConnectPtr conn,
+ const char *configDir,
+ virDomainDefPtr def,
+ const char *xml);
+
int virDomainSaveConfig(virConnectPtr conn,
const char *configDir,
virDomainDefPtr def);
diff --git a/src/libvirt_sym.version.in b/src/libvirt_sym.version.in
index 1eff790..e7b352d 100644
--- a/src/libvirt_sym.version.in
+++ b/src/libvirt_sym.version.in
@@ -368,6 +368,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainObjFree;
virDomainObjListFree;
virDomainRemoveInactive;
+ virDomainSaveXML;
virDomainSaveConfig;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
@@ -614,6 +615,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
/* xml.h */
virXPathLong;
+ virXPathNode;
virXPathNodeSet;
virXPathString;
virXMLPropString;
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 218aefa..4cede63 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -49,6 +49,8 @@
#include "util.h"
#include "memory.h"
#include "verify.h"
+#include "datatypes.h"
+#include "xml.h"
VIR_ENUM_DECL(virDomainDiskQEMUBus)
VIR_ENUM_IMPL(virDomainDiskQEMUBus, VIR_DOMAIN_DISK_BUS_LAST,
@@ -1335,3 +1337,192 @@ int qemudBuildCommandLine(virConnectPtr conn,
#undef ADD_ENV_LIT
#undef ADD_ENV_SPACE
}
+
+
+/* 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) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for vm status"));
+ 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) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ 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((virXPathLong(conn, "string(./@state)", ctxt, &val)) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid domain state"));
+ goto error;
+ } else
+ status->state = (int)val;
+
+ 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='%d' pid='%d'>\n", vm->state, vm->pid);
+ virBufferVSprintf(&buf, " <monitor path='%s'/>\n", vm->monitorpath);
+
+ if (!(config_xml = virDomainDefFormat(conn,
+ vm->def,
+ VIR_DOMAIN_XML_SECURE)))
+ goto cleanup;
+
+ virBufferVSprintf(&buf, "%s", config_xml);
+ virBufferVSprintf(&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
index ffbd0e7..70d9394 100644
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -77,6 +77,16 @@ struct qemud_driver {
int domainEventDispatching;
};
+/* 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
#define QEMUD_MIGRATION_NUM_PORTS 64
@@ -108,5 +118,12 @@ int qemudBuildCommandLine (virConnectPtr conn,
const char *migrateFrom);
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 */
--
1.6.0.2
16 years, 3 months