[libvirt] Use gnulib's c-ctype.h; prohibit use of <ctype.h>
by Jim Meyering
Following up on this thread:
http://thread.gmane.org/gmane.comp.emulators.libvirt/6338/focus=6349
This change removes all uses of ctype macros and ensures
that no new ones will be added.
The other changes I mentioned will come later.
>From 3966a3ebaaacc14b4f330677fd2ed8f8546c6f4a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 9 May 2008 12:55:29 +0200
Subject: [PATCH] Use gnulib's c-ctype.h, not <ctype.h>.
re=$(man isspace|grep is.....,.is|sed 's/ -.*//' \
|tr -s ', \n' \||sed 's/^|//;s/|$//')
git grep -l -E "$re"|grep -Ev 'Chan|gnulib' \
|xargs perl -pi -e 's/\b('"$re"')\b/c_$1/g'
git grep -l to_uchar|xargs perl -pi -e 's/to_uchar\((.*?)\)/$1/g'
* src/util.h (to_uchar): Remove definition.
(TOLOWER): Remove definition.
(__virMacAddrCompare): Use c_tolower, not TOLOWER.
Globally:
Where needed, change <ctype.h> to <c-ctype.h>.
Remove unnecessary inclusion of <ctype.h>.
Ensure the global changes are never needed again:
* Makefile.maint (sc_avoid_ctype_macros): Prohibit use of ctype
macros. Recommend c-ctype.h instead.
(sc_prohibit_c_ctype_without_use): New rule.
(sc_prohibit_ctype_h): New rule. Disallow use of <ctype.h>.
---
Makefile.maint | 16 +++++++++++++---
qemud/remote.c | 1 -
src/buf.c | 3 +--
src/nodeinfo.c | 12 ++++++------
src/openvz_driver.c | 1 -
src/qemu_driver.c | 4 ++--
src/sexpr.c | 4 ++--
src/stats_linux.c | 8 ++++----
src/util.c | 15 ++++++---------
src/util.h | 5 -----
src/virsh.c | 8 ++++----
src/xend_internal.c | 1 -
12 files changed, 38 insertions(+), 40 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index bab8e1d..0f79ed7 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -157,6 +157,16 @@ sc_prohibit_quotearg_without_use:
sc_prohibit_quote_without_use:
@h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
+# Prohibit the inclusion of c-ctype.h without an actual use.
+sc_prohibit_c_ctype_without_use:
+ @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
+
+# Prohibit the inclusion of <ctype.h>.
+sc_prohibit_ctype_h:
+ @grep -E '^# *include *<ctype\.h>' $$($(VC_LIST_EXCEPT)) && \
+ { echo "$(ME): don't use ctype.h; instead, use c-ctype.h" \
+ 1>&2; exit 1; } || :
+
sc_obsolete_symbols:
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
$$($(VC_LIST_EXCEPT)) && \
@@ -305,10 +315,10 @@ sc_TAB_in_indentation:
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
-sc_risky_ctype_macros:
+sc_avoid_ctype_macros:
@grep -E '\b($(ctype_re)) *\(' /dev/null \
- $$($(VC_LIST_EXCEPT)) | grep -v to_uchar && \
- { echo '$(ME): found ctype macro use without to_uchar' \
+ $$($(VC_LIST_EXCEPT)) && \
+ { echo "$(ME): don't use ctype macros (use c-ctype.h)" \
1>&2; exit 1; } || :
# Match lines like the following, but where there is only one space
diff --git a/qemud/remote.c b/qemud/remote.c
index e249529..22dd86e 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -41,7 +41,6 @@
#include <syslog.h>
#include <string.h>
#include <errno.h>
-#include <ctype.h>
#include <fnmatch.h>
#ifdef HAVE_POLKIT
diff --git a/src/buf.c b/src/buf.c
index 2e17fbb..b56a9c1 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -1,7 +1,7 @@
/*
* buf.c: buffers for libvirt
*
- * Copyright (C) 2005-2007 Red Hat, Inc.
+ * Copyright (C) 2005-2008 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
@@ -16,7 +16,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-#include <ctype.h>
#define __VIR_BUFFER_C__
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index c1e8013..e227c69 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-#include <ctype.h>
+#include <c-ctype.h>
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
@@ -59,7 +59,7 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
char *buf = line;
if (STREQLEN(buf, "processor", 9)) { /* aka a single logical CPU */
buf += 9;
- while (*buf && isspace(to_uchar(*buf)))
+ while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':') {
__virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
@@ -72,7 +72,7 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
char *p;
unsigned int ui;
buf += 9;
- while (*buf && isspace(to_uchar(*buf)))
+ while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':' || !buf[1]) {
__virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
@@ -82,13 +82,13 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
}
if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0
/* Accept trailing fractional part. */
- && (*p == '\0' || *p == '.' || isspace(to_uchar(*p))))
+ && (*p == '\0' || *p == '.' || c_isspace(*p)))
nodeinfo->mhz = ui;
} else if (STREQLEN(buf, "cpu cores", 9)) { /* aka cores */
char *p;
unsigned int id;
buf += 9;
- while (*buf && isspace(to_uchar(*buf)))
+ while (*buf && c_isspace(*buf))
buf++;
if (*buf != ':' || !buf[1]) {
__virRaiseError(conn, NULL, NULL, 0, VIR_ERR_INTERNAL_ERROR,
@@ -97,7 +97,7 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
return -1;
}
if (virStrToLong_ui(buf+1, &p, 10, &id) == 0
- && (*p == '\0' || isspace(to_uchar(*p)))
+ && (*p == '\0' || c_isspace(*p))
&& id > nodeinfo->cores)
nodeinfo->cores = id;
}
diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index 0bae4fd..22c898a 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -45,7 +45,6 @@
#include <fcntl.h>
#include <signal.h>
#include <paths.h>
-#include <ctype.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/wait.h>
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index cf52a07..10868c1 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -41,7 +41,7 @@
#include <fcntl.h>
#include <signal.h>
#include <paths.h>
-#include <ctype.h>
+#include <c-ctype.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/wait.h>
@@ -519,7 +519,7 @@ static int qemudExtractMonitorPath(const char *haystack,
*/
tmp = path;
while (*tmp) {
- if (isspace(to_uchar(*tmp))) {
+ if (c_isspace(*tmp)) {
*tmp = '\0';
*offset += (sizeof(needle)-1) + strlen(path);
return 0;
diff --git a/src/sexpr.c b/src/sexpr.c
index 4cb4edf..85b289c 100644
--- a/src/sexpr.c
+++ b/src/sexpr.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <c-ctype.h>
#include <errno.h>
#include "internal.h"
@@ -358,7 +358,7 @@ _string2sexpr(const char *buffer, size_t * end)
} else {
start = ptr;
- while (*ptr && !isspace(to_uchar(*ptr))
+ while (*ptr && !c_isspace(*ptr)
&& *ptr != ')' && *ptr != '(') {
ptr++;
}
diff --git a/src/stats_linux.c b/src/stats_linux.c
index e84e24f..cb647fe 100644
--- a/src/stats_linux.c
+++ b/src/stats_linux.c
@@ -18,7 +18,7 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
+#include <c-ctype.h>
#ifdef WITH_XEN
#include <xs.h>
@@ -262,7 +262,7 @@ xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *path)
}
if (path[4] != '\0') {
- if (!isdigit(to_uchar(path[4])) || path[4] == '0' ||
+ if (!c_isdigit(path[4]) || path[4] == '0' ||
virStrToLong_i(path+4, NULL, 10, &part) < 0 ||
part < 1 || part > 15) {
statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
@@ -306,7 +306,7 @@ xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *path)
} else {
p = path + 3;
}
- if (p && (!isdigit(to_uchar(*p)) || *p == '0' ||
+ if (p && (!c_isdigit(*p) || *p == '0' ||
virStrToLong_i(p, NULL, 10, &part) < 0 ||
part < 1 || part > 15)) {
statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
@@ -332,7 +332,7 @@ xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *path)
}
if (path[3] != '\0') {
- if (!isdigit(to_uchar(path[3])) || path[3] == '0' ||
+ if (!c_isdigit(path[3]) || path[3] == '0' ||
virStrToLong_i(path+3, NULL, 10, &part) < 0 ||
part < 1 || part > 63) {
statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
diff --git a/src/util.c b/src/util.c
index 4cef6d2..f354a48 100644
--- a/src/util.c
+++ b/src/util.c
@@ -37,7 +37,7 @@
#include <sys/wait.h>
#endif
#include <string.h>
-#include <ctype.h>
+#include <c-ctype.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
@@ -57,9 +57,6 @@
#define MAX_ERROR_LEN 1024
-#define TOLOWER(Ch) (isupper (to_uchar(Ch)) \
- ? tolower (to_uchar (Ch)) : (to_uchar (Ch)))
-
#define virLog(msg...) fprintf(stderr, msg)
#ifndef PROXY
@@ -705,12 +702,12 @@ __virMacAddrCompare (const char *p, const char *q)
{
unsigned char c, d;
do {
- while (*p == '0' && isxdigit (to_uchar(p[1])))
+ while (*p == '0' && c_isxdigit (p[1]))
++p;
- while (*q == '0' && isxdigit (to_uchar(q[1])))
+ while (*q == '0' && c_isxdigit (q[1]))
++q;
- c = TOLOWER (*p);
- d = TOLOWER (*q);
+ c = c_tolower (*p);
+ d = c_tolower (*q);
if (c == 0 || d == 0)
break;
@@ -750,7 +747,7 @@ virParseMacAddr(const char* str, unsigned char *addr)
/* This is solely to avoid accepting the leading
* space or "+" that strtoul would otherwise accept.
*/
- if (!isxdigit(to_uchar(*str)))
+ if (!c_isxdigit(*str))
break;
result = strtoul(str, &end_ptr, 16);
diff --git a/src/util.h b/src/util.h
index af68bc8..2516504 100644
--- a/src/util.h
+++ b/src/util.h
@@ -27,11 +27,6 @@
#include "internal.h"
#include "util-lib.h"
-/* Convert a possibly-signed character to an unsigned character. This is
- a bit safer than casting to unsigned char, since it catches some type
- errors that the cast doesn't. */
-static inline unsigned char to_uchar (char ch) { return ch; }
-
int virExec(virConnectPtr conn, char **argv, int *retpid,
int infd, int *outfd, int *errfd);
int virExecNonBlock(virConnectPtr conn, char **argv, int *retpid,
diff --git a/src/virsh.c b/src/virsh.c
index 00dbda8..5a35f36 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -26,7 +26,7 @@
#include <getopt.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <ctype.h>
+#include <c-ctype.h>
#include <fcntl.h>
#include <locale.h>
#include <time.h>
@@ -1763,7 +1763,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd)
for (i = 0; cpulist[i]; i++) {
switch (state) {
case expect_num:
- if (!isdigit (to_uchar(cpulist[i]))) {
+ if (!c_isdigit (cpulist[i])) {
vshError( ctl, FALSE, _("cpulist: %s: Invalid format. Expecting digit at position %d (near '%c')."), cpulist, i, cpulist[i]);
virDomainFree (dom);
return FALSE;
@@ -1773,7 +1773,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd)
case expect_num_or_comma:
if (cpulist[i] == ',')
state = expect_num;
- else if (!isdigit (to_uchar(cpulist[i]))) {
+ else if (!c_isdigit (cpulist[i])) {
vshError(ctl, FALSE, _("cpulist: %s: Invalid format. Expecting digit or comma at position %d (near '%c')."), cpulist, i, cpulist[i]);
virDomainFree (dom);
return FALSE;
@@ -5673,7 +5673,7 @@ vshCommandGetToken(vshControl * ctl, char *str, char **end, char **res)
if (tk == VSH_TK_NONE) {
if (*p == '-' && *(p + 1) == '-' && *(p + 2)
- && isalnum(to_uchar(*(p + 2)))) {
+ && c_isalnum(*(p + 2))) {
tk = VSH_TK_OPTION;
p += 2;
} else {
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 0c9f5bc..e964159 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -30,7 +30,6 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <libxml/uri.h>
-#include <ctype.h>
#include <errno.h>
#include "libvirt/libvirt.h"
--
1.5.5.1.148.gbc1be
16 years, 6 months
[libvirt] [patch][doc and comment] typos fix
by Atsushi SAKAI
Hi,
I post a typo patch since it reaches 20.
docs/apps.html | 2 +-
docs/apps.html.in | 2 +-
docs/deployment.html | 2 +-
docs/deployment.html.in | 2 +-
docs/index.py | 6 +++---
docs/intro.html | 2 +-
docs/intro.html.in | 2 +-
docs/library.xen | 4 ++--
docs/virsh.pod | 2 +-
include/libvirt/libvirt.h | 2 +-
include/libvirt/libvirt.h.in | 2 +-
proxy/libvirt_proxy.c | 2 +-
qemud/event.c | 2 +-
qemud/qemud.c | 2 +-
qemud/remote.c | 2 +-
src/event.c | 2 +-
src/proxy_internal.c | 2 +-
17 files changed, 20 insertions(+), 20 deletions(-)
Thanks
Atsushi SAKAI
16 years, 6 months
[libvirt] [PATCH] avoid one more ctype vs. sign-extension problem
by Jim Meyering
This change demonstrates that the new syntax-check rule's
regexp can be improved. It missed the unsafe tolower use,
since there was already a to_uchar use on that line.
>From 5fc8de9825215e28773f2230ac6c1e1b3d724602 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 8 May 2008 16:11:55 +0200
Subject: [PATCH] avoid one more ctype vs. sign-extension problem
* src/util.c (TOLOWER): Also convert tolower argument.
---
src/util.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/util.c b/src/util.c
index 8f3cef9..4cef6d2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -57,7 +57,8 @@
#define MAX_ERROR_LEN 1024
-#define TOLOWER(Ch) (isupper (to_uchar(Ch)) ? tolower (Ch) : (Ch))
+#define TOLOWER(Ch) (isupper (to_uchar(Ch)) \
+ ? tolower (to_uchar (Ch)) : (to_uchar (Ch)))
#define virLog(msg...) fprintf(stderr, msg)
--
1.5.5.1.148.g4c99ee
16 years, 6 months
[Libvir] [PATCH] sound support for qemu and xen
by Cole Robinson
The patch below adds xml support for the soundhw option to qemu
and xen. The new xml element takes the form:
<sound driver='drivername'/>
Where driver name can be pcspk, sb16, es1370, or all.
Everything seems to be in working order but I have a few
implementation questions:
1) Should multiple drivers be able to be specified? qemu
accommodates this, allowing '-soundhw sb16,pcspk' for example.
If this should be allowed, what should the xml format be?
2) Should acceptable driver options be hardcoded? The other option
is to just pass the input straight to qemu. This patch has the
options hardcoded.
Also I realize this will probably need to be rediff'd around
Dan's serial + parallel device patch, but I figured I would just
get this out there.
Thanks,
Cole
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index d9b82b2..bfd9ba4 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -1011,6 +1011,41 @@ static int qemudParseInputXML(virConnectPtr conn,
return -1;
}
+/* Sound device helper functions */
+static int qemudSoundDriverFromString(virConnectPtr conn,
+ const char *driver) {
+ if (STREQ(driver, "all")) {
+ return QEMU_SOUND_ALL;
+ } else if (STREQ(driver, "sb16")) {
+ return QEMU_SOUND_SB16;
+ } else if (STREQ(driver, "es1370")) {
+ return QEMU_SOUND_ES1370;
+ } else if (STREQ(driver, "pcspk")) {
+ return QEMU_SOUND_PCSPK;
+ }
+
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INVALID_ARG,
+ _("invalid sound driver '%s'"), driver);
+ return -1;
+}
+
+static const char *qemudSoundDriverToString(virConnectPtr conn,
+ const int driver) {
+
+ if (driver == QEMU_SOUND_ALL) {
+ return "all";
+ } else if (driver == QEMU_SOUND_SB16) {
+ return "sb16";
+ } else if (driver == QEMU_SOUND_ES1370) {
+ return "es1370";
+ } else if (driver == QEMU_SOUND_PCSPK) {
+ return "pcspk";
+ }
+
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("invalid sound driver '%d'"), driver);
+ return NULL;
+}
/*
* Parses a libvirt XML definition of a guest, and populates the
@@ -1486,6 +1521,25 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
}
}
xmlXPathFreeObject(obj);
+
+ /* Parse sound driver xml */
+ obj = xmlXPathEval(BAD_CAST "/domain/devices/sound", ctxt);
+ if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
+ (obj->nodesetval == NULL) || (obj->nodesetval->nodeNr == 0)) {
+ def->soundDriver = QEMU_SOUND_NONE;
+ } else if ((prop = xmlGetProp(obj->nodesetval->nodeTab[0],
+ BAD_CAST "driver"))) {
+
+ if ((def->soundDriver = qemudSoundDriverFromString(conn,
+ (char *) prop)) < 0)
+ goto error;
+
+ xmlFree(prop);
+ prop = NULL;
+ } else {
+ def->soundDriver = QEMU_SOUND_NONE;
+ }
+ xmlXPathFreeObject(obj);
obj = NULL;
/* If graphics are enabled, there's an implicit PS2 mouse */
@@ -1694,6 +1748,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
(vm->def->os.cmdline[0] ? 2 : 0) + /* cmdline */
(vm->def->graphicsType == QEMUD_GRAPHICS_VNC ? 2 :
(vm->def->graphicsType == QEMUD_GRAPHICS_SDL ? 0 : 1)) + /* graphics */
+ (vm->def->soundDriver == QEMU_SOUND_NONE ? 0 : 2) + /* sound */
(vm->migrateFrom[0] ? 3 : 0); /* migrateFrom */
snprintf(memory, sizeof(memory), "%lu", vm->def->memory/1024);
@@ -1970,6 +2025,14 @@ int qemudBuildCommandLine(virConnectPtr conn,
/* SDL is the default. no args needed */
}
+ /* Add sound hardware */
+ if (vm->def->soundDriver != QEMU_SOUND_NONE) {
+ if (!((*argv)[++n] = strdup("-soundhw")))
+ goto no_memory;
+ if (!((*argv)[++n] = strdup((char *) qemudSoundDriverToString(conn, vm->def->soundDriver))))
+ goto no_memory;
+ }
+
if (vm->migrateFrom[0]) {
if (!((*argv)[++n] = strdup("-S")))
goto no_memory;
@@ -3125,7 +3188,11 @@ char *qemudGenerateXML(virConnectPtr conn,
break;
}
- if (def->graphicsType == QEMUD_GRAPHICS_VNC) {
+ if (def->soundDriver != QEMU_SOUND_NONE) {
+ if (virBufferVSprintf(buf, " <sound driver='%s'/>\n",
+ qemudSoundDriverToString(conn,
+ def->soundDriver)) < 0)
+ goto no_memory;
}
if (virBufferAddLit(buf, " </devices>\n") < 0)
diff --git a/src/qemu_conf.h b/src/qemu_conf.h
index c59b1fa..1383c10 100644
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -136,6 +136,14 @@ struct qemud_vm_input_def {
struct qemud_vm_input_def *next;
};
+enum qemu_vm_sound_driver {
+ QEMU_SOUND_NONE,
+ QEMU_SOUND_ALL,
+ QEMU_SOUND_SB16,
+ QEMU_SOUND_ES1370,
+ QEMU_SOUND_PCSPK,
+};
+
/* Flags for the 'type' field in next struct */
enum qemud_vm_device_type {
QEMUD_DEVICE_DISK,
@@ -214,6 +222,7 @@ struct qemud_vm_def {
int vncActivePort;
char vncListen[BR_INET_ADDR_MAXLEN];
char *keymap;
+ int soundDriver;
int ndisks;
struct qemud_vm_disk_def *disks;
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 6ba4571..b470731 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -1783,6 +1783,18 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
}
}
}
+
+ if (sexpr_node(root, "domain/image/hvm/soundhw")) {
+ tmp = sexpr_node(root, "domain/image/hvm/soundhw");
+ if (tmp && *tmp) {
+ if (STREQ(tmp, "all") ||
+ STREQ(tmp, "pcspk") ||
+ STREQ(tmp, "sb16") ||
+ STREQ(tmp, "es1370")) {
+ virBufferVSprintf(&buf, " <sound driver='%s'/>\n", tmp);
+ }
+ }
+ }
}
/* Graphics device (HVM <= 3.0.4, or PV <= 3.0.3) vnc config */
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 3d845dc..91c7cf1 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -934,6 +934,15 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
/* Ignore else branch - probably some other non-input device we don't
support in libvirt yet */
}
+
+ if ((xenXMConfigGetString(conf, "soundhw", &str) == 0) && str) {
+ if (STREQ(str, "all") ||
+ STREQ(str, "pcspk") ||
+ STREQ(str, "sb16") ||
+ STREQ(str, "es1370")) {
+ virBufferVSprintf(buf, " <sound driver='%s'/>\n", str);
+ }
+ }
}
/* HVM guests, or old PV guests use this config format */
@@ -2081,6 +2090,11 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
if (xenXMConfigSetStringFromXPath(conn, conf, ctxt, "usbdevice", "string(/domain/devices/input[@bus='usb' or (not(@bus) and @type='tablet')]/@type)", 1,
"cannot set the usbdevice parameter") < 0)
goto error;
+
+ if (xenXMConfigSetStringFromXPath(conn, conf, ctxt, "soundhw",
+ "string(/domain/devices/sound[@driver]",
+ 1, "cannot set soundhw parameter") < 0)
+ goto error;
}
if (hvm || priv->xendConfigVersion < 3) {
diff --git a/src/xml.c b/src/xml.c
index 8e95103..f4bfb29 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -877,6 +877,14 @@ virDomainParseXMLOSDescHVM(virConnectPtr conn, xmlNodePtr node,
nodes = NULL;
}
+ cur = virXPathNode("/domain/devices/sound", ctxt);
+ if (cur) {
+ xmlChar *driver = NULL;
+ driver = xmlGetProp(cur, (xmlChar *) "driver");
+ if (driver)
+ virBufferVSprintf(buf, "(soundhw '%s')", driver);
+ xmlFree(driver);
+ }
res = virXPathBoolean("count(domain/devices/console) > 0", ctxt);
if (res < 0) {
16 years, 6 months
[libvirt] [PATCH] Implement autostart commands for xen
by Cole Robinson
The attached patch implements the domain autostart commands for
xen. The xen sexpr (since at least 3.0.4 = 1.5 years) has a
on_xend_start field which can be used to autostart a domain.
A couple things:
1) This works on a running guest, but will only show the
sexpr changes after the guest is restarted. Just curious
if there is any better way to do this?
2) This isn't implemented for the xm config file driver. I
figured this is fine since this is inherently dependent
on inactive domain management.
Any feedback is appreciated.
Thanks,
Cole
diff --git a/src/xen_unified.c b/src/xen_unified.c
index 91502dc..cf0a68d 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -1128,6 +1128,34 @@ xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml)
return -1;
}
+static int
+xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart)
+{
+ GET_PRIVATE(dom->conn);
+ int i;
+
+ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
+ if (priv->opened[i] && drivers[i]->domainGetAutostart &&
+ drivers[i]->domainGetAutostart (dom, autostart) == 0)
+ return 0;
+
+ return -1;
+}
+
+static int
+xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart)
+{
+ GET_PRIVATE(dom->conn);
+ int i;
+
+ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
+ if (priv->opened[i] && drivers[i]->domainSetAutostart &&
+ drivers[i]->domainSetAutostart (dom, autostart) == 0)
+ return 0;
+
+ return -1;
+}
+
static char *
xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams)
{
@@ -1291,6 +1319,8 @@ static virDriver xenUnifiedDriver = {
.domainUndefine = xenUnifiedDomainUndefine,
.domainAttachDevice = xenUnifiedDomainAttachDevice,
.domainDetachDevice = xenUnifiedDomainDetachDevice,
+ .domainGetAutostart = xenUnifiedDomainGetAutostart,
+ .domainSetAutostart = xenUnifiedDomainSetAutostart,
.domainGetSchedulerType = xenUnifiedDomainGetSchedulerType,
.domainGetSchedulerParameters = xenUnifiedDomainGetSchedulerParameters,
.domainSetSchedulerParameters = xenUnifiedDomainSetSchedulerParameters,
diff --git a/src/xend_internal.c b/src/xend_internal.c
index f9db571..226ba8e 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -115,8 +115,8 @@ struct xenUnifiedDriver xenDaemonDriver = {
xenDaemonDomainUndefine, /* domainUndefine */
xenDaemonAttachDevice, /* domainAttachDevice */
xenDaemonDetachDevice, /* domainDetachDevice */
- NULL, /* domainGetAutostart */
- NULL, /* domainSetAutostart */
+ xenDaemonDomainGetAutostart, /* domainGetAutostart */
+ xenDaemonDomainSetAutostart, /* domainSetAutostart */
xenDaemonGetSchedulerType, /* domainGetSchedulerType */
xenDaemonGetSchedulerParameters, /* domainGetSchedulerParameters */
xenDaemonSetSchedulerParameters, /* domainSetSchedulerParameters */
@@ -3718,6 +3718,99 @@ xenDaemonDetachDevice(virDomainPtr domain, const char *xml)
"type", class, "dev", ref, "force", "0", "rm_cfg", "1", NULL));
}
+int
+xenDaemonDomainGetAutostart(virDomainPtr domain,
+ int *autostart)
+{
+ struct sexpr *root;
+ const char *tmp;
+
+ if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
+ virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
+ __FUNCTION__);
+ return (-1);
+ }
+
+ root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
+ if (root == NULL) {
+ virXendError (domain->conn, VIR_ERR_XEN_CALL,
+ _("xenDaemonGetAutostart failed to find this domain"));
+ return (-1);
+ }
+
+ *autostart = 0;
+
+ tmp = sexpr_node(root, "domain/on_xend_start");
+ if (tmp && STREQ(tmp, "start")) {
+ *autostart = 1;
+ }
+
+ sexpr_free(root);
+ return 0;
+}
+
+int
+xenDaemonDomainSetAutostart(virDomainPtr domain,
+ int autostart)
+{
+ struct sexpr *root, *autonode;
+ const char *autostr;
+ char buf[4096];
+ int ret = -1;
+
+ if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
+ virXendError((domain ? domain->conn : NULL), VIR_ERR_INTERNAL_ERROR,
+ __FUNCTION__);
+ return (-1);
+ }
+
+ root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
+ if (root == NULL) {
+ virXendError (domain->conn, VIR_ERR_XEN_CALL,
+ _("xenDaemonSetAutostart failed to find this domain"));
+ return (-1);
+ }
+
+ autostr = sexpr_node(root, "domain/on_xend_start");
+ if (autostr) {
+ if (!STREQ(autostr, "ignore") && !STREQ(autostr, "start")) {
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("unexpected value from on_xend_start"));
+ goto error;
+ }
+
+ // Change the autostart value in place, then define the new sexpr
+ autonode = sexpr_lookup(root, "domain/on_xend_start");
+ free(autonode->u.s.car->u.value);
+ autonode->u.s.car->u.value = (autostart ? strdup("start")
+ : strdup("ignore"));
+ if (!(autonode->u.s.car->u.value)) {
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("no memory"));
+ goto error;
+ }
+
+ if (sexpr2string(root, buf, 4096) == 0) {
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("sexpr2string failed"));
+ goto error;
+ }
+ if (xend_op(domain->conn, "", "op", "new", "config", buf, NULL) != 0) {
+ virXendError(domain->conn, VIR_ERR_XEN_CALL,
+ _("Failed to redefine sexpr"));
+ goto error;
+ }
+ } else {
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("on_xend_start not present in sexpr"));
+ goto error;
+ }
+
+ ret = 0;
+ error:
+ sexpr_free(root);
+ return ret;
+}
int
xenDaemonDomainMigratePrepare (virConnectPtr dconn,
diff --git a/src/xend_internal.h b/src/xend_internal.h
index 80ef4f6..97f98f2 100644
--- a/src/xend_internal.h
+++ b/src/xend_internal.h
@@ -229,6 +229,10 @@ int xenDaemonDomainGetVcpus (virDomainPtr domain,
int maxinfo,
unsigned char *cpumaps,
int maplen);
+int xenDaemonDomainGetAutostart (virDomainPtr dom,
+ int *autostart);
+int xenDaemonDomainSetAutostart (virDomainPtr domain,
+ int autostart);
/* xen_unified calls through here. */
extern struct xenUnifiedDriver xenDaemonDriver;
16 years, 6 months
[libvirt] [PATCH] sytnax-check: add a check for risky ctype macro use
by Jim Meyering
A follow-up to the patch that introduced to_uchar.
This rule will ensure no new offenders sneak back in.
>From d141d07c7e21cc228fe46d90f21dd86685d7e424 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 8 May 2008 16:18:13 +0200
Subject: [PATCH] sytnax-check: add a check for risky ctype macro use
* Makefile.maint (sc_risky_ctype_macros): New rule.
---
Makefile.maint | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index ddf42bc..bab8e1d 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -302,6 +302,15 @@ sc_TAB_in_indentation:
{ echo '$(ME): found TAB(s) use for indentation; use spaces' \
1>&2; exit 1; } || :
+ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
+|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
+
+sc_risky_ctype_macros:
+ @grep -E '\b($(ctype_re)) *\(' /dev/null \
+ $$($(VC_LIST_EXCEPT)) | grep -v to_uchar && \
+ { echo '$(ME): found ctype macro use without to_uchar' \
+ 1>&2; exit 1; } || :
+
# Match lines like the following, but where there is only one space
# between the options and the description:
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
--
1.5.5.1.148.gbc1be
16 years, 6 months
[libvirt] [PATCH] add "const" to file-scoped statics
by Jim Meyering
>From fed1a1abfd2b9ece7bd8e44aae13de91eaad4f5d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 7 May 2008 23:12:13 +0200
Subject: [PATCH] add "const" to file-scoped statics
These were relatively new additions to the list from here:
nm src/*.o|grep ' D '.
This is another test that should be automatic...
---
src/storage_backend_fs.c | 2 +-
src/xend_internal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index d0eb32a..b41b952 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -79,7 +79,7 @@ enum {
};
/* Either 'magic' or 'extension' *must* be provided */
-struct {
+static const struct {
int type; /* One of the constants above */
const char *magic; /* Optional string of file magic
* to check at head of file */
diff --git a/src/xend_internal.c b/src/xend_internal.c
index f9db571..dd3ade6 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -854,7 +854,7 @@ urlencode(const char *string)
#endif /* ! PROXY */
/* Applicable sound models */
-const char *sound_models[] = { "sb16", "es1370" };
+static const char *const sound_models[] = { "sb16", "es1370" };
/**
* is_sound_model_valid:
--
1.5.5.1.148.gbc1be
16 years, 6 months
[libvirt] PATCH: Add <disk> bus attribute for Xen driver
by Daniel P. Berrange
To complement soren's patch adding a bus attribute to the QEMU driver,
here is a minimal patch adding bus attribute to the Xen drivers. It merely
adds it on when generating the XML. It isn't making any attempt to interpret
it when creating a VM, since Xen does everything based off the disk node
name anyway its (currently) redundant.
The bus types supported are 'xen' for paravirt disks, or 'ide' and 'scsi'
for HVM guests.
NB, if setting up ide / scsi disks with HVM, XenD also sets up a parvirt
disk, but we don't attempt to express this duplication as its an underlying
impl detail.
Regards,
Daniel.
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.183
diff -u -p -r1.183 xend_internal.c
--- src/xend_internal.c 30 Apr 2008 12:30:55 -0000 1.183
+++ src/xend_internal.c 7 May 2008 00:14:23 -0000
@@ -1759,6 +1759,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
const char *src = NULL;
const char *dst = NULL;
const char *mode = NULL;
+ const char *bus = NULL;
/* Again dealing with (vbd...) vs (tap ...) differences */
if (sexpr_lookup(node, "device/vbd")) {
@@ -1878,7 +1879,16 @@ xend_parse_sexp_desc(virConnectPtr conn,
/* This case is the cdrom device only */
virBufferAddLit(&buf, " <disk device='cdrom'>\n");
}
- virBufferVSprintf(&buf, " <target dev='%s'/>\n", dst);
+
+ if (STRPREFIX(dst, "xvd") || !hvm) {
+ bus = "xen";
+ } else if (STRPREFIX(dst, "sd")) {
+ bus = "scsi";
+ } else {
+ bus = "ide";
+ }
+ virBufferVSprintf(&buf, " <target dev='%s' bus='%s'/>\n",
+ dst, bus);
/* XXX should we force mode == r, if cdrom==1, or assume
@@ -1967,14 +1977,14 @@ xend_parse_sexp_desc(virConnectPtr conn,
if ((tmp != NULL) && (tmp[0] != 0)) {
virBufferAddLit(&buf, " <disk type='file' device='floppy'>\n");
virBufferVSprintf(&buf, " <source file='%s'/>\n", tmp);
- virBufferAddLit(&buf, " <target dev='fda'/>\n");
+ virBufferAddLit(&buf, " <target dev='fda' bus='fdc'/>\n");
virBufferAddLit(&buf, " </disk>\n");
}
tmp = sexpr_node(root, "domain/image/hvm/fdb");
if ((tmp != NULL) && (tmp[0] != 0)) {
virBufferAddLit(&buf, " <disk type='file' device='floppy'>\n");
virBufferVSprintf(&buf, " <source file='%s'/>\n", tmp);
- virBufferAddLit(&buf, " <target dev='fdb'/>\n");
+ virBufferAddLit(&buf, " <target dev='fdb' bus='fdc'/>\n");
virBufferAddLit(&buf, " </disk>\n");
}
@@ -1985,7 +1995,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
virBufferAddLit(&buf, " <disk type='file' device='cdrom'>\n");
virBufferAddLit(&buf, " <driver name='file'/>\n");
virBufferVSprintf(&buf, " <source file='%s'/>\n", tmp);
- virBufferAddLit(&buf, " <target dev='hdc'/>\n");
+ virBufferAddLit(&buf, " <target dev='hdc' bus='ide'/>\n");
virBufferAddLit(&buf, " <readonly/>\n");
virBufferAddLit(&buf, " </disk>\n");
}
Index: src/xm_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xm_internal.c,v
retrieving revision 1.74
diff -u -p -r1.74 xm_internal.c
--- src/xm_internal.c 30 Apr 2008 12:30:55 -0000 1.74
+++ src/xm_internal.c 7 May 2008 00:14:26 -0000
@@ -733,6 +733,7 @@ char *xenXMDomainFormatXML(virConnectPtr
char *head;
char *offset;
char *tmp, *tmp1;
+ const char *bus;
if ((list->type != VIR_CONF_STRING) || (list->str == NULL))
goto skipdisk;
@@ -805,6 +806,14 @@ char *xenXMDomainFormatXML(virConnectPtr
tmp[0] = '\0';
}
+ if (STRPREFIX(dev, "xvd") || !hvm) {
+ bus = "xen";
+ } else if (STRPREFIX(dev, "sd")) {
+ bus = "scsi";
+ } else {
+ bus = "ide";
+ }
+
virBufferVSprintf(&buf, " <disk type='%s' device='%s'>\n",
block ? "block" : "file",
cdrom ? "cdrom" : "disk");
@@ -814,7 +823,7 @@ char *xenXMDomainFormatXML(virConnectPtr
virBufferVSprintf(&buf, " <driver name='%s'/>\n", drvName);
if (src[0])
virBufferVSprintf(&buf, " <source %s='%s'/>\n", block ? "dev" : "file", src);
- virBufferVSprintf(&buf, " <target dev='%s'/>\n", dev);
+ virBufferVSprintf(&buf, " <target dev='%s' bus='%s'/>\n", dev, bus);
if (!strcmp(head, "r") ||
!strcmp(head, "ro"))
virBufferAddLit(&buf, " <readonly/>\n");
@@ -833,7 +842,7 @@ char *xenXMDomainFormatXML(virConnectPtr
virBufferAddLit(&buf, " <disk type='file' device='cdrom'>\n");
virBufferAddLit(&buf, " <driver name='file'/>\n");
virBufferVSprintf(&buf, " <source file='%s'/>\n", str);
- virBufferAddLit(&buf, " <target dev='hdc'/>\n");
+ virBufferAddLit(&buf, " <target dev='hdc' bus='ide'/>\n");
virBufferAddLit(&buf, " <readonly/>\n");
virBufferAddLit(&buf, " </disk>\n");
}
Index: tests/sexpr2xmltest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
retrieving revision 1.27
diff -u -p -r1.27 sexpr2xmltest.c
--- tests/sexpr2xmltest.c 30 Apr 2008 12:30:55 -0000 1.27
+++ tests/sexpr2xmltest.c 7 May 2008 00:14:36 -0000
@@ -113,11 +113,11 @@ main(int argc, char **argv)
DO_TEST("disk-drv-blktap-raw", "disk-drv-blktap-raw", 2);
DO_TEST("disk-drv-blktap-qcow", "disk-drv-blktap-qcow", 2);
- DO_TEST("curmem", "curmem", 1);
+ DO_TEST("curmem", "curmem", 2);
DO_TEST("net-routed", "net-routed", 2);
DO_TEST("net-bridged", "net-bridged", 2);
DO_TEST("net-e1000", "net-e1000", 2);
- DO_TEST("no-source-cdrom", "no-source-cdrom", 1);
+ DO_TEST("no-source-cdrom", "no-source-cdrom", 2);
DO_TEST("fv-utc", "fv-utc", 1);
DO_TEST("fv-localtime", "fv-localtime", 1);
Index: tests/sexpr2xmldata/sexpr2xml-curmem.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-curmem.xml,v
retrieving revision 1.5
diff -u -p -r1.5 sexpr2xml-curmem.xml
--- tests/sexpr2xmldata/sexpr2xml-curmem.xml 26 Apr 2008 14:22:02 -0000 1.5
+++ tests/sexpr2xmldata/sexpr2xml-curmem.xml 7 May 2008 00:14:36 -0000
@@ -24,10 +24,10 @@
<disk type='file' device='disk'>
<driver name='tap' type='aio'/>
<source file='/xen/rhel5.img'/>
- <target dev='xvda:disk'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<input type='mouse' bus='xen'/>
- <graphics type='vnc' port='5905'/>
+ <graphics type='vnc' port='-1'/>
<console type='pty'>
<target port='0'/>
</console>
Index: tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml,v
retrieving revision 1.2
diff -u -p -r1.2 sexpr2xml-disk-block-shareable.xml
--- tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml 26 Apr 2008 14:22:02 -0000 1.2
+++ tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml 7 May 2008 00:14:36 -0000
@@ -12,7 +12,7 @@
<disk type='file' device='disk'>
<driver name='tap' type='aio'/>
<source file='/var/lib/xen/images/rhel5pv.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
<shareable/>
</disk>
<interface type='bridge'>
Index: tests/sexpr2xmldata/sexpr2xml-disk-block.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-disk-block.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-disk-block.xml
--- tests/sexpr2xmldata/sexpr2xml-disk-block.xml 26 Apr 2008 14:22:02 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-disk-block.xml 7 May 2008 00:14:36 -0000
@@ -16,7 +16,7 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/MainVG/GuestVG'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-disk-drv-blktap-qcow.xml
--- tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml 26 Apr 2008 14:22:02 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml 7 May 2008 00:14:36 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='tap' type='qcow'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-disk-drv-blktap-raw.xml
--- tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml 26 Apr 2008 14:22:02 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml 7 May 2008 00:14:36 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='tap' type='aio'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-disk-file.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-disk-file.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-disk-file.xml
--- tests/sexpr2xmldata/sexpr2xml-disk-file.xml 26 Apr 2008 14:22:02 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-disk-file.xml 7 May 2008 00:14:36 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml,v
retrieving revision 1.2
diff -u -p -r1.2 sexpr2xml-fv-kernel.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml 26 Apr 2008 14:22:02 -0000 1.2
+++ tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml 7 May 2008 00:14:36 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<serial type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-legacy-vfb.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml 5 Feb 2008 16:21:25 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml 7 May 2008 00:14:36 -0000
@@ -25,7 +25,7 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/zvol/dsk/export/s10u4-root'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml,v
retrieving revision 1.4
diff -u -p -r1.4 sexpr2xml-fv-localtime.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml 21 Aug 2007 08:54:07 -0000 1.4
+++ tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml 7 May 2008 00:14:36 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-parallel-tcp.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml 7 May 2008 00:14:36 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-file.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-null.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-pipe.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-pty.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-stdio.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-tcp-telnet.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-tcp.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-udp.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-fv-serial-unix.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-fv-usbmouse.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml 21 Aug 2007 08:54:07 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='usb'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-fv-usbtablet.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml 21 Aug 2007 08:54:07 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='tablet' bus='usb'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml,v
retrieving revision 1.4
diff -u -p -r1.4 sexpr2xml-fv-utc.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-utc.xml 21 Aug 2007 08:54:07 -0000 1.4
+++ tests/sexpr2xmldata/sexpr2xml-fv-utc.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml,v
retrieving revision 1.7
diff -u -p -r1.7 sexpr2xml-fv-v2.xml
--- tests/sexpr2xmldata/sexpr2xml-fv-v2.xml 21 Aug 2007 08:54:07 -0000 1.7
+++ tests/sexpr2xmldata/sexpr2xml-fv-v2.xml 7 May 2008 00:14:37 -0000
@@ -20,13 +20,13 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
Index: tests/sexpr2xmldata/sexpr2xml-fv.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-fv.xml,v
retrieving revision 1.7
diff -u -p -r1.7 sexpr2xml-fv.xml
--- tests/sexpr2xmldata/sexpr2xml-fv.xml 21 Aug 2007 08:54:07 -0000 1.7
+++ tests/sexpr2xmldata/sexpr2xml-fv.xml 7 May 2008 00:14:37 -0000
@@ -20,7 +20,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
@@ -31,7 +31,7 @@
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
Index: tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-net-bridged.xml,v
retrieving revision 1.4
diff -u -p -r1.4 sexpr2xml-net-bridged.xml
--- tests/sexpr2xmldata/sexpr2xml-net-bridged.xml 26 Apr 2008 14:22:02 -0000 1.4
+++ tests/sexpr2xmldata/sexpr2xml-net-bridged.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr2'/>
Index: tests/sexpr2xmldata/sexpr2xml-net-e1000.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml,v
retrieving revision 1.1
diff -u -p -r1.1 sexpr2xml-net-e1000.xml
--- tests/sexpr2xmldata/sexpr2xml-net-e1000.xml 30 Apr 2008 12:30:55 -0000 1.1
+++ tests/sexpr2xmldata/sexpr2xml-net-e1000.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr2'/>
Index: tests/sexpr2xmldata/sexpr2xml-net-routed.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-net-routed.xml,v
retrieving revision 1.4
diff -u -p -r1.4 sexpr2xml-net-routed.xml
--- tests/sexpr2xmldata/sexpr2xml-net-routed.xml 26 Apr 2008 14:22:02 -0000 1.4
+++ tests/sexpr2xmldata/sexpr2xml-net-routed.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='ethernet'>
<target dev='vif6.0'/>
Index: tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml,v
retrieving revision 1.9
diff -u -p -r1.9 sexpr2xml-no-source-cdrom.xml
--- tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml 26 Apr 2008 14:22:02 -0000 1.9
+++ tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml 7 May 2008 00:14:37 -0000
@@ -28,14 +28,14 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sda8'/>
- <target dev='hda:disk'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk device='cdrom'>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<input type='mouse' bus='ps2'/>
- <graphics type='vnc' port='5906'/>
+ <graphics type='vnc' port='-1'/>
<serial type='pty'>
<target port='0'/>
</serial>
Index: tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml,v
retrieving revision 1.3
diff -u -p -r1.3 sexpr2xml-pv-bootloader.xml
--- tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml 26 Apr 2008 14:22:02 -0000 1.3
+++ tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml 7 May 2008 00:14:37 -0000
@@ -12,7 +12,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml,v
retrieving revision 1.6
diff -u -p -r1.6 sexpr2xml-pv-vfb-new.xml
--- tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml 26 Apr 2008 14:22:02 -0000 1.6
+++ tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' listen='0.0.0.0' keymap='ja'/>
Index: tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml,v
retrieving revision 1.6
diff -u -p -r1.6 sexpr2xml-pv-vfb-orig.xml
--- tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml 26 Apr 2008 14:22:02 -0000 1.6
+++ tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' listen='0.0.0.0' keymap='ja'/>
Index: tests/sexpr2xmldata/sexpr2xml-pv.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmldata/sexpr2xml-pv.xml,v
retrieving revision 1.4
diff -u -p -r1.4 sexpr2xml-pv.xml
--- tests/sexpr2xmldata/sexpr2xml-pv.xml 26 Apr 2008 14:22:02 -0000 1.4
+++ tests/sexpr2xmldata/sexpr2xml-pv.xml 7 May 2008 00:14:37 -0000
@@ -16,7 +16,7 @@
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/some.img'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
<target port='0'/>
Index: tests/xmconfigdata/test-fullvirt-localtime.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-localtime.xml,v
retrieving revision 1.3
diff -u -p -r1.3 test-fullvirt-localtime.xml
--- tests/xmconfigdata/test-fullvirt-localtime.xml 9 Aug 2007 20:19:12 -0000 1.3
+++ tests/xmconfigdata/test-fullvirt-localtime.xml 7 May 2008 00:14:37 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-new-cdrom.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-new-cdrom.xml,v
retrieving revision 1.6
diff -u -p -r1.6 test-fullvirt-new-cdrom.xml
--- tests/xmconfigdata/test-fullvirt-new-cdrom.xml 9 Aug 2007 20:19:12 -0000 1.6
+++ tests/xmconfigdata/test-fullvirt-new-cdrom.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-old-cdrom.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-old-cdrom.xml,v
retrieving revision 1.6
diff -u -p -r1.6 test-fullvirt-old-cdrom.xml
--- tests/xmconfigdata/test-fullvirt-old-cdrom.xml 9 Aug 2007 20:19:12 -0000 1.6
+++ tests/xmconfigdata/test-fullvirt-old-cdrom.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-parallel-tcp.xml
--- tests/xmconfigdata/test-fullvirt-parallel-tcp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-parallel-tcp.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-file.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-file.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-file.xml
--- tests/xmconfigdata/test-fullvirt-serial-file.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-file.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-null.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-null.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-null.xml
--- tests/xmconfigdata/test-fullvirt-serial-null.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-null.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-pipe.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-pipe.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-pipe.xml
--- tests/xmconfigdata/test-fullvirt-serial-pipe.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-pipe.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-pty.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-pty.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-pty.xml
--- tests/xmconfigdata/test-fullvirt-serial-pty.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-pty.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-stdio.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-stdio.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-stdio.xml
--- tests/xmconfigdata/test-fullvirt-serial-stdio.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-stdio.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-tcp-telnet.xml
--- tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-tcp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-tcp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-tcp.xml
--- tests/xmconfigdata/test-fullvirt-serial-tcp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-tcp.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-udp.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-udp.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-udp.xml
--- tests/xmconfigdata/test-fullvirt-serial-udp.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-udp.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-serial-unix.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-serial-unix.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-fullvirt-serial-unix.xml
--- tests/xmconfigdata/test-fullvirt-serial-unix.xml 26 Apr 2008 14:22:02 -0000 1.1
+++ tests/xmconfigdata/test-fullvirt-serial-unix.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-usbmouse.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-usbmouse.xml,v
retrieving revision 1.2
diff -u -p -r1.2 test-fullvirt-usbmouse.xml
--- tests/xmconfigdata/test-fullvirt-usbmouse.xml 9 Aug 2007 20:19:12 -0000 1.2
+++ tests/xmconfigdata/test-fullvirt-usbmouse.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml,v
retrieving revision 1.2
diff -u -p -r1.2 test-fullvirt-usbtablet-no-bus.xml
--- tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml 9 Aug 2007 20:19:12 -0000 1.2
+++ tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-usbtablet.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-usbtablet.xml,v
retrieving revision 1.2
diff -u -p -r1.2 test-fullvirt-usbtablet.xml
--- tests/xmconfigdata/test-fullvirt-usbtablet.xml 9 Aug 2007 20:19:12 -0000 1.2
+++ tests/xmconfigdata/test-fullvirt-usbtablet.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-fullvirt-utc.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-fullvirt-utc.xml,v
retrieving revision 1.3
diff -u -p -r1.3 test-fullvirt-utc.xml
--- tests/xmconfigdata/test-fullvirt-utc.xml 9 Aug 2007 20:19:12 -0000 1.3
+++ tests/xmconfigdata/test-fullvirt-utc.xml 7 May 2008 00:14:38 -0000
@@ -23,12 +23,12 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
- <target dev='hda'/>
+ <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
- <target dev='hdc'/>
+ <target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
Index: tests/xmconfigdata/test-paravirt-net-e1000.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-paravirt-net-e1000.xml,v
retrieving revision 1.1
diff -u -p -r1.1 test-paravirt-net-e1000.xml
--- tests/xmconfigdata/test-paravirt-net-e1000.xml 30 Apr 2008 12:30:55 -0000 1.1
+++ tests/xmconfigdata/test-paravirt-net-e1000.xml 7 May 2008 00:14:38 -0000
@@ -12,7 +12,7 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
Index: tests/xmconfigdata/test-paravirt-new-pvfb.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-paravirt-new-pvfb.xml,v
retrieving revision 1.4
diff -u -p -r1.4 test-paravirt-new-pvfb.xml
--- tests/xmconfigdata/test-paravirt-new-pvfb.xml 26 Apr 2008 14:22:03 -0000 1.4
+++ tests/xmconfigdata/test-paravirt-new-pvfb.xml 7 May 2008 00:14:38 -0000
@@ -12,7 +12,7 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
Index: tests/xmconfigdata/test-paravirt-old-pvfb.xml
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigdata/test-paravirt-old-pvfb.xml,v
retrieving revision 1.4
diff -u -p -r1.4 test-paravirt-old-pvfb.xml
--- tests/xmconfigdata/test-paravirt-old-pvfb.xml 26 Apr 2008 14:22:03 -0000 1.4
+++ tests/xmconfigdata/test-paravirt-old-pvfb.xml 7 May 2008 00:14:38 -0000
@@ -12,7 +12,7 @@
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
- <target dev='xvda'/>
+ <target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
--
|: Red Hat, Engineering, Boston -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 :|
16 years, 6 months
[libvirt] Re-write the domain XML reference docs
by Daniel P. Berrange
The current domain XML format documentation reference on the website is
very out of date and not well structured since we organically added random
bits to it as we wrote drivers. This patch is starting from a clean slate.
I've removed all existing content and have written a clear & concise
reference for (all?) XML elements we support in the domain XML format.
This is following the style I've used for the storage and network XML
format docs.
Basically I've grouped the difference elements into logically related sets
and then described each one, giving examples and details of all attributes
they support. This also covers the new serial/paralle device syntax I
added recently.
The example configs for Xen, QEMU, etc domains are all in the driver
specific docs already, and linked at the bottom of this page.
The patch isn't particularly nice to review, so I'd recommend applying it
and looking at the resulting 'formatdomain.html' page in your web browser
Regads,
Daniel.
Index: formatdomain.html
===================================================================
RCS file: /data/cvs/libvirt/docs/formatdomain.html,v
retrieving revision 1.6
diff -u -p -r1.6 formatdomain.html
--- formatdomain.html 28 Apr 2008 08:29:35 -0000 1.6
+++ formatdomain.html 6 May 2008 23:56:33 -0000
@@ -114,206 +114,718 @@
</div>
<div id="content">
<h1>Domain XML format</h1>
- <p>This section describes the XML format used to represent domains, there are
-variations on the format based on the kind of domains run and the options
-used to launch them:</p>
- <h3 id="Normal"><a name="Normal1" id="Normal1">Normal paravirtualized Xen
-guests</a>:</h3>
- <p>The root element must be called <code>domain</code> with no namespace, the
-<code>type</code> attribute indicates the kind of hypervisor used, 'xen' is
-the default value. The <code>id</code> attribute gives the domain id at
-runtime (not however that this may change, for example if the domain is saved
-to disk and restored). The domain has a few children whose order is not
-significant:</p>
- <ul><li>name: the domain name, preferably ASCII based</li><li>memory: the maximum memory allocated to the domain in kilobytes</li><li>vcpu: the number of virtual cpu configured for the domain</li><li>os: a block describing the Operating System, its content will be
- dependent on the OS type
- <ul><li>type: indicate the OS type, always linux at this point</li><li>kernel: path to the kernel on the Domain 0 filesystem</li><li>initrd: an optional path for the init ramdisk on the Domain 0
- filesystem</li><li>cmdline: optional command line to the kernel</li><li>root: the root filesystem from the guest viewpoint, it may be
- passed as part of the cmdline content too</li></ul></li><li>devices: a list of <code>disk</code>, <code>interface</code> and
- <code>console</code> descriptions in no special order</li></ul>
- <p>The format of the devices and their type may grow over time, but the
-following should be sufficient for basic use:</p>
- <p>A <code>disk</code> device indicates a block device, it can have two
-values for the type attribute either 'file' or 'block' corresponding to the 2
-options available at the Xen layer. It has two mandatory children, and one
-optional one in no specific order:</p>
- <ul><li>source with a file attribute containing the path in Domain 0 to the
- file or a dev attribute if using a block device, containing the device
- name ('hda5' or '/dev/hda5')</li><li>target indicates in a dev attribute the device where it is mapped in
- the guest</li><li>readonly an optional empty element indicating the device is
- read-only</li><li>shareable an optional empty element indicating the device
- can be used read/write with other domains</li></ul>
- <p>An <code>interface</code> element describes a network device mapped on the
-guest, it also has a type whose value is currently 'bridge', it also have a
-number of children in no specific order:</p>
- <ul><li>source: indicating the bridge name</li><li>mac: the optional mac address provided in the address attribute</li><li>ip: the optional IP address provided in the address attribute</li><li>script: the script used to bridge the interface in the Domain 0</li><li>target: and optional target indicating the device name.</li></ul>
- <p>A <code>console</code> element describes a serial console connection to
-the guest. It has no children, and a single attribute <code>tty</code> which
-provides the path to the Pseudo TTY on which the guest console can be
-accessed</p>
- <p>Life cycle actions for the domain can also be expressed in the XML format,
-they drive what should be happening if the domain crashes, is rebooted or is
-poweroff. There is various actions possible when this happen:</p>
- <ul><li>destroy: The domain is cleaned up (that's the default normal processing
- in Xen)</li><li>restart: A new domain is started in place of the old one with the same
- configuration parameters</li><li>preserve: The domain will remain in memory until it is destroyed
- manually, it won't be running but allows for post-mortem debugging</li><li>rename-restart: a variant of the previous one but where the old domain
- is renamed before being saved to allow a restart</li></ul>
- <p>The following could be used for a Xen production system:</p>
- <pre><domain>
- ...
- <on_reboot>restart</on_reboot>
- <on_poweroff>destroy</on_poweroff>
- <on_crash>rename-restart</on_crash>
- ...
-</domain></pre>
- <p>While the format may be extended in various ways as support for more
-hypervisor types and features are added, it is expected that this core subset
-will remain functional in spite of the evolution of the library.</p>
- <h3 id="Fully">
- <a name="Fully1" id="Fully1">Fully virtualized guests</a>
- </h3>
- <p>There is a few things to notice specifically for HVM domains:</p>
- <ul><li>the optional <code><features></code> block is used to enable
- certain guest CPU / system features. For HVM guests the following
- features are defined:
- <ul><li><code>pae</code> - enable PAE memory addressing</li><li><code>apic</code> - enable IO APIC</li><li><code>acpi</code> - enable ACPI bios</li></ul></li><li>the optional <code><clock></code> element is used to specify
- whether the emulated BIOS clock in the guest is synced to either
- <code>localtime</code> or <code>utc</code>. In general Windows will
- want <code>localtime</code> while all other operating systems will
- want <code>utc</code>. The default is thus <code>utc</code></li><li>the <code><os></code> block description is very different, first
- it indicates that the type is 'hvm' for hardware virtualization, then
- instead of a kernel, boot and command line arguments, it points to an os
- boot loader which will extract the boot information from the boot device
- specified in a separate boot element. The <code>dev</code> attribute on
- the <code>boot</code> tag can be one of:
- <ul><li><code>fd</code> - boot from first floppy device</li><li><code>hd</code> - boot from first harddisk device</li><li><code>cdrom</code> - boot from first cdrom device</li></ul></li><li>the <code><devices></code> section includes an emulator entry
- pointing to an additional program in charge of emulating the devices</li><li>the disk entry indicates in the dev target section that the emulation
- for the drive is the first IDE disk device hda. The list of device names
- supported is dependent on the Hypervisor, but for Xen it can be any IDE
- device <code>hda</code>-<code>hdd</code>, or a floppy device
- <code>fda</code>, <code>fdb</code>. The <code><disk></code> element
- also supports a 'device' attribute to indicate what kinda of hardware to
- emulate. The following values are supported:
- <ul><li><code>floppy</code> - a floppy disk controller</li><li><code>disk</code> - a generic hard drive (the default it
- omitted)</li><li><code>cdrom</code> - a CDROM device</li></ul>
- For Xen 3.0.2 and earlier a CDROM device can only be emulated on the
- <code>hdc</code> channel, while for 3.0.3 and later, it can be emulated
- on any IDE channel.</li><li>the <code><devices></code> section also include at least one
- entry for the graphic device used to render the os. Currently there is
- just 2 types possible 'vnc' or 'sdl'. If the type is 'vnc', then an
- additional <code>port</code> attribute will be present indicating the TCP
- port on which the VNC server is accepting client connections.</li></ul>
- <p>It is likely that the HVM description gets additional optional elements
-and attributes as the support for fully virtualized domain expands,
-especially for the variety of devices emulated and the graphic support
-options offered.</p>
- <h3>
- <a name="Net1" id="Net1">Networking interface options</a>
- </h3>
- <p>The networking support in the QEmu and KVM case is more flexible, and
-support a variety of options:</p>
- <ol><li>Userspace SLIRP stack
- <p>Provides a virtual LAN with NAT to the outside world. The virtual
- network has DHCP & DNS services and will give the guest VM addresses
- starting from <code>10.0.2.15</code>. The default router will be
- <code>10.0.2.2</code> and the DNS server will be <code>10.0.2.3</code>.
- This networking is the only option for unprivileged users who need their
- VMs to have outgoing access. Example configs are:</p>
- <pre><interface type='user'/></pre>
- <pre>
-<interface type='user'>
- <mac address="11:22:33:44:55:66"/>
-</interface>
- </pre>
- </li><li>Virtual network
- <p>Provides a virtual network using a bridge device in the host.
- Depending on the virtual network configuration, the network may be
- totally isolated, NAT'ing to an explicit network device, or NAT'ing to
- the default route. DHCP and DNS are provided on the virtual network in
- all cases and the IP range can be determined by examining the virtual
- network config with '<code>virsh net-dumpxml <network
- name></code>'. There is one virtual network called 'default' setup out
- of the box which does NAT'ing to the default route and has an IP range of
- <code>192.168.22.0/255.255.255.0</code>. Each guest will have an
- associated tun device created with a name of vnetN, which can also be
- overridden with the <target> element. Example configs are:</p>
- <pre><interface type='network'>
- <source network='default'/>
-</interface>
-
-<interface type='network'>
- <source network='default'/>
- <target dev='vnet7'/>
- <mac address="11:22:33:44:55:66"/>
-</interface>
- </pre>
- </li><li>Bridge to to LAN
- <p>Provides a bridge from the VM directly onto the LAN. This assumes
- there is a bridge device on the host which has one or more of the hosts
- physical NICs enslaved. The guest VM will have an associated tun device
- created with a name of vnetN, which can also be overridden with the
- <target> element. The tun device will be enslaved to the bridge.
- The IP range / network configuration is whatever is used on the LAN. This
- provides the guest VM full incoming & outgoing net access just like a
- physical machine. Examples include:</p>
- <pre><interface type='bridge'>
- <source bridge='br0'/>
-</interface>
-
-<interface type='bridge'>
- <source bridge='br0'/>
- <target dev='vnet7'/>
- <mac address="11:22:33:44:55:66"/>
-</interface></pre>
- </li><li>Generic connection to LAN
- <p>Provides a means for the administrator to execute an arbitrary script
- to connect the guest's network to the LAN. The guest will have a tun
- device created with a name of vnetN, which can also be overridden with the
- <target> element. After creating the tun device a shell script will
- be run which is expected to do whatever host network integration is
- required. By default this script is called /etc/qemu-ifup but can be
- overridden.</p>
- <pre><interface type='ethernet'/>
+ <ul><li>
+ <a href="#elements">Element and attribute overview</a>
+ <ul><li>
+ <a href="#elementsMetadata">General metadata</a>
+ </li><li>
+ <a href="#elementsOS">Operating system booting</a>
+ <ul><li>
+ <a href="#elementsOSBIOS">BIOS bootloader</a>
+ </li><li>
+ <a href="#elementsOSBootloader">Host bootloader</a>
+ </li><li>
+ <a href="#elementsOSKernel">Direct kernel boot</a>
+ </li></ul>
+ </li><li>
+ <a href="#elementsResources">Basic resources</a>
+ </li><li>
+ <a href="#elementsLifecycle">Lifecycle control</a>
+ </li><li>
+ <a href="#elementsFeatures">Hypervisor features</a>
+ </li><li>
+ <a href="#elementsTime">Time keeping</a>
+ </li><li>
+ <a href="#elementsDevices">Devices</a>
+ <ul><li>
+ <a href="#elementsDisks">Hard drives, floppy disks, CDROMs</a>
+ </li><li>
+ <a href="#elementsNICS">Network interfaces</a>
+ <ul><li>
+ <a href="#elementsNICSVirtual">Virtual network</a>
+ </li><li>
+ <a href="#elementsNICSBridge">Bridge to to LAN</a>
+ </li><li>
+ <a href="#elementsNICSSlirp">Userspace SLIRP stack</a>
+ </li><li>
+ <a href="#elementsNICSEthernet">Generic ethernet connection</a>
+ </li><li>
+ <a href="#elementsNICSMulticast">Multicast tunnel</a>
+ </li><li>
+ <a href="#elementsNICSTCP">TCP tunnel</a>
+ </li></ul>
+ </li><li>
+ <a href="#elementsInput">Input devices</a>
+ </li><li>
+ <a href="#elementsGraphics">Graphical framebuffers</a>
+ </li><li>
+ <a href="#elementsConsole">Consoles, serial & parallel devices</a>
+ <ul><li>
+ <a href="#elementsCharSTDIO">Domain logfile</a>
+ </li><li>
+ <a href="#elementsCharFle">Device logfile</a>
+ </li><li>
+ <a href="#elementsCharVC">Virtual console</a>
+ </li><li>
+ <a href="#elementsCharNull">Null device</a>
+ </li><li>
+ <a href="#elementsCharPTY">Pseudo TTY</a>
+ </li><li>
+ <a href="#elementsCharHost">Host device proxy</a>
+ </li><li>
+ <a href="#elementsCharTCP">TCP client/server</a>
+ </li><li>
+ <a href="#elementsCharUDP">UDP network console</a>
+ </li><li>
+ <a href="#elementsCharUNIX">UNIX domain socket client/server</a>
+ </li></ul>
+ </li></ul>
+ </li></ul>
+ </li><li>
+ <a href="#examples">Example configs</a>
+ </li></ul>
+ <p>
+ This section describes the XML format used to represent domains, there are
+ variations on the format based on the kind of domains run and the options
+ used to launch them. For hypervisor specific details consult the
+ <a href="drivers.html">driver docs</a>
+ </p>
+ <h2>
+ <a name="elements" id="elements">Element and attribute overview</a>
+ </h2>
+ <p>
+ The root element required for all virtual machines is
+ named <code>domain</code>. It has two attributes, the
+ <code>type</code> specifies the hypervisor used for running
+ the domain. The allowed values are driver specific, but
+ include "xen", "kvm", "qemu", "lxc" and "kqemu". The
+ second attribute is <code>id</code> which is a unique
+ integer identifier for the running guest machine. Inactive
+ machines have no id value.
+ </p>
+ <h3>
+ <a name="elementsMetadata" id="elementsMetadata">General metadata</a>
+ </h3>
+ <pre>
+ <domain type='xen' id='3'>
+ <name>fv0</name>
+ <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
+ ...</pre>
+ <dl><dt><code>name</code></dt><dd>The content of the <code>name</code> element provides
+ a short name for the virtual machine. This name should
+ consist only of alpha-numeric characters and is required
+ to be unique within the scope of a single host. It is
+ often used to form the filename for storing the persistent
+ configuration file. <span class="since">Since 0.0.1</span></dd><dt><code>uuid</code></dt><dd>The content of the <code>uuid</code> element provides
+ a globally unique identifier for the virtual machine.
+ The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
+ If omitted when defining/creating a new machine, a random
+ UUID is generated. <span class="since">Since 0.0.1</span></dd></dl>
+ <h3>
+ <a name="elementsOS" id="elementsOS">Operating system booting</a>
+ </h3>
+ <p>
+ There are a number of different ways to boot virtual machines
+ each with their own pros and cons.
+ </p>
+ <h4>
+ <a name="elementsOSBIOS" id="elementsOSBIOS">BIOS bootloader</a>
+ </h4>
+ <p>
+ Booting via the BIOS is available for hypervisors supporting
+ full virtualization. In this case the BIOS has a boot order
+ priority (floppy, harddisk, cdrom, network) determining where
+ to obtain/find the boot image.
+ </p>
+ <pre>
+ ...
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='hd'/>
+ </os>
+ ...</pre>
+ <dl><dt><code>type</code></dt><dd>The content of the <code>type</code> element specifies the
+ type of operating system to be booted in the virtual machine.
+ <code>hvm</code> indicates that the OS is one designed to run
+ on bare metal, so requires full virtualization. <code>linux</code>
+ (badly named!) refers to an OS that supports the Xen 3 hypervisor
+ guest ABI. There are also two optional attributes, <code>arch</code>
+ specifying the CPU architecture to virtualization, and <code>machine</code>
+ refering to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
+ provides details on allowed values for these. <span class="since">Since 0.0.1</span></dd><dt><code>loader</code></dt><dd>The optional <code>loader</code> tag refers to a firmware blob
+ used to assist the domain creation process. At this time, it is
+ only needed by Xen fullyvirtualized domains. <span class="since">Since 0.1.0</span></dd><dt><code>boot</code></dt><dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
+ "cdrom" or "network" and is used to specify the next boot device
+ to consider. The <code>boot</code> element can be repeated multiple
+ times to setup a priority list of boot devices to try in turn.
+ <span class="since">Since 0.1.3</span>
+ </dd></dl>
+ <h4>
+ <a name="elementsOSBootloader" id="elementsOSBootloader">Host bootloader</a>
+ </h4>
+ <p>
+ Hypervisors employing paravirtualization do not usually emulate
+ a BIOS, and instead the host is responsible to kicking off the
+ operating system boot. This may use a pseduo-bootloader in the
+ host to provide an interface to choose a kernel for the guest.
+ An example is <code>pygrub</code> with Xen.
+ </p>
+ <pre>
+ ...
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <bootloader_args>--append single</bootloader_args>
+ ...</pre>
+ <dl><dt><code>bootloader</code></dt><dd>The content of the <code>bootloader</code> element provides
+ a fullyqualified path to the bootloader executable in the
+ host OS. This bootloader will be run to choose which kernel
+ to boot. The required output of the bootloader is dependant
+ on the hypervisor in use. <span class="since">Since 0.1.0</span></dd><dt><code>bootloader_args</code></dt><dd>The optional <code>bootloader_args</code> element allows
+ command line arguments to be passed to the bootloader.
+ <span class="since">Since 0.2.3</span>
+ </dd></dl>
+ <h4>
+ <a name="elementsOSKernel" id="elementsOSKernel">Direct kernel boot</a>
+ </h4>
+ <p>
+ When installing a new guest OS it is often useful to boot directly
+ from a kernel and initrd stored in the host OS, allowing command
+ line arguments to be passed directly to the installer. This capability
+ is usually available for both para and full virtualized guests.
+ </p>
+ <pre>
+ ...
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <kernel>/root/f8-i386-vmlinuz</kernel>
+ <initrd>/root/f8-i386-initrd</initrd>
+ <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
+ </os>
+ ...</pre>
+ <dl><dt><code>type</code></dt><dd>This element has the same semantics as described earlier in the
+ <a href="#elementsOSBIOS">BIOS boot section</a></dd><dt><code>type</code></dt><dd>This element has the same semantics as described earlier in the
+ <a href="#elementsOSBIOS">BIOS boot section</a></dd><dt><code>kernel</code></dt><dd>The contents of this element specify the fully-qualified path
+ to the kernel image in the host OS.</dd><dt><code>initrd</code></dt><dd>The contents of this element specify the fully-qualified path
+ to the (optional) ramdisk image in the host OS.</dd><dt><code>cmdline</code></dt><dd>The contents of this element specify arguments to be passed to
+ the kernel (or installer) at boottime. This is often used to
+ specify an alternate primary console (eg serial port), or the
+ installation media source / kickstart file</dd></dl>
+ <h3>
+ <a name="elementsResources" id="elementsResources">Basic resources</a>
+ </h3>
+ <pre>
+ ...
+ <memory>524288</memory>
+ <currentMemory>524288</currentMemory>
+ <vcpu>1</vcpu>
+ ...</pre>
+ <dl><dt><code>memory</code></dt><dd>The maximum allocation of memory for the guest at boot time.
+ The units for this value are bytes</dd><dt><code>currentMemory</code></dt><dd>The actual allocation of memory for the guest. This value
+ be less than the maximum allocation, to allow for ballooning
+ up the guests memory on the fly. If this is omitted, it defaults
+ to the same value as the <code>memory<code> element</code></code></dd><dt><code>vcpu</code></dt><dd>The content of this element defines the number of virtual
+ CPUs allocated for the guest OS.</dd></dl>
+ <h3>
+ <a name="elementsLifecycle" id="elementsLifecycle">Lifecycle control</a>
+ </h3>
+ <p>
+ It is sometimes neccessary to override the default actions taken
+ when a guest OS triggers a lifecycle operation. The following
+ collections of elements allow the actions to be specified. A
+ common use case is to force a reboot to be treated as a poweroff
+ when doing the initial OS installation. This allows the VM to be
+ re-configured for the first post-install bootup.
+ </p>
+ <pre>
+ ...
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ ...</pre>
+ <dl><dt><code>on_poweroff</code></dt><dd>The content of this element specifies the action to take when
+ the guest requests a poweroff.</dd><dt><code>on_poweroff</code></dt><dd>The content of this element specifies the action to take when
+ the guest requests a reboot.</dd><dt><code>on_poweroff</code></dt><dd>The content of this element specifies the action to take when
+ the guest crashes.</dd></dl>
+ <p>
+ Each of these states allow for the same four possible actions.
+ </p>
+ <dl><dt><code>destroy</code></dt><dd>The domain will be terminated completely and all resources
+ released</dd><dt><code>restart</code></dt><dd>The domain will be terminated, and then restarted with
+ the same configuration</dd><dt><code>preserve</code></dt><dd>The domain will be terminated, and its resource preserved
+ to allow analysis.</dd><dt><code>rename-restart</code></dt><dd>The domain will be terminated, and then restarted with
+ a new name</dd></dl>
+ <h3>
+ <a name="elementsFeatures" id="elementsFeatures">Hypervisor features</a>
+ </h3>
+ <p>
+ Hypervisors may allow certain CPU / machine features to be
+ toggled on/off.
+ </p>
+ <pre>
+ ...
+ <features>
+ <pae/>
+ <acpi/>
+ <apic/>
+ </features>
+ ...</pre>
+ <p>
+ All features are listed within the <code>features</code>
+ element, omitting a togglable feature tag turns it off.
+ The available features can be found by asking
+ for the <a href="formatcaps.html">capabilities XML</a>,
+ but a common set for fully virtualized domains are:
+ </p>
+ <dl><dt><code>pae</code></dt><dd>Physical address extension mode allows 32-bit guests
+ to address more than 4 GB of memory.</dd><dt><code>acpi</code></dt><dd>ACPI is useful for power management, for example, with
+ KVM guests it is required for graceful shutdown to work.
+ </dd></dl>
+ <h3>
+ <a name="elementsTime" id="elementsTime">Time keeping</a>
+ </h3>
+ <p>
+ The guest clock is typically initialized from the host clock.
+ Most operating systems expect the hardware clock to be kept
+ in UTC, and this is the default. Windows, however, expects
+ it to be in so called 'localtime'.
+ </p>
+ <pre>
+ ...
+ <clock sync="localtime"/>
+ ...</pre>
+ <dl><dt><code>clock</code></dt><dd>The <code>sync</code> attribute takes either "utc" or
+ "localtime" to specify how the guest clock is initialized
+ in relation to the host OS.
+ </dd></dl>
+ <h3>
+ <a name="elementsDevices" id="elementsDevices">Devices</a>
+ </h3>
+ <p>
+ The final set of XML elements are all used to descibe devices
+ provided to the guest domain. All devices occur as children
+ of the main <code>devices</code> element.
+ <span class="since">Since 0.1.3</span>
+ </p>
+ <pre>
+ ...
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ ...</pre>
+ <dl><dt><code>emulator</code></dt><dd>
+ The contents of the <code>emulator</code> element specify
+ the fully qualified path to the device model emulator binary.
+ The <a href="formatcaps.html">capabilities XML</a> specifies
+ the recommended default emulator to use for each particular
+ domain type / architecture combination.
+ </dd></dl>
+ <h4>
+ <a name="elementsDisks" id="elementsDisks">Hard drives, floppy disks, CDROMs</a>
+ </h4>
+ <p>
+ Any device that looks like a disk, be it a floppy, harddisk,
+ cdrom, or paravirtualized driver is specified via the <code>disk</code>
+ element.
+ </p>
+ <pre>
+ ...
+ <disk type='file'>
+ <driver name="tap" type="aio">
+ <source file='/var/lib/xen/images/fv0'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ ...</pre>
+ <dl><dt><code>disk</code></dt><dd>The <code>disk</code> element is the main container for describing
+ disks. The <code>type</code> attribute is either "file" or "block"
+ and refers to the underlying source for the disk. The optional
+ <code>device</code> attribute indicates how the disk is to be exposed
+ to the guest OS. Possible values for this attribute are "floppy", "disk"
+ and "cdrom", defaulting to "disk".
+ <span class="since">Since 0.0.3; "device" attribute since 0.1.4</span></dd><dt><code>source</code></dt><dd>If the disk <code>type</code> is "file", then the <code>file</code> attribute
+ specifies the fully-qualified path to the file holding the disk. If the disk
+ <code>type</code> is "block", then the <code>dev</code> attribute specifies
+ the path to the host device to serve as the disk. <span class="since">Since 0.0.3</span></dd><dt><code>target</code></dt><dd>The <code>target</code> element controls the bus / device under which the
+ disk is exposed to the guest OS. The <code>dev</code> attribute indicates
+ the "logical" device name. The actual device name specified is not guarenteed to map to
+ the device name in the guest OS. Treat it as a device ordering hint.
+ The optional <code>bus</code> attribute specifies the type of disk device
+ to emulate; possible values are driver specific, with typical values being
+ "ide", "scsi", "virtio", "xen". If omitted, the bus type is inferred from
+ the style of the device name. eg, a device named 'sda' will typically be
+ exported using a SCSI bus.
+ <span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3</span></dd><dt><code>driver</code></dt><dd>If the hypervisor supports multiple backend drivers, then the optional
+ <code>driver</code> element allows them to be selected. The <code>name</code>
+ attribute is the primary backend driver name, while the optional <code>type</code>
+ attribute provides the sub-type. <span class="since">Since 0.1.8</span>
+ </dd></dl>
+ <h4>
+ <a name="elementsNICS" id="elementsNICS">Network interfaces</a>
+ </h4>
+ <pre>
+ ...
+ <interface type='bridge'>
+ <source bridge='xenbr0'/>
+ <mac address='00:16:3e:5d:c7:9e'/>
+ <script path='vif-bridge'/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSVirtual" id="elementsNICSVirtual">Virtual network</a>
+ </h5>
+ <p>
+ <strong><em>
+ This is the recommended config for general guest connectivity on
+ hosts with dynamic / wireless networking configs
+ </em></strong>
+ </p>
+ <p>
+ Provides a virtual network using a bridge device in the host.
+ Depending on the virtual network configuration, the network may be
+ totally isolated, NAT'ing to an explicit network device, or NAT'ing to
+ the default route. DHCP and DNS are provided on the virtual network in
+ all cases and the IP range can be determined by examining the virtual
+ network config with '<code>virsh net-dumpxml [networkname]</code>'.
+ There is one virtual network called 'default' setup out
+ of the box which does NAT'ing to the default route and has an IP range of
+ <code>192.168.22.0/255.255.255.0</code>. Each guest will have an
+ associated tun device created with a name of vnetN, which can also be
+ overridden with the <target> element.
+ </p>
+ <pre>
+ ...
+ <interface type='network'>
+ <source network='default'/>
+ </interface>
+ ...
+ <interface type='network'>
+ <source network='default'/>
+ <target dev='vnet7'/>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSBridge" id="elementsNICSBridge">Bridge to to LAN</a>
+ </h5>
+ <p>
+ <strong><em>
+ This is the recommended config for general guest connectivity on
+ hosts with static wired networking configs
+ </em></strong>
+ </p>
+ <p>
+ Provides a bridge from the VM directly onto the LAN. This assumes
+ there is a bridge device on the host which has one or more of the hosts
+ physical NICs enslaved. The guest VM will have an associated tun device
+ created with a name of vnetN, which can also be overridden with the
+ <target> element. The tun device will be enslaved to the bridge.
+ The IP range / network configuration is whatever is used on the LAN. This
+ provides the guest VM full incoming & outgoing net access just like a
+ physical machine.
+ </p>
+ <pre>
+ ...
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ </interface>
-<interface type='ethernet'>
- <target dev='vnet7'/>
- <script path='/etc/qemu-ifup-mynet'/>
-</interface></pre>
- </li><li>Multicast tunnel
- <p>A multicast group is setup to represent a virtual network. Any VMs
- whose network devices are in the same multicast group can talk to each
- other even across hosts. This mode is also available to unprivileged
- users. There is no default DNS or DHCP support and no outgoing network
- access. To provide outgoing network access, one of the VMs should have a
- 2nd NIC which is connected to one of the first 4 network types and do the
- appropriate routing. The multicast protocol is compatible with that used
- by user mode linux guests too. The source address used must be from the
- multicast address block.</p>
- <pre><interface type='mcast'>
- <source address='230.0.0.1' port='5558'/>
-</interface></pre>
- </li><li>TCP tunnel
- <p>A TCP client/server architecture provides a virtual network. One VM
- provides the server end of the network, all other VMS are configured as
- clients. All network traffic is routed between the VMs via the server.
- This mode is also available to unprivileged users. There is no default
- DNS or DHCP support and no outgoing network access. To provide outgoing
- network access, one of the VMs should have a 2nd NIC which is connected
- to one of the first 4 network types and do the appropriate routing.</p>
- <p>Example server config:</p>
- <pre><interface type='server'>
- <source address='192.168.0.1' port='5558'/>
-</interface></pre>
- <p>Example client config:</p>
- <pre><interface type='client'>
- <source address='192.168.0.1' port='5558'/>
-</interface></pre>
- </li></ol>
- <p>To be noted, options 2, 3, 4 are also supported by Xen VMs, so it is
-possible to use these configs to have networking with both Xen &
-QEMU/KVMs connected to each other.</p>
- <h2>Example configs</h2>
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ <target dev='vnet7'/>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSSlirp" id="elementsNICSSlirp">Userspace SLIRP stack</a>
+ </h5>
+ <p>
+ Provides a virtual LAN with NAT to the outside world. The virtual
+ network has DHCP & DNS services and will give the guest VM addresses
+ starting from <code>10.0.2.15</code>. The default router will be
+ <code>10.0.2.2</code> and the DNS server will be <code>10.0.2.3</code>.
+ This networking is the only option for unprivileged users who need their
+ VMs to have outgoing access.
+ </p>
+ <pre>
+ ...
+ <interface type='user'/>
+ ...
+ <interface type='user'>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSEthernet" id="elementsNICSEthernet">Generic ethernet connection</a>
+ </h5>
+ <p>
+ Provides a means for the administrator to execute an arbitrary script
+ to connect the guest's network to the LAN. The guest will have a tun
+ device created with a name of vnetN, which can also be overridden with the
+ <target> element. After creating the tun device a shell script will
+ be run which is expected to do whatever host network integration is
+ required. By default this script is called /etc/qemu-ifup but can be
+ overridden.
+ </p>
+ <pre>
+ ...
+ <interface type='ethernet'/>
+ ...
+ <interface type='ethernet'>
+ <target dev='vnet7'/>
+ <script path='/etc/qemu-ifup-mynet'/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSMulticast" id="elementsNICSMulticast">Multicast tunnel</a>
+ </h5>
+ <p>
+ A multicast group is setup to represent a virtual network. Any VMs
+ whose network devices are in the same multicast group can talk to each
+ other even across hosts. This mode is also available to unprivileged
+ users. There is no default DNS or DHCP support and no outgoing network
+ access. To provide outgoing network access, one of the VMs should have a
+ 2nd NIC which is connected to one of the first 4 network types and do the
+ appropriate routing. The multicast protocol is compatible with that used
+ by user mode linux guests too. The source address used must be from the
+ multicast address block.
+ </p>
+ <pre>
+ ...
+ <interface type='mcast'>
+ <source address='230.0.0.1' port='5558'/>
+ </interface>
+ ...</pre>
+ <h5>
+ <a name="elementsNICSTCP" id="elementsNICSTCP">TCP tunnel</a>
+ </h5>
+ <p>
+ A TCP client/server architecture provides a virtual network. One VM
+ provides the server end of the network, all other VMS are configured as
+ clients. All network traffic is routed between the VMs via the server.
+ This mode is also available to unprivileged users. There is no default
+ DNS or DHCP support and no outgoing network access. To provide outgoing
+ network access, one of the VMs should have a 2nd NIC which is connected
+ to one of the first 4 network types and do the appropriate routing.</p>
+ <pre>
+ ...
+ <interface type='server'>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ ...
+ <interface type='client'>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ ...</pre>
+ <h4>
+ <a name="elementsInput" id="elementsInput">Input devices</a>
+ </h4>
+ <p>
+ Input devices allow interaction with the graphical framebuffer in the guest
+ virtual machine. When enabling the framebuffer, an input device is automatically
+ provided. It may be possible to add additional devices explicitly, for example,
+ to provide a graphics tablet for absolute cursor movement.
+ </p>
+ <pre>
+ ...
+ <input type='mouse' bus='usb'/>
+ ...</pre>
+ <dl><dt><code>input</code></dt><dd>The <code>input</code> element has one madatory attribute, the <code>type</code>
+ whose value can be either 'mouse' or 'tablet'. The latter provides absolute
+ cursor movement, while the former uses relative movement. The optional
+ <code>bus</code> attribute can be used to refine the exact device type.
+ It takes values "xen" (paravirtualized), "ps2" and "usb".</dd></dl>
+ <h4>
+ <a name="elementsGraphics" id="elementsGraphics">Graphical framebuffers</a>
+ </h4>
+ <p>
+ A graphics device allows for graphical interaction with the
+ guest OS. A guest will typically have either a framebuffer
+ or a text console configured to allow interaction with the
+ admin.
+ </p>
+ <pre>
+ ...
+ <graphics type='vnc' port='5904'/>
+ ...</pre>
+ <dl><dt><code>graphics</code></dt><dd>The <code>graphics</code> element has a mandatory <code>type</code>
+ attribute which takes the value "sdl" or "vnc". The former displays
+ a window on the host desktop, while the latter activates a VNC server.
+ If the latter is used the <code>port</code> attributes specifies the
+ TCP port number (with -1 indicating that it should be auto-allocated).
+ The <code>listen</code> attribute is an IP address for the server to
+ listen on. The <code>password</code> attribute provides a VNC password
+ in clear text.</dd></dl>
+ <h4>
+ <a name="elementsConsole" id="elementsConsole">Consoles, serial & parallel devices</a>
+ </h4>
+ <p>
+ A character device provides a way to interact with the virtual machine.
+ Paravirtualized consoles, serial ports and parallel ports are all
+ classed as character devices and so represented using the same syntax.
+ </p>
+ <pre>
+ ...
+ <parallel type='pty'>
+ <source path='/dev/pts/2'/>
+ <target port='0'/>
+ </parallel>
+ <serial type='pty'>
+ <source path='/dev/pts/3'/>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <source path='/dev/pts/4'/>
+ <target port='0'/>
+ </console>
+ </devices>
+ </domain></pre>
+ <dl><dt><code>parallel</code></dt><dd>Represents a parallel port</dd><dt><code>serial</code></dt><dd>Represents a serial port</dd><dt><code>console</code></dt><dd>Represents the primary console. This can be the paravirtualized
+ console with Xen guests, or duplicates the primary serial port
+ for fully virtualized guests without a paravirtualized console.</dd><dt><code>source</code></dt><dd>The attributes available for the <code>source</code> element
+ vary according to the <code>type</code> attribute on the parent
+ tag. Allowed variations will be described below</dd><dt><code>target</code></dt><dd>The port number of the character device is specified via the
+ <code>port</code> attribute, numbered starting from 1. There is
+ usually only one console device, and 0, 1 or 2 serial devices
+ or parallel devices.
+ </dd></dl>
+ <h5>
+ <a name="elementsCharSTDIO" id="elementsCharSTDIO">Domain logfile</a>
+ </h5>
+ <p>
+ This disables all input on the character device, and sends output
+ into the virtual machine's logfile
+ </p>
+ <pre>
+ ...
+ <console type='stdio'>
+ <target port='1'>
+ </console>
+ ...</pre>
+ <h5>
+ <a name="elementsCharFle" id="elementsCharFle">Device logfile</a>
+ </h5>
+ <p>
+ A file is opened and all data sent to the character
+ device is written to the file.
+ </p>
+ <pre>
+ ...
+ <serial type="file">
+ <source path="/var/log/vm/vm-serial.log"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharVC" id="elementsCharVC">Virtual console</a>
+ </h5>
+ <p>
+ Connects the character device to the graphical framebuffer in
+ a virtual console. This is typically accessed via a special
+ hotkey sequence such as "ctrl+alt+3"
+ </p>
+ <pre>
+ ...
+ <serial type='vc'>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharNull" id="elementsCharNull">Null device</a>
+ </h5>
+ <p>
+ Connects the character device to the void. No data is ever
+ provided to the input. All data written is discarded.
+ </p>
+ <pre>
+ ...
+ <serial type='null'>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharPTY" id="elementsCharPTY">Pseudo TTY</a>
+ </h5>
+ <p>
+ A Pseudo TTY is allocated using /dev/ptmx. A suitable client
+ such as 'virsh console' can connect to interact with the
+ serial port locally.
+ </p>
+ <pre>
+ ...
+ <serial type="pty">
+ <source path="/dev/pts/3"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <p>
+ NB special case if <console type='pty'>, then the TTY
+ path is also duplicated as an attribute tty='/dv/pts/3'
+ on the top level <console> tag. This provides compat
+ with existing syntax for <console> tags.
+ </p>
+ <h5>
+ <a name="elementsCharHost" id="elementsCharHost">Host device proxy</a>
+ </h5>
+ <p>
+ The character device is passed through to the underlying
+ physical character device. The device types must match,
+ eg the emulated serial port should only be connected to
+ a host serial port - dont connect a serial port to a parallel
+ port.
+ </p>
+ <pre>
+ ...
+ <serial type="dev">
+ <source path="/dev/ttyS0"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharTCP" id="elementsCharTCP">TCP client/server</a>
+ </h5>
+ <p>
+ The character device acts as a TCP client connecting to a
+ remote server, or as a server waiting for a client connection.
+ </p>
+ <pre>
+ ...
+ <serial type="tcp">
+ <source mode="connect" host="0.0.0.0" service="2445"/>
+ <wiremode type="telnet"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharUDP" id="elementsCharUDP">UDP network console</a>
+ </h5>
+ <p>
+ The character device acts as a UDP netconsole service,
+ sending and receiving packets. This is a lossy service.
+ </p>
+ <pre>
+ ...
+ <serial type="udp">
+ <source mode="bind" host="0.0.0.0" service="2445"/>
+ <source mode="connect" host="0.0.0.0" service="2445"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharUNIX" id="elementsCharUNIX">UNIX domain socket client/server</a>
+ </h5>
+ <p>
+ The character device acts as a UNIX domain socket server,
+ accepting connections from local clients.
+ </p>
+ <pre>
+ ...
+ <serial type="unix">
+ <source mode="bind" path="/tmp/foo"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h2>
+ <a name="examples" id="examples">Example configs</a>
+ </h2>
<p>
Example configurations for each driver are provide on the
driver specific pages listed below
Index: formatdomain.html.in
===================================================================
RCS file: /data/cvs/libvirt/docs/formatdomain.html.in,v
retrieving revision 1.1
diff -u -p -r1.1 formatdomain.html.in
--- formatdomain.html.in 23 Apr 2008 17:08:31 -0000 1.1
+++ formatdomain.html.in 6 May 2008 23:56:34 -0000
@@ -2,245 +2,789 @@
<body>
<h1>Domain XML format</h1>
- <p>This section describes the XML format used to represent domains, there are
-variations on the format based on the kind of domains run and the options
-used to launch them:</p>
-
- <h3 id="Normal"><a name="Normal1" id="Normal1">Normal paravirtualized Xen
-guests</a>:</h3>
-
- <p>The root element must be called <code>domain</code> with no namespace, the
-<code>type</code> attribute indicates the kind of hypervisor used, 'xen' is
-the default value. The <code>id</code> attribute gives the domain id at
-runtime (not however that this may change, for example if the domain is saved
-to disk and restored). The domain has a few children whose order is not
-significant:</p>
- <ul>
- <li>name: the domain name, preferably ASCII based</li>
- <li>memory: the maximum memory allocated to the domain in kilobytes</li>
- <li>vcpu: the number of virtual cpu configured for the domain</li>
- <li>os: a block describing the Operating System, its content will be
- dependent on the OS type
- <ul><li>type: indicate the OS type, always linux at this point</li><li>kernel: path to the kernel on the Domain 0 filesystem</li><li>initrd: an optional path for the init ramdisk on the Domain 0
- filesystem</li><li>cmdline: optional command line to the kernel</li><li>root: the root filesystem from the guest viewpoint, it may be
- passed as part of the cmdline content too</li></ul></li>
- <li>devices: a list of <code>disk</code>, <code>interface</code> and
- <code>console</code> descriptions in no special order</li>
- </ul>
- <p>The format of the devices and their type may grow over time, but the
-following should be sufficient for basic use:</p>
- <p>A <code>disk</code> device indicates a block device, it can have two
-values for the type attribute either 'file' or 'block' corresponding to the 2
-options available at the Xen layer. It has two mandatory children, and one
-optional one in no specific order:</p>
- <ul>
- <li>source with a file attribute containing the path in Domain 0 to the
- file or a dev attribute if using a block device, containing the device
- name ('hda5' or '/dev/hda5')</li>
- <li>target indicates in a dev attribute the device where it is mapped in
- the guest</li>
- <li>readonly an optional empty element indicating the device is
- read-only</li>
- <li>shareable an optional empty element indicating the device
- can be used read/write with other domains</li>
- </ul>
- <p>An <code>interface</code> element describes a network device mapped on the
-guest, it also has a type whose value is currently 'bridge', it also have a
-number of children in no specific order:</p>
- <ul>
- <li>source: indicating the bridge name</li>
- <li>mac: the optional mac address provided in the address attribute</li>
- <li>ip: the optional IP address provided in the address attribute</li>
- <li>script: the script used to bridge the interface in the Domain 0</li>
- <li>target: and optional target indicating the device name.</li>
- </ul>
- <p>A <code>console</code> element describes a serial console connection to
-the guest. It has no children, and a single attribute <code>tty</code> which
-provides the path to the Pseudo TTY on which the guest console can be
-accessed</p>
- <p>Life cycle actions for the domain can also be expressed in the XML format,
-they drive what should be happening if the domain crashes, is rebooted or is
-poweroff. There is various actions possible when this happen:</p>
- <ul>
- <li>destroy: The domain is cleaned up (that's the default normal processing
- in Xen)</li>
- <li>restart: A new domain is started in place of the old one with the same
- configuration parameters</li>
- <li>preserve: The domain will remain in memory until it is destroyed
- manually, it won't be running but allows for post-mortem debugging</li>
- <li>rename-restart: a variant of the previous one but where the old domain
- is renamed before being saved to allow a restart</li>
- </ul>
- <p>The following could be used for a Xen production system:</p>
- <pre><domain>
- ...
- <on_reboot>restart</on_reboot>
- <on_poweroff>destroy</on_poweroff>
- <on_crash>rename-restart</on_crash>
- ...
-</domain></pre>
- <p>While the format may be extended in various ways as support for more
-hypervisor types and features are added, it is expected that this core subset
-will remain functional in spite of the evolution of the library.</p>
+ <ul id="toc"></ul>
- <h3 id="Fully"><a name="Fully1" id="Fully1">Fully virtualized guests</a></h3>
- <p>There is a few things to notice specifically for HVM domains:</p>
- <ul>
- <li>the optional <code><features></code> block is used to enable
- certain guest CPU / system features. For HVM guests the following
- features are defined:
- <ul><li><code>pae</code> - enable PAE memory addressing</li><li><code>apic</code> - enable IO APIC</li><li><code>acpi</code> - enable ACPI bios</li></ul></li>
- <li>the optional <code><clock></code> element is used to specify
- whether the emulated BIOS clock in the guest is synced to either
- <code>localtime</code> or <code>utc</code>. In general Windows will
- want <code>localtime</code> while all other operating systems will
- want <code>utc</code>. The default is thus <code>utc</code></li>
- <li>the <code><os></code> block description is very different, first
- it indicates that the type is 'hvm' for hardware virtualization, then
- instead of a kernel, boot and command line arguments, it points to an os
- boot loader which will extract the boot information from the boot device
- specified in a separate boot element. The <code>dev</code> attribute on
- the <code>boot</code> tag can be one of:
- <ul><li><code>fd</code> - boot from first floppy device</li><li><code>hd</code> - boot from first harddisk device</li><li><code>cdrom</code> - boot from first cdrom device</li></ul></li>
- <li>the <code><devices></code> section includes an emulator entry
- pointing to an additional program in charge of emulating the devices</li>
- <li>the disk entry indicates in the dev target section that the emulation
- for the drive is the first IDE disk device hda. The list of device names
- supported is dependent on the Hypervisor, but for Xen it can be any IDE
- device <code>hda</code>-<code>hdd</code>, or a floppy device
- <code>fda</code>, <code>fdb</code>. The <code><disk></code> element
- also supports a 'device' attribute to indicate what kinda of hardware to
- emulate. The following values are supported:
- <ul><li><code>floppy</code> - a floppy disk controller</li><li><code>disk</code> - a generic hard drive (the default it
- omitted)</li><li><code>cdrom</code> - a CDROM device</li></ul>
- For Xen 3.0.2 and earlier a CDROM device can only be emulated on the
- <code>hdc</code> channel, while for 3.0.3 and later, it can be emulated
- on any IDE channel.</li>
- <li>the <code><devices></code> section also include at least one
- entry for the graphic device used to render the os. Currently there is
- just 2 types possible 'vnc' or 'sdl'. If the type is 'vnc', then an
- additional <code>port</code> attribute will be present indicating the TCP
- port on which the VNC server is accepting client connections.</li>
- </ul>
- <p>It is likely that the HVM description gets additional optional elements
-and attributes as the support for fully virtualized domain expands,
-especially for the variety of devices emulated and the graphic support
-options offered.</p>
-
- <h3>
- <a name="Net1" id="Net1">Networking interface options</a>
- </h3>
- <p>The networking support in the QEmu and KVM case is more flexible, and
-support a variety of options:</p>
- <ol>
- <li>Userspace SLIRP stack
- <p>Provides a virtual LAN with NAT to the outside world. The virtual
- network has DHCP & DNS services and will give the guest VM addresses
- starting from <code>10.0.2.15</code>. The default router will be
- <code>10.0.2.2</code> and the DNS server will be <code>10.0.2.3</code>.
- This networking is the only option for unprivileged users who need their
- VMs to have outgoing access. Example configs are:</p>
- <pre><interface type='user'/></pre>
- <pre>
-<interface type='user'>
- <mac address="11:22:33:44:55:66"/>
-</interface>
- </pre>
- </li>
- <li>Virtual network
- <p>Provides a virtual network using a bridge device in the host.
- Depending on the virtual network configuration, the network may be
- totally isolated, NAT'ing to an explicit network device, or NAT'ing to
- the default route. DHCP and DNS are provided on the virtual network in
- all cases and the IP range can be determined by examining the virtual
- network config with '<code>virsh net-dumpxml <network
- name></code>'. There is one virtual network called 'default' setup out
- of the box which does NAT'ing to the default route and has an IP range of
- <code>192.168.22.0/255.255.255.0</code>. Each guest will have an
- associated tun device created with a name of vnetN, which can also be
- overridden with the <target> element. Example configs are:</p>
- <pre><interface type='network'>
- <source network='default'/>
-</interface>
-
-<interface type='network'>
- <source network='default'/>
- <target dev='vnet7'/>
- <mac address="11:22:33:44:55:66"/>
-</interface>
- </pre>
- </li>
- <li>Bridge to to LAN
- <p>Provides a bridge from the VM directly onto the LAN. This assumes
- there is a bridge device on the host which has one or more of the hosts
- physical NICs enslaved. The guest VM will have an associated tun device
- created with a name of vnetN, which can also be overridden with the
- <target> element. The tun device will be enslaved to the bridge.
- The IP range / network configuration is whatever is used on the LAN. This
- provides the guest VM full incoming & outgoing net access just like a
- physical machine. Examples include:</p>
- <pre><interface type='bridge'>
- <source bridge='br0'/>
-</interface>
-
-<interface type='bridge'>
- <source bridge='br0'/>
- <target dev='vnet7'/>
- <mac address="11:22:33:44:55:66"/>
-</interface></pre>
- </li>
- <li>Generic connection to LAN
- <p>Provides a means for the administrator to execute an arbitrary script
- to connect the guest's network to the LAN. The guest will have a tun
- device created with a name of vnetN, which can also be overridden with the
- <target> element. After creating the tun device a shell script will
- be run which is expected to do whatever host network integration is
- required. By default this script is called /etc/qemu-ifup but can be
- overridden.</p>
- <pre><interface type='ethernet'/>
-
-<interface type='ethernet'>
- <target dev='vnet7'/>
- <script path='/etc/qemu-ifup-mynet'/>
-</interface></pre>
- </li>
- <li>Multicast tunnel
- <p>A multicast group is setup to represent a virtual network. Any VMs
- whose network devices are in the same multicast group can talk to each
- other even across hosts. This mode is also available to unprivileged
- users. There is no default DNS or DHCP support and no outgoing network
- access. To provide outgoing network access, one of the VMs should have a
- 2nd NIC which is connected to one of the first 4 network types and do the
- appropriate routing. The multicast protocol is compatible with that used
- by user mode linux guests too. The source address used must be from the
- multicast address block.</p>
- <pre><interface type='mcast'>
- <source address='230.0.0.1' port='5558'/>
-</interface></pre>
- </li>
- <li>TCP tunnel
- <p>A TCP client/server architecture provides a virtual network. One VM
- provides the server end of the network, all other VMS are configured as
- clients. All network traffic is routed between the VMs via the server.
- This mode is also available to unprivileged users. There is no default
- DNS or DHCP support and no outgoing network access. To provide outgoing
- network access, one of the VMs should have a 2nd NIC which is connected
- to one of the first 4 network types and do the appropriate routing.</p>
- <p>Example server config:</p>
- <pre><interface type='server'>
- <source address='192.168.0.1' port='5558'/>
-</interface></pre>
- <p>Example client config:</p>
- <pre><interface type='client'>
- <source address='192.168.0.1' port='5558'/>
-</interface></pre>
- </li>
- </ol>
- <p>To be noted, options 2, 3, 4 are also supported by Xen VMs, so it is
-possible to use these configs to have networking with both Xen &
-QEMU/KVMs connected to each other.</p>
+ <p>
+ This section describes the XML format used to represent domains, there are
+ variations on the format based on the kind of domains run and the options
+ used to launch them. For hypervisor specific details consult the
+ <a href="drivers.html">driver docs</a>
+ </p>
+
+
+ <h2><a name="elements">Element and attribute overview</a></h2>
+
+ <p>
+ The root element required for all virtual machines is
+ named <code>domain</code>. It has two attributes, the
+ <code>type</code> specifies the hypervisor used for running
+ the domain. The allowed values are driver specific, but
+ include "xen", "kvm", "qemu", "lxc" and "kqemu". The
+ second attribute is <code>id</code> which is a unique
+ integer identifier for the running guest machine. Inactive
+ machines have no id value.
+ </p>
+
+
+ <h3><a name="elementsMetadata">General metadata</a></h3>
+
+ <pre>
+ <domain type='xen' id='3'>
+ <name>fv0</name>
+ <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
+ ...</pre>
+
+ <dl>
+ <dt><code>name</code></dt>
+ <dd>The content of the <code>name</code> element provides
+ a short name for the virtual machine. This name should
+ consist only of alpha-numeric characters and is required
+ to be unique within the scope of a single host. It is
+ often used to form the filename for storing the persistent
+ configuration file. <span class="since">Since 0.0.1</span></dd>
+ <dt><code>uuid</code></dt>
+ <dd>The content of the <code>uuid</code> element provides
+ a globally unique identifier for the virtual machine.
+ The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
+ If omitted when defining/creating a new machine, a random
+ UUID is generated. <span class="since">Since 0.0.1</span></dd>
+ </dl>
+
+ <h3><a name="elementsOS">Operating system booting</a></h3>
+
+ <p>
+ There are a number of different ways to boot virtual machines
+ each with their own pros and cons.
+ </p>
+
+ <h4><a name="elementsOSBIOS">BIOS bootloader</a></h4>
+
+ <p>
+ Booting via the BIOS is available for hypervisors supporting
+ full virtualization. In this case the BIOS has a boot order
+ priority (floppy, harddisk, cdrom, network) determining where
+ to obtain/find the boot image.
+ </p>
+
+ <pre>
+ ...
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='hd'/>
+ </os>
+ ...</pre>
+
+ <dl>
+ <dt><code>type</code></dt>
+ <dd>The content of the <code>type</code> element specifies the
+ type of operating system to be booted in the virtual machine.
+ <code>hvm</code> indicates that the OS is one designed to run
+ on bare metal, so requires full virtualization. <code>linux</code>
+ (badly named!) refers to an OS that supports the Xen 3 hypervisor
+ guest ABI. There are also two optional attributes, <code>arch</code>
+ specifying the CPU architecture to virtualization, and <code>machine</code>
+ refering to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
+ provides details on allowed values for these. <span class="since">Since 0.0.1</span></dd>
+ <dt><code>loader</code></dt>
+ <dd>The optional <code>loader</code> tag refers to a firmware blob
+ used to assist the domain creation process. At this time, it is
+ only needed by Xen fullyvirtualized domains. <span class="since">Since 0.1.0</span></dd>
+ <dt><code>boot</code></dt>
+ <dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
+ "cdrom" or "network" and is used to specify the next boot device
+ to consider. The <code>boot</code> element can be repeated multiple
+ times to setup a priority list of boot devices to try in turn.
+ <span class="since">Since 0.1.3</span>
+ </dd>
+ </dl>
+
+ <h4><a name="elementsOSBootloader">Host bootloader</a></h4>
+
+ <p>
+ Hypervisors employing paravirtualization do not usually emulate
+ a BIOS, and instead the host is responsible to kicking off the
+ operating system boot. This may use a pseduo-bootloader in the
+ host to provide an interface to choose a kernel for the guest.
+ An example is <code>pygrub</code> with Xen.
+ </p>
+
+ <pre>
+ ...
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <bootloader_args>--append single</bootloader_args>
+ ...</pre>
+
+ <dl>
+ <dt><code>bootloader</code></dt>
+ <dd>The content of the <code>bootloader</code> element provides
+ a fullyqualified path to the bootloader executable in the
+ host OS. This bootloader will be run to choose which kernel
+ to boot. The required output of the bootloader is dependant
+ on the hypervisor in use. <span class="since">Since 0.1.0</span></dd>
+ <dt><code>bootloader_args</code></dt>
+ <dd>The optional <code>bootloader_args</code> element allows
+ command line arguments to be passed to the bootloader.
+ <span class="since">Since 0.2.3</span>
+ </dd>
+
+ </dl>
+
+ <h4><a name="elementsOSKernel">Direct kernel boot</a></h4>
+
+ <p>
+ When installing a new guest OS it is often useful to boot directly
+ from a kernel and initrd stored in the host OS, allowing command
+ line arguments to be passed directly to the installer. This capability
+ is usually available for both para and full virtualized guests.
+ </p>
+
+ <pre>
+ ...
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <kernel>/root/f8-i386-vmlinuz</kernel>
+ <initrd>/root/f8-i386-initrd</initrd>
+ <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
+ </os>
+ ...</pre>
+
+ <dl>
+ <dt><code>type</code></dt>
+ <dd>This element has the same semantics as described earlier in the
+ <a href="#elementsOSBIOS">BIOS boot section</a></dd>
+ <dt><code>type</code></dt>
+ <dd>This element has the same semantics as described earlier in the
+ <a href="#elementsOSBIOS">BIOS boot section</a></dd>
+ <dt><code>kernel</code></dt>
+ <dd>The contents of this element specify the fully-qualified path
+ to the kernel image in the host OS.</dd>
+ <dt><code>initrd</code></dt>
+ <dd>The contents of this element specify the fully-qualified path
+ to the (optional) ramdisk image in the host OS.</dd>
+ <dt><code>cmdline</code></dt>
+ <dd>The contents of this element specify arguments to be passed to
+ the kernel (or installer) at boottime. This is often used to
+ specify an alternate primary console (eg serial port), or the
+ installation media source / kickstart file</dd>
+ </dl>
+
+ <h3><a name="elementsResources">Basic resources</a></h3>
+
+ <pre>
+ ...
+ <memory>524288</memory>
+ <currentMemory>524288</currentMemory>
+ <vcpu>1</vcpu>
+ ...</pre>
+
+ <dl>
+ <dt><code>memory</code></dt>
+ <dd>The maximum allocation of memory for the guest at boot time.
+ The units for this value are bytes</dd>
+ <dt><code>currentMemory</code></dt>
+ <dd>The actual allocation of memory for the guest. This value
+ be less than the maximum allocation, to allow for ballooning
+ up the guests memory on the fly. If this is omitted, it defaults
+ to the same value as the <code>memory<code> element</dd>
+ <dt><code>vcpu</code></dt>
+ <dd>The content of this element defines the number of virtual
+ CPUs allocated for the guest OS.</dd>
+ </dl>
+
+ <h3><a name="elementsLifecycle">Lifecycle control</a></h3>
+
+ <p>
+ It is sometimes neccessary to override the default actions taken
+ when a guest OS triggers a lifecycle operation. The following
+ collections of elements allow the actions to be specified. A
+ common use case is to force a reboot to be treated as a poweroff
+ when doing the initial OS installation. This allows the VM to be
+ re-configured for the first post-install bootup.
+ </p>
+
+ <pre>
+ ...
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ ...</pre>
+
+ <dl>
+ <dt><code>on_poweroff</code></dt>
+ <dd>The content of this element specifies the action to take when
+ the guest requests a poweroff.</dd>
+ <dt><code>on_poweroff</code></dt>
+ <dd>The content of this element specifies the action to take when
+ the guest requests a reboot.</dd>
+ <dt><code>on_poweroff</code></dt>
+ <dd>The content of this element specifies the action to take when
+ the guest crashes.</dd>
+ </dl>
+
+ <p>
+ Each of these states allow for the same four possible actions.
+ </p>
+
+ <dl>
+ <dt><code>destroy</code></dt>
+ <dd>The domain will be terminated completely and all resources
+ released</dd>
+ <dt><code>restart</code></dt>
+ <dd>The domain will be terminated, and then restarted with
+ the same configuration</dd>
+ <dt><code>preserve</code></dt>
+ <dd>The domain will be terminated, and its resource preserved
+ to allow analysis.</dd>
+ <dt><code>rename-restart</code></dt>
+ <dd>The domain will be terminated, and then restarted with
+ a new name</dd>
+ </dl>
+
+ <h3><a name="elementsFeatures">Hypervisor features</a></h3>
+
+ <p>
+ Hypervisors may allow certain CPU / machine features to be
+ toggled on/off.
+ </p>
+
+ <pre>
+ ...
+ <features>
+ <pae/>
+ <acpi/>
+ <apic/>
+ </features>
+ ...</pre>
+
+ <p>
+ All features are listed within the <code>features</code>
+ element, omitting a togglable feature tag turns it off.
+ The available features can be found by asking
+ for the <a href="formatcaps.html">capabilities XML</a>,
+ but a common set for fully virtualized domains are:
+ </p>
+
+ <dl>
+ <dt><code>pae</code></dt>
+ <dd>Physical address extension mode allows 32-bit guests
+ to address more than 4 GB of memory.</dd>
+ <dt><code>acpi</code></dt>
+ <dd>ACPI is useful for power management, for example, with
+ KVM guests it is required for graceful shutdown to work.
+ </dd>
+ </dl>
+
+ <h3><a name="elementsTime">Time keeping</a></h3>
+
+ <p>
+ The guest clock is typically initialized from the host clock.
+ Most operating systems expect the hardware clock to be kept
+ in UTC, and this is the default. Windows, however, expects
+ it to be in so called 'localtime'.
+ </p>
+
+ <pre>
+ ...
+ <clock sync="localtime"/>
+ ...</pre>
+
+ <dl>
+ <dt><code>clock</code></dt>
+ <dd>The <code>sync</code> attribute takes either "utc" or
+ "localtime" to specify how the guest clock is initialized
+ in relation to the host OS.
+ </dd>
+ </dl>
+
+ <h3><a name="elementsDevices">Devices</a></h3>
+
+ <p>
+ The final set of XML elements are all used to descibe devices
+ provided to the guest domain. All devices occur as children
+ of the main <code>devices</code> element.
+ <span class="since">Since 0.1.3</span>
+ </p>
+
+ <pre>
+ ...
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ ...</pre>
+
+ <dl>
+ <dt><code>emulator</code></dt>
+ <dd>
+ The contents of the <code>emulator</code> element specify
+ the fully qualified path to the device model emulator binary.
+ The <a href="formatcaps.html">capabilities XML</a> specifies
+ the recommended default emulator to use for each particular
+ domain type / architecture combination.
+ </dd>
+ </dl>
+
+ <h4><a name="elementsDisks">Hard drives, floppy disks, CDROMs</a></h4>
+
+ <p>
+ Any device that looks like a disk, be it a floppy, harddisk,
+ cdrom, or paravirtualized driver is specified via the <code>disk</code>
+ element.
+ </p>
+
+ <pre>
+ ...
+ <disk type='file'>
+ <driver name="tap" type="aio">
+ <source file='/var/lib/xen/images/fv0'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ ...</pre>
+
+ <dl>
+ <dt><code>disk</code></dt>
+ <dd>The <code>disk</code> element is the main container for describing
+ disks. The <code>type</code> attribute is either "file" or "block"
+ and refers to the underlying source for the disk. The optional
+ <code>device</code> attribute indicates how the disk is to be exposed
+ to the guest OS. Possible values for this attribute are "floppy", "disk"
+ and "cdrom", defaulting to "disk".
+ <span class="since">Since 0.0.3; "device" attribute since 0.1.4</span></dd>
+ <dt><code>source</code></dt>
+ <dd>If the disk <code>type</code> is "file", then the <code>file</code> attribute
+ specifies the fully-qualified path to the file holding the disk. If the disk
+ <code>type</code> is "block", then the <code>dev</code> attribute specifies
+ the path to the host device to serve as the disk. <span class="since">Since 0.0.3</span></dd>
+ <dt><code>target</code></dt>
+ <dd>The <code>target</code> element controls the bus / device under which the
+ disk is exposed to the guest OS. The <code>dev</code> attribute indicates
+ the "logical" device name. The actual device name specified is not guarenteed to map to
+ the device name in the guest OS. Treat it as a device ordering hint.
+ The optional <code>bus</code> attribute specifies the type of disk device
+ to emulate; possible values are driver specific, with typical values being
+ "ide", "scsi", "virtio", "xen". If omitted, the bus type is inferred from
+ the style of the device name. eg, a device named 'sda' will typically be
+ exported using a SCSI bus.
+ <span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3</span></dd>
+ <dt><code>driver</code></dt>
+ <dd>If the hypervisor supports multiple backend drivers, then the optional
+ <code>driver</code> element allows them to be selected. The <code>name</code>
+ attribute is the primary backend driver name, while the optional <code>type</code>
+ attribute provides the sub-type. <span class="since">Since 0.1.8</span>
+ </dd>
+ </dl>
+
+ <h4><a name="elementsNICS">Network interfaces</a></h4>
+
+ <pre>
+ ...
+ <interface type='bridge'>
+ <source bridge='xenbr0'/>
+ <mac address='00:16:3e:5d:c7:9e'/>
+ <script path='vif-bridge'/>
+ </interface>
+ ...</pre>
+
+ <h5><a name="elementsNICSVirtual">Virtual network</a></h5>
+
+ <p>
+ <strong><em>
+ This is the recommended config for general guest connectivity on
+ hosts with dynamic / wireless networking configs
+ </em></strong>
+ </p>
+
+ <p>
+ Provides a virtual network using a bridge device in the host.
+ Depending on the virtual network configuration, the network may be
+ totally isolated, NAT'ing to an explicit network device, or NAT'ing to
+ the default route. DHCP and DNS are provided on the virtual network in
+ all cases and the IP range can be determined by examining the virtual
+ network config with '<code>virsh net-dumpxml [networkname]</code>'.
+ There is one virtual network called 'default' setup out
+ of the box which does NAT'ing to the default route and has an IP range of
+ <code>192.168.22.0/255.255.255.0</code>. Each guest will have an
+ associated tun device created with a name of vnetN, which can also be
+ overridden with the <target> element.
+ </p>
+
+ <pre>
+ ...
+ <interface type='network'>
+ <source network='default'/>
+ </interface>
+ ...
+ <interface type='network'>
+ <source network='default'/>
+ <target dev='vnet7'/>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+
+ <h5><a name="elementsNICSBridge">Bridge to to LAN</a></h5>
+
+ <p>
+ <strong><em>
+ This is the recommended config for general guest connectivity on
+ hosts with static wired networking configs
+ </em></strong>
+ </p>
+
+ <p>
+ Provides a bridge from the VM directly onto the LAN. This assumes
+ there is a bridge device on the host which has one or more of the hosts
+ physical NICs enslaved. The guest VM will have an associated tun device
+ created with a name of vnetN, which can also be overridden with the
+ <target> element. The tun device will be enslaved to the bridge.
+ The IP range / network configuration is whatever is used on the LAN. This
+ provides the guest VM full incoming & outgoing net access just like a
+ physical machine.
+ </p>
+
+ <pre>
+ ...
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ </interface>
+
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ <target dev='vnet7'/>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+
+ <h5><a name="elementsNICSSlirp">Userspace SLIRP stack</a></h5>
+
+ <p>
+ Provides a virtual LAN with NAT to the outside world. The virtual
+ network has DHCP & DNS services and will give the guest VM addresses
+ starting from <code>10.0.2.15</code>. The default router will be
+ <code>10.0.2.2</code> and the DNS server will be <code>10.0.2.3</code>.
+ This networking is the only option for unprivileged users who need their
+ VMs to have outgoing access.
+ </p>
+
+ <pre>
+ ...
+ <interface type='user'/>
+ ...
+ <interface type='user'>
+ <mac address="11:22:33:44:55:66"/>
+ </interface>
+ ...</pre>
+
+
+ <h5><a name="elementsNICSEthernet">Generic ethernet connection</a></h5>
+
+ <p>
+ Provides a means for the administrator to execute an arbitrary script
+ to connect the guest's network to the LAN. The guest will have a tun
+ device created with a name of vnetN, which can also be overridden with the
+ <target> element. After creating the tun device a shell script will
+ be run which is expected to do whatever host network integration is
+ required. By default this script is called /etc/qemu-ifup but can be
+ overridden.
+ </p>
+
+ <pre>
+ ...
+ <interface type='ethernet'/>
+ ...
+ <interface type='ethernet'>
+ <target dev='vnet7'/>
+ <script path='/etc/qemu-ifup-mynet'/>
+ </interface>
+ ...</pre>
+
+ <h5><a name="elementsNICSMulticast">Multicast tunnel</a></h5>
+
+ <p>
+ A multicast group is setup to represent a virtual network. Any VMs
+ whose network devices are in the same multicast group can talk to each
+ other even across hosts. This mode is also available to unprivileged
+ users. There is no default DNS or DHCP support and no outgoing network
+ access. To provide outgoing network access, one of the VMs should have a
+ 2nd NIC which is connected to one of the first 4 network types and do the
+ appropriate routing. The multicast protocol is compatible with that used
+ by user mode linux guests too. The source address used must be from the
+ multicast address block.
+ </p>
+
+ <pre>
+ ...
+ <interface type='mcast'>
+ <source address='230.0.0.1' port='5558'/>
+ </interface>
+ ...</pre>
+
+ <h5><a name="elementsNICSTCP">TCP tunnel</a></h5>
+
+ <p>
+ A TCP client/server architecture provides a virtual network. One VM
+ provides the server end of the network, all other VMS are configured as
+ clients. All network traffic is routed between the VMs via the server.
+ This mode is also available to unprivileged users. There is no default
+ DNS or DHCP support and no outgoing network access. To provide outgoing
+ network access, one of the VMs should have a 2nd NIC which is connected
+ to one of the first 4 network types and do the appropriate routing.</p>
+
+ <pre>
+ ...
+ <interface type='server'>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ ...
+ <interface type='client'>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ ...</pre>
+
+
+ <h4><a name="elementsInput">Input devices</a></h4>
+
+ <p>
+ Input devices allow interaction with the graphical framebuffer in the guest
+ virtual machine. When enabling the framebuffer, an input device is automatically
+ provided. It may be possible to add additional devices explicitly, for example,
+ to provide a graphics tablet for absolute cursor movement.
+ </p>
+
+ <pre>
+ ...
+ <input type='mouse' bus='usb'/>
+ ...</pre>
+
+ <dl>
+ <dt><code>input</code></dt>
+ <dd>The <code>input</code> element has one madatory attribute, the <code>type</code>
+ whose value can be either 'mouse' or 'tablet'. The latter provides absolute
+ cursor movement, while the former uses relative movement. The optional
+ <code>bus</code> attribute can be used to refine the exact device type.
+ It takes values "xen" (paravirtualized), "ps2" and "usb".</dd>
+ </dl>
+
+
+ <h4><a name="elementsGraphics">Graphical framebuffers</a></h4>
+
+ <p>
+ A graphics device allows for graphical interaction with the
+ guest OS. A guest will typically have either a framebuffer
+ or a text console configured to allow interaction with the
+ admin.
+ </p>
+
+ <pre>
+ ...
+ <graphics type='vnc' port='5904'/>
+ ...</pre>
+
+ <dl>
+ <dt><code>graphics</code></dt>
+ <dd>The <code>graphics</code> element has a mandatory <code>type</code>
+ attribute which takes the value "sdl" or "vnc". The former displays
+ a window on the host desktop, while the latter activates a VNC server.
+ If the latter is used the <code>port</code> attributes specifies the
+ TCP port number (with -1 indicating that it should be auto-allocated).
+ The <code>listen</code> attribute is an IP address for the server to
+ listen on. The <code>password</code> attribute provides a VNC password
+ in clear text.</dd>
+ </dl>
+
+ <h4><a name="elementsConsole">Consoles, serial & parallel devices</a></h4>
+
+ <p>
+ A character device provides a way to interact with the virtual machine.
+ Paravirtualized consoles, serial ports and parallel ports are all
+ classed as character devices and so represented using the same syntax.
+ </p>
+
+ <pre>
+ ...
+ <parallel type='pty'>
+ <source path='/dev/pts/2'/>
+ <target port='0'/>
+ </parallel>
+ <serial type='pty'>
+ <source path='/dev/pts/3'/>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <source path='/dev/pts/4'/>
+ <target port='0'/>
+ </console>
+ </devices>
+ </domain></pre>
+
+
+ <dl>
+ <dt><code>parallel</code></dt>
+ <dd>Represents a parallel port</dd>
+ <dt><code>serial</code></dt>
+ <dd>Represents a serial port</dd>
+ <dt><code>console</code></dt>
+ <dd>Represents the primary console. This can be the paravirtualized
+ console with Xen guests, or duplicates the primary serial port
+ for fully virtualized guests without a paravirtualized console.</dd>
+ <dt><code>source</code></dt>
+ <dd>The attributes available for the <code>source</code> element
+ vary according to the <code>type</code> attribute on the parent
+ tag. Allowed variations will be described below</dd>
+ <dt><code>target</code></dt>
+ <dd>The port number of the character device is specified via the
+ <code>port</code> attribute, numbered starting from 1. There is
+ usually only one console device, and 0, 1 or 2 serial devices
+ or parallel devices.
+ </dl>
+
+ <h5><a name="elementsCharSTDIO">Domain logfile</a></h5>
+
+ <p>
+ This disables all input on the character device, and sends output
+ into the virtual machine's logfile
+ </p>
+
+ <pre>
+ ...
+ <console type='stdio'>
+ <target port='1'>
+ </console>
+ ...</pre>
+
+
+ <h5><a name="elementsCharFle">Device logfile</a></h5>
+
+ <p>
+ A file is opened and all data sent to the character
+ device is written to the file.
+ </p>
+
+ <pre>
+ ...
+ <serial type="file">
+ <source path="/var/log/vm/vm-serial.log"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharVC">Virtual console</a></h5>
+
+ <p>
+ Connects the character device to the graphical framebuffer in
+ a virtual console. This is typically accessed via a special
+ hotkey sequence such as "ctrl+alt+3"
+ </p>
+
+ <pre>
+ ...
+ <serial type='vc'>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharNull">Null device</a></h5>
+
+ <p>
+ Connects the character device to the void. No data is ever
+ provided to the input. All data written is discarded.
+ </p>
+
+ <pre>
+ ...
+ <serial type='null'>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharPTY">Pseudo TTY</a></h5>
+
+ <p>
+ A Pseudo TTY is allocated using /dev/ptmx. A suitable client
+ such as 'virsh console' can connect to interact with the
+ serial port locally.
+ </p>
+
+ <pre>
+ ...
+ <serial type="pty">
+ <source path="/dev/pts/3"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <p>
+ NB special case if <console type='pty'>, then the TTY
+ path is also duplicated as an attribute tty='/dv/pts/3'
+ on the top level <console> tag. This provides compat
+ with existing syntax for <console> tags.
+ </p>
+
+ <h5><a name="elementsCharHost">Host device proxy</a></h5>
+
+ <p>
+ The character device is passed through to the underlying
+ physical character device. The device types must match,
+ eg the emulated serial port should only be connected to
+ a host serial port - dont connect a serial port to a parallel
+ port.
+ </p>
+
+ <pre>
+ ...
+ <serial type="dev">
+ <source path="/dev/ttyS0"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharTCP">TCP client/server</a></h5>
+
+ <p>
+ The character device acts as a TCP client connecting to a
+ remote server, or as a server waiting for a client connection.
+ </p>
+
+ <pre>
+ ...
+ <serial type="tcp">
+ <source mode="connect" host="0.0.0.0" service="2445"/>
+ <wiremode type="telnet"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharUDP">UDP network console</a></h5>
+
+ <p>
+ The character device acts as a UDP netconsole service,
+ sending and receiving packets. This is a lossy service.
+ </p>
+
+ <pre>
+ ...
+ <serial type="udp">
+ <source mode="bind" host="0.0.0.0" service="2445"/>
+ <source mode="connect" host="0.0.0.0" service="2445"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
+ <h5><a name="elementsCharUNIX">UNIX domain socket client/server</a></h5>
+
+ <p>
+ The character device acts as a UNIX domain socket server,
+ accepting connections from local clients.
+ </p>
+
+ <pre>
+ ...
+ <serial type="unix">
+ <source mode="bind" path="/tmp/foo"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
- <h2>Example configs</h2>
+ <h2><a name="examples">Example configs</a></h2>
<p>
Example configurations for each driver are provide on the
Index: page.xsl
===================================================================
RCS file: /data/cvs/libvirt/docs/page.xsl,v
retrieving revision 1.8
diff -u -p -r1.8 page.xsl
--- page.xsl 6 May 2008 23:23:55 -0000 1.8
+++ page.xsl 6 May 2008 23:56:34 -0000
@@ -62,28 +62,30 @@
<xsl:template name="toc">
<ul>
<xsl:for-each select="/html/body/h2[count(a) = 1]">
- <xsl:variable name="thishead" select="."/>
+ <xsl:variable name="thish2" select="."/>
<li>
<a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h3[preceding-sibling::h2[1] = $thishead and count(a) = 1]) > 0">
+ <xsl:if test="count(./following-sibling::h3[preceding-sibling::h2[1] = $thish2 and count(a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h3[preceding-sibling::h2[1] = $thishead and count(a) = 1]">
- <xsl:variable name="thissubhead" select="."/>
+ <xsl:for-each select="./following-sibling::h3[preceding-sibling::h2[1] = $thish2 and count(a) = 1]">
+ <xsl:variable name="thish3" select="."/>
<li>
<a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h4[preceding-sibling::h3[1] = $thissubhead and count(a) = 1]) > 0">
+ <xsl:if test="count(./following-sibling::h4[preceding-sibling::h3[1] = $thish3 and count(a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h4[preceding-sibling::h3[1] = $thissubhead and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::h4[preceding-sibling::h3[1] = $thish3 and count(a) = 1]">
+ <xsl:variable name="thish4" select="."/>
<li>
<a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h5[preceding-sibling::h4[1] = $thissubhead and count(a) = 1]) > 0">
+ <xsl:if test="count(./following-sibling::h5[preceding-sibling::h4[1] = $thish4 and count(a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h5[preceding-sibling::h4[1] = $thissubhead and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::h5[preceding-sibling::h4[1] = $thish4 and count(a) = 1]">
+ <xsl:variable name="thish5" select="."/>
<li>
<a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h6[preceding-sibling::h5[1] = $thissubhead and count(a) = 1]) > 0">
+ <xsl:if test="count(./following-sibling::h6[preceding-sibling::h5[1] = $thish5 and count(a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h6[preceding-sibling::h5[1] = $thissubhead and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::h6[preceding-sibling::h5[1] = $thish5 and count(a) = 1]">
<li>
<a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
</li>
--
|: Red Hat, Engineering, Boston -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 :|
16 years, 6 months