[Libvir] Re: libvirt on mingw
by Richard W.M. Jones
Brecht Sanders wrote:
> Hi,
> I saw on the following link:
> http://www.mail-archive.com/libvir-list@redhat.com/msg04103.html
> that you are also trying to compile libvirt on win32.
> I'm also attempting to do this, and I guess I got stuck at the same
> point your post was about.
> Have you in the mean time found an XDR implementation that compiles on
> MinGW and that implements xdr_u_quad_t?
> If you did, can you please tell me where to find it?
You'll find the answer to this question and more if you look through the
libvir-list archives for the current month:
https://www.redhat.com/archives/libvir-list/2008-January/thread.html
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 5 months
[Libvir] [PATCH] Fix USB device name mis-conversion from S-Expr to XML
by Hiroyuki Kaguchi
"tablet" and "mouse" are set as a value of the
/local/domain/<domid>/image/hvm/usbdevice,
but libvirt expects "usbdevice" and "usbmouse" as a value.
This causes the following.
If a USB device is attached by virt-manager,
the USB device is not seen from virt-manager.
This patch fixes expected value of libvirt
Thanks,
Hiroyuki Kaguchi
Index: xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.162
diff -u -r1.162 xend_internal.c
--- xend_internal.c 21 Jan 2008 16:29:10 -0000 1.162
+++ xend_internal.c 23 Jan 2008 00:37:02 -0000
@@ -1743,11 +1743,9 @@
node = cur->u.s.car;
if (sexpr_lookup(node, "usbdevice")) {
tmp = sexpr_node(node, "usbdevice");
- if (tmp && *tmp) {
- if (!strcmp(tmp, "usbtablet"))
- virBufferAdd(&buf, " <input type='tablet'
bus='usb'/>\n", 37);
- else if (!strcmp(tmp, "usbmouse"))
- virBufferAdd(&buf, " <input type='mouse'
bus='usb'/>\n", 36);
+ if (!strcmp(tmp, "tablet") ||
+ !strcmp(tmp, "mouse")) {
+ virBufferVSprintf(&buf, " <input type='%s'
bus='usb'/>\n", tmp);
}
}
}
16 years, 6 months
[Libvir] java-libvirt on cvs:libvirt.org
by Daniel Schwager
Hallo list,
i took the java-libvirt port from Tóth István (Thank you - great work !!) and
added
- the some features from libvirt 0.4.0
- integrate of xsd XML-description / validator
- added auto generation of XML-beans related to the XSD file.
- project build.xml file
- integration of testng
- remote building of JNI library
- remote testing of junit/testing tests
So, I want to publish to port to a public cvs-tree. Is there
a little space on the libvirt website for this port ?
regards
Danny
16 years, 9 months
[Libvir] PATCH: Allow Xen HVM kernel+initrd booting
by Daniel P. Berrange
The latest xen-unstable tree has support for booting HVM guests using an
explicit kernel+initrd+cmdline, as an alternative to the traditional BIOS
boot from harddisk/cdrom/network. This gives Xen HVM parity with KVM in
terms of boot methods. The current libvirt Xen driver though assumes that
Xen paravirt is always kernel+initrd or bootloader based, while Xen HVM
is always BIOS based.
This patch re-factors the Xen driver so that it allows kernel+initrd for
both Xen paravirt and HVM guests.
NB, Xen HVM previously abused the 'kernel' parameter in the SEXPR to refer
to the HVM guest firmware (ie /usr/lib/xen/boot/hvmloader). With the new
support for booting kernel+initrd in HVM guests, the firmware can now be
specified using an explicit 'loader' parameter - for backwards compatability
you can still use the old 'kernel' parameter too if doing a BIOS boot.
Second, it is also now possible for a paravirt guest to provide an explicit
patch to a QEMU device model, aka the <emulator> tag in libvirt, so this
pach also enables that functionality for paravirt guests.
Finally, since the paravirt framebuffer is tied up in all this code too, I
also include John's patch to make us deal with <graphics> properly in legacy
guests and old XenD.
Thankfully we have a large test suite of SEXPR/XML files, so while this is
a pretty major refactoring of code, I'm fairly confident we won't cause bad
regressions.
A couple of the existing test cases needed their sample SEXPR tweaked since
we now generate a couple of (...) bits in a different order, the result is
functionally the same though.
Finally as an example, we can create a HVM guest on xen-unstable using this
XML snippet - note how we can now pass parameters to the installer for HVM
too !
<domain type='xen'>
<name>kernel</name>
<uuid>06ed00fe-1162-4fc4-b5d8-11993ee4a8b9</uuid>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<kernel>/root/vmlinuz.f864</kernel>
<initrd>/root/initrd.img.f864</initrd>
<cmdline>console=ttyS0 console=tty0</cmdline>
</os>
<memory>540672</memory>
<currentMemory>531456</currentMemory>
<vcpu>1</vcpu>
<on_poweroff>preserve</on_poweroff>
<on_reboot>preserve</on_reboot>
<on_crash>preserve</on_crash>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<interface type='bridge'>
<source bridge='xenbr0'/>
<mac address='00:16:3e:0e:e8:b7'/>
<script path='vif-bridge'/>
</interface>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/kernel.img'/>
<target dev='hda'/>
</disk>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='0.0.0.0'/>
<console tty='pty'/>
</devices>
</domain>
src/xend_internal.c | 122 +++++++------
src/xml.c | 183 ++++++++------------
tests/sexpr2xmldata/sexpr2xml-fv-kernel.sexpr | 1
tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml | 26 ++
tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr | 70 +++++++
tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml | 33 +++
tests/sexpr2xmltest.c | 20 ++
tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 1
tests/xml2sexprdata/xml2sexpr-fv-kernel.xml | 24 ++
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 2
tests/xml2sexprdata/xml2sexpr-fv.sexpr | 2
tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 2
tests/xml2sexprtest.c | 11 +
18 files changed, 346 insertions(+), 161 deletions(-)
Dan.
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.165
diff -u -p -r1.165 xend_internal.c
--- src/xend_internal.c 30 Jan 2008 16:38:18 -0000 1.165
+++ src/xend_internal.c 3 Feb 2008 18:37:17 -0000
@@ -1280,65 +1280,84 @@ xend_log(virConnectPtr xend, char *buffe
static int
xend_parse_sexp_desc_os(virConnectPtr xend, struct sexpr *node, virBufferPtr buf, int hvm, int bootloader)
{
- const char *tmp;
+ const char *loader = NULL;
+ const char *kernel = NULL;
+ const char *initrd = NULL;
+ const char *cmdline = NULL;
+ const char *root = NULL;
if (node == NULL || buf == NULL) {
return(-1);
}
virBufferAdd(buf, " <os>\n", 7);
+ if (hvm)
+ virBufferAdd(buf, " <type>hvm</type>\n", -1);
+ else
+ virBufferAdd(buf, " <type>linux</type>\n", -1);
+
if (hvm) {
- virBufferVSprintf(buf, " <type>hvm</type>\n");
- tmp = sexpr_node(node, "domain/image/hvm/kernel");
- if (tmp == NULL)
- tmp = sexpr_node(node, "domain/image/hvm/loader");
- if (tmp == NULL && !bootloader) {
- virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing kernel & bootloader"));
- return(-1);
- }
- if (tmp)
- virBufferVSprintf(buf, " <loader>%s</loader>\n", tmp);
- tmp = sexpr_node(node, "domain/image/hvm/boot");
- if ((tmp != NULL) && (tmp[0] != 0)) {
- while (*tmp) {
- if (*tmp == 'a')
- /* XXX no way to deal with boot from 2nd floppy */
- virBufferAdd(buf, " <boot dev='fd'/>\n", 21 );
- else if (*tmp == 'c')
- /*
- * Don't know what to put here. Say the vm has been given 3
- * disks - hda, hdb, hdc. How does one identify the boot disk?
- * We're going to assume that first disk is the boot disk since
- * this is most common practice
- */
- virBufferAdd(buf, " <boot dev='hd'/>\n", 21 );
- else if (*tmp == 'd')
- virBufferAdd(buf, " <boot dev='cdrom'/>\n", 24 );
- else if (*tmp == 'n')
- virBufferAdd(buf, " <boot dev='network'/>\n", 26 );
- tmp++;
+ loader = sexpr_node(node, "domain/image/hvm/loader");
+ if (loader == NULL) {
+ loader = sexpr_node(node, "domain/image/hvm/kernel");
+
+ if (loader == NULL) {
+ virXendError(xend, VIR_ERR_INTERNAL_ERROR,
+ _("domain information incomplete, missing HVM loader"));
+ return(-1);
}
+ } else {
+ kernel = sexpr_node(node, "domain/image/hvm/kernel");
+ initrd = sexpr_node(node, "domain/image/hvm/ramdisk");
+ cmdline = sexpr_node(node, "domain/image/hvm/args");
+ root = sexpr_node(node, "domain/image/hvm/root");
}
} else {
- virBufferVSprintf(buf, " <type>linux</type>\n");
- tmp = sexpr_node(node, "domain/image/linux/kernel");
- if (tmp == NULL && !bootloader) {
+ kernel = sexpr_node(node, "domain/image/linux/kernel");
+ initrd = sexpr_node(node, "domain/image/linux/ramdisk");
+ cmdline = sexpr_node(node, "domain/image/linux/args");
+ root = sexpr_node(node, "domain/image/linux/root");
+ }
+
+ if (hvm)
+ virBufferVSprintf(buf, " <loader>%s</loader>\n", loader);
+
+ if (kernel) {
+ virBufferVSprintf(buf, " <kernel>%s</kernel>\n", kernel);
+ if (initrd && initrd[0])
+ virBufferVSprintf(buf, " <initrd>%s</initrd>\n", initrd);
+ if (root && root[0])
+ virBufferVSprintf(buf, " <root>%s</root>\n", root);
+ if (cmdline && cmdline[0])
+ virBufferEscapeString(buf, " <cmdline>%s</cmdline>\n", cmdline);
+ } else {
+ if (hvm) {
+ const char *boot = sexpr_node(node, "domain/image/hvm/boot");
+ if ((boot != NULL) && (boot[0] != 0)) {
+ while (*boot) {
+ if (*boot == 'a')
+ /* XXX no way to deal with boot from 2nd floppy */
+ virBufferAdd(buf, " <boot dev='fd'/>\n", 21 );
+ else if (*boot == 'c')
+ /*
+ * Don't know what to put here. Say the vm has been given 3
+ * disks - hda, hdb, hdc. How does one identify the boot disk?
+ * We're going to assume that first disk is the boot disk since
+ * this is most common practice
+ */
+ virBufferAdd(buf, " <boot dev='hd'/>\n", 21 );
+ else if (*boot == 'd')
+ virBufferAdd(buf, " <boot dev='cdrom'/>\n", 24 );
+ else if (*boot == 'n')
+ virBufferAdd(buf, " <boot dev='network'/>\n", 26 );
+ boot++;
+ }
+ }
+ } else if (!bootloader) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
_("domain information incomplete, missing kernel & bootloader"));
return(-1);
}
- if (tmp)
- virBufferVSprintf(buf, " <kernel>%s</kernel>\n", tmp);
- tmp = sexpr_node(node, "domain/image/linux/ramdisk");
- if ((tmp != NULL) && (tmp[0] != 0))
- virBufferVSprintf(buf, " <initrd>%s</initrd>\n", tmp);
- tmp = sexpr_node(node, "domain/image/linux/root");
- if ((tmp != NULL) && (tmp[0] != 0))
- virBufferVSprintf(buf, " <root>%s</root>\n", tmp);
- tmp = sexpr_node(node, "domain/image/linux/args");
- if ((tmp != NULL) && (tmp[0] != 0))
- virBufferEscapeString(buf, " <cmdline>%s</cmdline>\n", tmp);
}
virBufferAdd(buf, " </os>\n", 8);
@@ -1367,7 +1386,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
const char *tmp;
char *tty;
virBuffer buf;
- int hvm = 0, bootloader = 0;
+ int hvm = 0, bootloader = 0, vfb = 0;
int domid = -1;
int max_mem, cur_mem;
unsigned char uuid[VIR_UUID_BUFLEN];
@@ -1487,8 +1506,10 @@ xend_parse_sexp_desc(virConnectPtr conn,
virBufferAdd(&buf, " <devices>\n", 12);
- /* in case of HVM we have devices emulation */
- tmp = sexpr_node(root, "domain/image/hvm/device_model");
+ if (hvm)
+ tmp = sexpr_node(root, "domain/image/hvm/device_model");
+ else
+ tmp = sexpr_node(root, "domain/image/linux/device_model");
if ((tmp != NULL) && (tmp[0] != 0))
virBufferVSprintf(&buf, " <emulator>%s</emulator>\n", tmp);
@@ -1681,6 +1702,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
tmp = sexpr_node(node, "device/vfb/type");
if (tmp && !strcmp(tmp, "sdl")) {
+ vfb = 1;
virBufferVSprintf(&buf, " <input type='mouse' bus='%s'/>\n", hvm ? "ps2": "xen");
virBufferAdd(&buf, " <graphics type='sdl'/>\n", 27);
} else if (tmp && !strcmp(tmp, "vnc")) {
@@ -1688,6 +1710,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
const char *listenAddr = sexpr_node(node, "device/vfb/vnclisten");
const char *vncPasswd = NULL;
const char *keymap = sexpr_node(node, "device/vfb/keymap");
+ vfb = 1;
virBufferVSprintf(&buf, " <input type='mouse' bus='%s'/>\n", hvm ? "ps2": "xen");
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d'", port);
if (listenAddr)
@@ -1751,8 +1774,7 @@ xend_parse_sexp_desc(virConnectPtr conn,
}
/* Graphics device (HVM <= 3.0.4, or PV <= 3.0.3) vnc config */
- if ((hvm && xendConfigVersion < 4) ||
- (!hvm && xendConfigVersion < 3)) {
+ if (!vfb) {
tmp = sexpr_fmt_node(root, "domain/image/%s/vnc", hvm ? "hvm" : "linux");
if (tmp != NULL) {
if (tmp[0] == '1') {
Index: src/xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.105
diff -u -p -r1.105 xml.c
--- src/xml.c 29 Jan 2008 18:23:43 -0000 1.105
+++ src/xml.c 3 Feb 2008 18:37:17 -0000
@@ -839,22 +839,21 @@ virDomainParseXMLGraphicsDescVFB(virConn
* @ctxt: a path context representing the XML description
* @vcpus: number of virtual CPUs to configure
* @xendConfigVersion: xend configuration file format
+ * @hasKernel: whether the domain is booting from a kernel
*
- * Parse the OS part of the XML description for an HVM domain and add it to
- * the S-Expr in buf. This is a temporary interface as the S-Expr interface
- * will be replaced by XML-RPC in the future. However the XML format should
- * stay valid over time.
+ * Parse the OS part of the XML description for a HVM domain
+ * and add it to the S-Expr in buf.
*
* Returns 0 in case of success, -1 in case of error.
*/
static int
virDomainParseXMLOSDescHVM(virConnectPtr conn, xmlNodePtr node,
virBufferPtr buf, xmlXPathContextPtr ctxt,
- int vcpus, int xendConfigVersion)
+ int vcpus, int xendConfigVersion,
+ int hasKernel)
{
xmlNodePtr cur, txt;
xmlNodePtr *nodes = NULL;
- xmlChar *type = NULL;
xmlChar *loader = NULL;
char bootorder[5];
int nbootorder = 0;
@@ -864,14 +863,8 @@ virDomainParseXMLOSDescHVM(virConnectPtr
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((type == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "type"))) {
- txt = cur->children;
- if ((txt != NULL) && (txt->type == XML_TEXT_NODE) &&
- (txt->next == NULL))
- type = txt->content;
- } else if ((loader == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "loader"))) {
+ if ((loader == NULL) &&
+ (xmlStrEqual(cur->name, BAD_CAST "loader"))) {
txt = cur->children;
if ((txt != NULL) && (txt->type == XML_TEXT_NODE) &&
(txt->next == NULL))
@@ -904,29 +897,31 @@ virDomainParseXMLOSDescHVM(virConnectPtr
}
cur = cur->next;
}
+ /*
+ * XenD always needs boot order defined for HVM, even if
+ * booting off a kernel + initrd, so force to 'c' if nothing
+ * else is specified
+ */
+ if (nbootorder == 0)
+ bootorder[nbootorder++] = 'c';
bootorder[nbootorder] = '\0';
- if ((type == NULL) || (!xmlStrEqual(type, BAD_CAST "hvm"))) {
- /* VIR_ERR_OS_TYPE */
- virXMLError(conn, VIR_ERR_OS_TYPE, (const char *) type, 0);
- return (-1);
- }
- virBufferAdd(buf, "(image (hvm ", 12);
+
if (loader == NULL) {
- virXMLError(conn, VIR_ERR_NO_KERNEL, NULL, 0);
- goto error;
+ virXMLError(conn, VIR_ERR_INTERNAL_ERROR, "no HVM domain loader", 0);
+ return -1;
+ }
+ /*
+ * Originally XenD abused the 'kernel' parameter for the HVM
+ * firmware. New XenD allows HVM guests to boot from a kernel
+ * and if this is enabled, the HVM firmware must use the new
+ * 'loader' parameter
+ */
+ if (hasKernel) {
+ virBufferVSprintf(buf, "(loader '%s')", (const char *) loader);
} else {
virBufferVSprintf(buf, "(kernel '%s')", (const char *) loader);
}
- /* get the device emulation model */
- str = virXPathString("string(/domain/devices/emulator[1])", ctxt);
- if (str == NULL) {
- virXMLError(conn, VIR_ERR_NO_KERNEL, NULL, 0); /* TODO: error */
- goto error;
- }
- virBufferVSprintf(buf, "(device_model '%s')", str);
- xmlFree(str);
-
virBufferVSprintf(buf, "(vcpus %d)", vcpus);
if (nbootorder)
@@ -1047,27 +1042,12 @@ virDomainParseXMLOSDescHVM(virConnectPtr
virBufferAdd(buf, "(serial pty)", 12);
}
- /* HVM graphics for xen <= 3.0.5 */
- if (xendConfigVersion < 4) {
- /* Is a graphics device specified? */
- cur = virXPathNode("/domain/devices/graphics[1]", ctxt);
- if (cur != NULL) {
- res = virDomainParseXMLGraphicsDescImage(conn, cur, buf,
- xendConfigVersion);
- if (res != 0) {
- goto error;
- }
- }
- }
-
str = virXPathString("string(/domain/clock/@offset)", ctxt);
if (str != NULL && !strcmp(str, "localtime")) {
virBufferAdd(buf, "(localtime 1)", 13);
}
free(str);
- virBufferAdd(buf, "))", 2);
-
return (0);
error:
@@ -1075,45 +1055,34 @@ virDomainParseXMLOSDescHVM(virConnectPtr
return (-1);
}
+
/**
- * virDomainParseXMLOSDescPV:
+ * virDomainParseXMLOSDescKernel:
* @conn: pointer to the hypervisor connection
* @node: node containing PV OS description
* @buf: a buffer for the result S-Expr
- * @ctxt: a path context representing the XML description
- * @xendConfigVersion: xend configuration file format
*
- * Parse the OS part of the XML description for a paravirtualized domain
- * and add it to the S-Expr in buf. This is a temporary interface as the
- * S-Expr interface will be replaced by XML-RPC in the future. However
- * the XML format should stay valid over time.
+ * Parse the OS part of the XML description for a domain using a direct
+ * kernel and initrd to boot.
*
* Returns 0 in case of success, -1 in case of error.
*/
static int
-virDomainParseXMLOSDescPV(virConnectPtr conn, xmlNodePtr node,
- virBufferPtr buf, xmlXPathContextPtr ctxt,
- int xendConfigVersion)
+virDomainParseXMLOSDescKernel(virConnectPtr conn ATTRIBUTE_UNUSED,
+ xmlNodePtr node,
+ virBufferPtr buf)
{
xmlNodePtr cur, txt;
- const xmlChar *type = NULL;
const xmlChar *root = NULL;
const xmlChar *kernel = NULL;
const xmlChar *initrd = NULL;
const xmlChar *cmdline = NULL;
- int res;
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((type == NULL)
- && (xmlStrEqual(cur->name, BAD_CAST "type"))) {
- txt = cur->children;
- if ((txt != NULL) && (txt->type == XML_TEXT_NODE) &&
- (txt->next == NULL))
- type = txt->content;
- } else if ((kernel == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "kernel"))) {
+ if ((kernel == NULL) &&
+ (xmlStrEqual(cur->name, BAD_CAST "kernel"))) {
txt = cur->children;
if ((txt != NULL) && (txt->type == XML_TEXT_NODE) &&
(txt->next == NULL))
@@ -1140,18 +1109,9 @@ virDomainParseXMLOSDescPV(virConnectPtr
}
cur = cur->next;
}
- if ((type != NULL) && (!xmlStrEqual(type, BAD_CAST "linux"))) {
- /* VIR_ERR_OS_TYPE */
- virXMLError(conn, VIR_ERR_OS_TYPE, (const char *) type, 0);
- return (-1);
- }
- virBufferAdd(buf, "(image (linux ", 14);
- if (kernel == NULL) {
- virXMLError(conn, VIR_ERR_NO_KERNEL, NULL, 0);
- return (-1);
- } else {
- virBufferVSprintf(buf, "(kernel '%s')", (const char *) kernel);
- }
+
+ virBufferVSprintf(buf, "(kernel '%s')", (const char *) kernel);
+
if (initrd != NULL)
virBufferVSprintf(buf, "(ramdisk '%s')", (const char *) initrd);
if (root != NULL)
@@ -1159,20 +1119,6 @@ virDomainParseXMLOSDescPV(virConnectPtr
if (cmdline != NULL)
virBufferVSprintf(buf, "(args '%s')", (const char *) cmdline);
- /* PV graphics for xen <= 3.0.4 */
- if (xendConfigVersion < 3) {
- cur = virXPathNode("/domain/devices/graphics[1]", ctxt);
- if (cur != NULL) {
- res = virDomainParseXMLGraphicsDescImage(conn, cur, buf,
- xendConfigVersion);
- if (res != 0) {
- goto error;
- }
- }
- }
-
- error:
- virBufferAdd(buf, "))", 2);
return (0);
}
@@ -1706,23 +1652,54 @@ virDomainParseXMLDesc(virConnectPtr conn
if (!bootloader) {
if ((node = virXPathNode("/domain/os[1]", ctxt)) != NULL) {
+ int has_kernel = 0;
+
/* Analyze of the os description, based on HVM or PV. */
str = virXPathString("string(/domain/os/type[1])", ctxt);
-
- if ((str == NULL) || (strcmp(str, "hvm"))) {
- res = virDomainParseXMLOSDescPV(conn, node,
- &buf, ctxt,
- xendConfigVersion);
- } else {
+ if ((str != NULL) && STREQ(str, "hvm"))
hvm = 1;
- res = virDomainParseXMLOSDescHVM(conn, node, &buf, ctxt,
- vcpus, xendConfigVersion);
- }
+ xmlFree(str);
+ str = NULL;
- free(str);
+ if (hvm)
+ virBufferAdd(&buf, "(image (hvm ", 12);
+ else
+ virBufferAdd(&buf, "(image (linux ", 14);
+
+ if (virXPathBoolean("count(/domain/os/kernel) > 0", ctxt)) {
+ if (virDomainParseXMLOSDescKernel(conn, node,
+ &buf) != 0)
+ goto error;
+ has_kernel = 1;
+ }
- if (res != 0)
+ if (hvm &&
+ virDomainParseXMLOSDescHVM(conn, node,
+ &buf, ctxt, vcpus,
+ xendConfigVersion,
+ has_kernel) != 0)
goto error;
+
+ /* get the device emulation model */
+ str = virXPathString("string(/domain/devices/emulator[1])", ctxt);
+ if (str != NULL) {
+ virBufferVSprintf(&buf, "(device_model '%s')", str);
+ xmlFree(str);
+ str = NULL;
+ }
+
+ /* PV graphics for xen <= 3.0.4, or HVM graphics for xen <= 3.1.0 */
+ if ((!hvm && xendConfigVersion < 3) ||
+ (hvm && xendConfigVersion < 4)) {
+ xmlNodePtr cur;
+ cur = virXPathNode("/domain/devices/graphics[1]", ctxt);
+ if (cur != NULL &&
+ virDomainParseXMLGraphicsDescImage(conn, cur, &buf,
+ xendConfigVersion) != 0)
+ goto error;
+ }
+
+ virBufferAdd(&buf, "))", 2);
} else {
virXMLError(conn, VIR_ERR_NO_OS, nam, 0);
goto error;
Index: tests/sexpr2xmltest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/sexpr2xmltest.c,v
retrieving revision 1.22
diff -u -p -r1.22 sexpr2xmltest.c
--- tests/sexpr2xmltest.c 29 Jan 2008 18:15:54 -0000 1.22
+++ tests/sexpr2xmltest.c 3 Feb 2008 18:37:17 -0000
@@ -178,6 +178,18 @@ static int testCompareFVclockLocaltime(c
1);
}
+static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) {
+ return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-kernel.xml",
+ "sexpr2xmldata/sexpr2xml-fv-kernel.sexpr",
+ 1);
+}
+
+static int testCompareFVLegacyVFB(const void *data ATTRIBUTE_UNUSED) {
+ return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml",
+ "sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr",
+ 4);
+}
+
int
main(int argc, char **argv)
@@ -276,6 +288,14 @@ main(int argc, char **argv)
1, testCompareFVclockLocaltime, NULL) != 0)
ret = -1;
+ if (virtTestRun("SEXPR-2-XML FV kernel",
+ 1, testCompareFVKernel, NULL) != 0)
+ ret = -1;
+
+ if (virtTestRun("SEXPR-2-XML FV legacy VFB",
+ 1, testCompareFVLegacyVFB, NULL) != 0)
+ ret = -1;
+
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#else /* WITHOUT_XEN */
Index: tests/xml2sexprtest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprtest.c,v
retrieving revision 1.21
diff -u -p -r1.21 xml2sexprtest.c
--- tests/xml2sexprtest.c 29 Jan 2008 18:15:54 -0000 1.21
+++ tests/xml2sexprtest.c 3 Feb 2008 18:37:17 -0000
@@ -235,6 +235,13 @@ static int testCompareFVInputUSBTablet(c
1);
}
+static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) {
+ return testCompareFiles("xml2sexprdata/xml2sexpr-fv-kernel.xml",
+ "xml2sexprdata/xml2sexpr-fv-kernel.sexpr",
+ "fvtest",
+ 1);
+}
+
int
@@ -351,6 +358,10 @@ main(int argc, char **argv)
1, testCompareFVclockLocaltime, NULL) != 0)
ret = -1;
+ if (virtTestRun("XML-2-SEXPR FV kernel",
+ 1, testCompareFVKernel, NULL) != 0)
+ ret = -1;
+
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
Index: tests/sexpr2xmldata/sexpr2xml-fv-kernel.sexpr
===================================================================
RCS file: tests/sexpr2xmldata/sexpr2xml-fv-kernel.sexpr
diff -N tests/sexpr2xmldata/sexpr2xml-fv-kernel.sexpr
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/sexpr2xmldata/sexpr2xml-fv-kernel.sexpr 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1 @@
+(domain (domid 15)(name 'fvtest')(memory 420)(maxmem 420)(vcpus 2)(uuid '596a5d2171f48fb2e068e2386a5c413e')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (hvm (kernel '/var/lib/xen/vmlinuz.2Dn2YT')(ramdisk '/var/lib/xen/initrd.img.0u-Vhq')(args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test... ')(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)(usb 1)(serial pty)))(device (vbd (dev 'ioemu:xvda')(uname 'file:/root/some.img')(mode 'w'))))
\ No newline at end of file
Index: tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
===================================================================
RCS file: tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
diff -N tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1,26 @@
+<domain type='xen' id='15'>
+ <name>fvtest</name>
+ <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid>
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
+ <initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd>
+ <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test... </cmdline>
+ </os>
+ <memory>430080</memory>
+ <vcpu>2</vcpu>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <features>
+ </features>
+ <clock offset='utc'/>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file'/>
+ <source file='/root/some.img'/>
+ <target dev='xvda'/>
+ </disk>
+ </devices>
+</domain>
Index: tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr
===================================================================
RCS file: tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr
diff -N tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1,70 @@
+(domain
+ (domid 1)
+ (on_crash restart)
+ (uuid fde0533d-d043-88c6-dfba-4822fa32f309)
+ (bootloader_args )
+ (vcpus 1)
+ (name s10u4)
+ (on_poweroff destroy)
+ (on_reboot restart)
+ (bootloader )
+ (maxmem 1024)
+ (memory 1024)
+ (shadow_memory 9)
+ (cpu_weight 256)
+ (cpu_cap 0)
+ (features )
+ (on_xend_start ignore)
+ (on_xend_stop shutdown)
+ (start_time 1201894394.0)
+ (cpu_time 17.253230349)
+ (online_vcpus 1)
+ (image
+ (hvm
+ (kernel /usr/lib/xen/boot/hvmloader)
+ (boot c)
+ (device_model /usr/lib/xen/bin/qemu-dm)
+ (keymap en-us)
+ (localtime 0)
+ (pae 1)
+ (vnc 1)
+ (vncunused 1)
+ (notes (SUSPEND_CANCEL 1))
+ )
+ )
+ (status 2)
+ (state -b----)
+ (store_mfn 262142)
+ (device
+ (vif
+ (mac 00:16:3e:3b:b9:d7)
+ (script vif-vnic)
+ (uuid 33b87cce-c187-4bdd-8301-6411a48be129)
+ (backend 0)
+ )
+ )
+ (device
+ (vbd
+ (uname phy:/dev/zvol/dsk/export/s10u4-root)
+ (uuid b1d5196f-aae7-74bb-43dc-b4aae943b9bd)
+ (mode w)
+ (dev hda:disk)
+ (backend 0)
+ (bootable 1)
+ )
+ )
+ (device
+ (vfb
+ (vncunused 1)
+ (uuid d45dfd90-c0e0-8851-8f14-f16ba9512d2d)
+ (location localhost:5900)
+ )
+ )
+ (device
+ (console
+ (protocol vt100)
+ (location 3)
+ (uuid 0248d3f7-f3ae-78e8-4829-ad51a6f94efd)
+ )
+ )
+)
Index: tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml
===================================================================
RCS file: tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml
diff -N tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1,33 @@
+<domain type='xen' id='1'>
+ <name>s10u4</name>
+ <uuid>fde0533d-d043-88c6-dfba-4822fa32f309</uuid>
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='hd'/>
+ </os>
+ <memory>1048576</memory>
+ <vcpu>1</vcpu>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <features>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <interface type='ethernet'>
+ <target dev='vif1.0'/>
+ <mac address='00:16:3e:3b:b9:d7'/>
+ <script path='vif-vnic'/>
+ </interface>
+ <disk type='block' device='disk'>
+ <driver name='phy'/>
+ <source dev='/dev/zvol/dsk/export/s10u4-root'/>
+ <target dev='hda'/>
+ </disk>
+ <input type='mouse' bus='ps2'/>
+ <graphics type='vnc' port='-1' keymap='en-us'/>
+ </devices>
+</domain>
Index: tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
===================================================================
RCS file: tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
diff -N tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1 @@
+(vm (name 'fvtest')(memory 420)(maxmem 420)(vcpus 2)(uuid '596a5d2171f48fb2e068e2386a5c413e')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (hvm (kernel '/var/lib/xen/vmlinuz.2Dn2YT')(ramdisk '/var/lib/xen/initrd.img.0u-Vhq')(args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test... ')(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)(boot c)(usb 1)(serial pty)))(device (vbd (dev 'ioemu:xvda')(uname 'file:/root/some.img')(mode 'w'))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-kernel.xml
===================================================================
RCS file: tests/xml2sexprdata/xml2sexpr-fv-kernel.xml
diff -N tests/xml2sexprdata/xml2sexpr-fv-kernel.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/xml2sexprdata/xml2sexpr-fv-kernel.xml 3 Feb 2008 18:37:17 -0000
@@ -0,0 +1,24 @@
+<domain type='xen' id='15'>
+ <name>fvtest</name>
+ <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid>
+ <os>
+ <type>hvm</type>
+ <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
+ <initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd>
+ <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test... </cmdline>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ </os>
+ <memory>430080</memory>
+ <vcpu>2</vcpu>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <source file='/root/some.img'/>
+ <target dev='xvda'/>
+ </disk>
+ <console tty='/dev/pts/4'/>
+ </devices>
+</domain>
+
Index: tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr,v
retrieving revision 1.2
diff -u -p -r1.2 xml2sexpr-fv-localtime.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr 18 Jul 2007 21:08:22 -0000 1.2
+++ tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(vnc 1)(localtime 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(localtime 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr,v
retrieving revision 1.1
diff -u -p -r1.1 xml2sexpr-fv-usbmouse.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr 18 Jul 2007 21:08:22 -0000 1.1
+++ tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice mouse)(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice mouse)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr,v
retrieving revision 1.1
diff -u -p -r1.1 xml2sexpr-fv-usbtablet.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr 18 Jul 2007 21:08:22 -0000 1.1
+++ tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice tablet)(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice tablet)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr,v
retrieving revision 1.2
diff -u -p -r1.2 xml2sexpr-fv-utc.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr 18 Jul 2007 21:08:22 -0000 1.2
+++ tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr,v
retrieving revision 1.6
diff -u -p -r1.6 xml2sexpr-fv-v2.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr 18 Jul 2007 21:08:22 -0000 1.6
+++ tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(acpi 1)(usb 1)(vnc 1)(vncdisplay 17)(keymap ja)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(usb 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)(vncdisplay 17)(keymap ja)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr,v
retrieving revision 1.5
diff -u -p -r1.5 xml2sexpr-fv-vncunused.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr 18 Jul 2007 21:08:22 -0000 1.5
+++ tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(acpi 1)(usb 1)(vnc 1)(vncunused 1)(keymap ja)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(usb 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)(vncunused 1)(keymap ja)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-fv.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-fv.sexpr,v
retrieving revision 1.3
diff -u -p -r1.3 xml2sexpr-fv.sexpr
--- tests/xml2sexprdata/xml2sexpr-fv.sexpr 18 Jul 2007 21:08:22 -0000 1.3
+++ tests/xml2sexprdata/xml2sexpr-fv.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
+(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(usb 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
Index: tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr
===================================================================
RCS file: /data/cvs/libvirt/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr,v
retrieving revision 1.2
diff -u -p -r1.2 xml2sexpr-no-source-cdrom.sexpr
--- tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr 18 Jul 2007 21:08:22 -0000 1.2
+++ tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr 3 Feb 2008 18:37:17 -0000
@@ -1 +1 @@
-(vm (name 'test')(memory 350)(maxmem 382)(vcpus 1)(uuid 'cc2315e7d26a307a438c6d188ec4c09c')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib/xen/bin/qemu-dm')(vcpus 1)(boot c)(acpi 1)(apic 1)(pae 1)(usb 1)(vnc 1)(vncdisplay 6)))(device (vbd (dev 'hda:disk:disk')(uname 'phy:/dev/sda8')(mode 'w')))(device (vbd (dev 'hdc:cdrom')(mode 'r')))(device (vif (mac '00:16:3e:0a:7b:39')(type ioemu))))
\ No newline at end of file
+(vm (name 'test')(memory 350)(maxmem 382)(vcpus 1)(uuid 'cc2315e7d26a307a438c6d188ec4c09c')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(apic 1)(pae 1)(usb 1)(device_model '/usr/lib/xen/bin/qemu-dm')(vnc 1)(vncdisplay 6)))(device (vbd (dev 'hda:disk:disk')(uname 'phy:/dev/sda8')(mode 'w')))(device (vbd (dev 'hdc:cdrom')(mode 'r')))(device (vif (mac '00:16:3e:0a:7b:39')(type ioemu))))
\ No newline at end of file
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
16 years, 9 months
[Libvir] [PATCH]: Make iSCSI login actually work
by Chris Lalancette
Hello,
I mentioned this before, but this patch must have been dropped when Dan
committed storage stuff to CVS. In order for iSCSI login to work properly, you
must properly --sendtargets before trying to login, otherwise your logins will
fail. This patch just adds a --sendtargets command right before the login to
make sure things succeed.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
16 years, 9 months
[Libvir] many more translatable strings need to be marked
by Jim Meyering
I've found many more strings that should be marked for translation.
The first part of this change is to add to the list of
diagnostic-printing function names in Makefile.maint and to
make that list more readable.
I marked some strings, but am leaving the rest, for now. Running "make
sc_unmarked_diagnostics" shows over 300 strings remaining to be marked
with _(...). However, while marking them is a big step, it's not all.
Once they're all marked, then we'll have to go back and with the help
of the right build options (--disable-nls and -Wformat -Wformat-security),
or just some judicious grepping through your patch,
add "%s" before each _("...") string that contains no "%" directive.
Mark many more strings for translation.
* Makefile.maint (err_func_re): Add to the list and make it readable.
* po/POTFILES.in: Add src/util.c and src/xm_internal.c, and sort.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 32 +++++++-
po/POTFILES.in | 10 ++-
qemud/remote.c | 197 +++++++++++++++++++++++++------------------------
src/storage_backend.c | 2 +-
src/util.c | 2 +-
src/xm_internal.c | 16 +++--
6 files changed, 147 insertions(+), 112 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 92cdf29..14a2ac5 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -299,8 +299,30 @@ sc_two_space_separator_in_usage:
echo "$(ME): an option and its description"; \
1>&2; exit 1; } || :
-err_func_re = \
-(DISABLE_fprintf|qemudLog|(xmlRpc|vir(Xend|XML|Hash|Conf|Test|LibConn|StorageReport))Error)
+msg_gen_function = \
+ DISABLE_fprintf \
+ virXendError \
+ virXMLError \
+ virHashError \
+ virConfError \
+ virTestError \
+ virLibConnError \
+ virStorageReportError \
+ virxmlRpcError \
+ xenXMError \
+ virXenError \
+ ReportError \
+ testError \
+ virLog \
+ qemudLog \
+ openvzLog \
+ virStorageLog \
+ qemudReportError \
+ remoteDispatchError \
+ error
+
+func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
+func_re := ($(func_or))
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
@@ -309,12 +331,12 @@ err_func_re = \
# "%s", _("no storage vol w..."
sc_unmarked_diagnostics:
@grep -nE \
- '\<(vshError|error) \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
+ '\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
| grep -v '_''(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
- @{ grep -nE '\<$(err_func_re) *\(.*;$$' $$($(CVS_LIST_EXCEPT)); \
- grep -A1 -nE '\<$(err_func_re) *\(.*,$$' $$($(CVS_LIST_EXCEPT)); } \
+ @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(CVS_LIST_EXCEPT)); \
+ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(CVS_LIST_EXCEPT)); } \
| sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \
| grep '[ ]"' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0aafd2e..b619aa2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
gnulib/lib/gai_strerror.c
-qemud/remote.c
qemud/qemud.c
+qemud/remote.c
src/conf.c
src/console.c
src/hash.c
@@ -10,20 +10,22 @@ src/proxy_internal.c
src/qemu_conf.c
src/qemu_driver.c
src/remote_internal.c
+src/sexpr.c
src/storage_backend.c
+src/storage_backend_disk.c
src/storage_backend_fs.c
-src/storage_backend_logical.c
src/storage_backend_iscsi.c
-src/storage_backend_disk.c
+src/storage_backend_logical.c
src/storage_conf.c
src/storage_driver.c
-src/sexpr.c
src/test.c
+src/util.c
src/uuid.c
src/virsh.c
src/virterror.c
src/xen_internal.c
src/xend_internal.c
+src/xm_internal.c
src/xml.c
src/xmlrpc.c
src/xs_internal.c
diff --git a/qemud/remote.c b/qemud/remote.c
index 014fe65..a8f8eb4 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -102,32 +102,34 @@ remoteDispatchClientRequest (struct qemud_server *server,
xdrmem_create (&xdr, client->buffer, client->bufferLength, XDR_DECODE);
if (!xdr_remote_message_header (&xdr, &req)) {
- remoteDispatchError (client, NULL, "xdr_remote_message_header");
+ remoteDispatchError (client, NULL, "%s", _("xdr_remote_message_header"));
xdr_destroy (&xdr);
return;
}
/* Check version, etc. */
if (req.prog != REMOTE_PROGRAM) {
- remoteDispatchError (client, &req, "program mismatch (actual %x, expected %x)",
+ remoteDispatchError (client, &req,
+ _("program mismatch (actual %x, expected %x)"),
req.prog, REMOTE_PROGRAM);
xdr_destroy (&xdr);
return;
}
if (req.vers != REMOTE_PROTOCOL_VERSION) {
- remoteDispatchError (client, &req, "version mismatch (actual %x, expected %x)",
+ remoteDispatchError (client, &req,
+ _("version mismatch (actual %x, expected %x)"),
req.vers, REMOTE_PROTOCOL_VERSION);
xdr_destroy (&xdr);
return;
}
if (req.direction != REMOTE_CALL) {
- remoteDispatchError (client, &req, "direction (%d) != REMOTE_CALL",
+ remoteDispatchError (client, &req, _("direction (%d) != REMOTE_CALL"),
(int) req.direction);
xdr_destroy (&xdr);
return;
}
if (req.status != REMOTE_OK) {
- remoteDispatchError (client, &req, "status (%d) != REMOTE_OK",
+ remoteDispatchError (client, &req, _("status (%d) != REMOTE_OK"),
(int) req.status);
xdr_destroy (&xdr);
return;
@@ -143,7 +145,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
req.proc != REMOTE_PROC_AUTH_SASL_STEP &&
req.proc != REMOTE_PROC_AUTH_POLKIT
) {
- remoteDispatchError (client, &req, "authentication required");
+ remoteDispatchError (client, &req, "%s", _("authentication required"));
xdr_destroy (&xdr);
return;
}
@@ -156,7 +158,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
#include "remote_dispatch_proc_switch.h"
default:
- remoteDispatchError (client, &req, "unknown procedure: %d",
+ remoteDispatchError (client, &req, _("unknown procedure: %d"),
req.proc);
xdr_destroy (&xdr);
return;
@@ -164,7 +166,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* Parse args. */
if (!(*args_filter) (&xdr, args)) {
- remoteDispatchError (client, &req, "parse args failed");
+ remoteDispatchError (client, &req, "%s", _("parse args failed"));
xdr_destroy (&xdr);
return;
}
@@ -179,7 +181,8 @@ remoteDispatchClientRequest (struct qemud_server *server,
* an internal error.
*/
if (rv < -2 || rv > 0) {
- remoteDispatchError (client, &req, "internal error - dispatch function returned invalid code %d", rv);
+ remoteDispatchError (client, &req,
+ _("internal error - dispatch function returned invalid code %d"), rv);
return;
}
@@ -201,14 +204,14 @@ remoteDispatchClientRequest (struct qemud_server *server,
len = 0; /* We'll come back and write this later. */
if (!xdr_int (&xdr, &len)) {
- remoteDispatchError (client, &req, "dummy length");
+ remoteDispatchError (client, &req, "%s", _("dummy length"));
xdr_destroy (&xdr);
if (rv == 0) xdr_free (ret_filter, ret);
return;
}
if (!xdr_remote_message_header (&xdr, &rep)) {
- remoteDispatchError (client, &req, "serialise reply header");
+ remoteDispatchError (client, &req, "%s", _("serialise reply header"));
xdr_destroy (&xdr);
if (rv == 0) xdr_free (ret_filter, ret);
return;
@@ -217,7 +220,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* If OK, serialise return structure, if error serialise error. */
if (rv == 0) {
if (!(*ret_filter) (&xdr, ret)) {
- remoteDispatchError (client, &req, "serialise return struct");
+ remoteDispatchError (client, &req, "%s", _("serialise return struct"));
xdr_destroy (&xdr);
return;
}
@@ -272,7 +275,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
}
if (!xdr_remote_error (&xdr, &error)) {
- remoteDispatchError (client, &req, "serialise return error");
+ remoteDispatchError (client, &req, "%s", _("serialise return error"));
xdr_destroy (&xdr);
return;
}
@@ -281,13 +284,13 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* Write the length word. */
len = xdr_getpos (&xdr);
if (xdr_setpos (&xdr, 0) == 0) {
- remoteDispatchError (client, &req, "xdr_setpos");
+ remoteDispatchError (client, &req, "%s", _("xdr_setpos"));
xdr_destroy (&xdr);
return;
}
if (!xdr_int (&xdr, &len)) {
- remoteDispatchError (client, &req, "serialise return length");
+ remoteDispatchError (client, &req, "%s", _("serialise return length"));
xdr_destroy (&xdr);
return;
}
@@ -421,7 +424,7 @@ remoteDispatchOpen (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Already opened? */
if (client->conn) {
- remoteDispatchError (client, req, "connection already open");
+ remoteDispatchError (client, req, "%s", _("connection already open"));
return -2;
}
@@ -447,7 +450,7 @@ remoteDispatchOpen (struct qemud_server *server ATTRIBUTE_UNUSED,
#define CHECK_CONN(client) \
if (!client->conn) { \
- remoteDispatchError (client, req, "connection not open"); \
+ remoteDispatchError (client, req, "%s", _("connection not open")); \
return -2; \
}
@@ -494,7 +497,7 @@ remoteDispatchGetType (struct qemud_server *server ATTRIBUTE_UNUSED,
*/
ret->type = strdup (type);
if (!ret->type) {
- remoteDispatchError (client, req, "out of memory in strdup");
+ remoteDispatchError (client, req, "%s", _("out of memory in strdup"));
return -2;
}
@@ -608,7 +611,7 @@ remoteDispatchDomainGetSchedulerType (struct qemud_server *server ATTRIBUTE_UNUS
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -639,19 +642,19 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
nparams = args->nparams;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
- remoteDispatchError (client, req, "nparams too large");
+ remoteDispatchError (client, req, "%s", _("nparams too large"));
return -2;
}
params = malloc (sizeof (*params) * nparams);
if (params == NULL) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req, "%s", _("out of memory allocating array"));
return -2;
}
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
free (params);
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -670,7 +673,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
virDomainFree(dom);
free (params);
remoteDispatchError (client, req,
- "out of memory allocating return array");
+ "%s", _("out of memory allocating return array"));
return -2;
}
@@ -681,7 +684,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
virDomainFree(dom);
free (params);
remoteDispatchError (client, req,
- "out of memory allocating return array");
+ "%s", _("out of memory allocating return array"));
return -2;
}
ret->params.params_val[i].value.type = params[i].type;
@@ -701,7 +704,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
default:
virDomainFree(dom);
free (params);
- remoteDispatchError (client, req, "unknown type");
+ remoteDispatchError (client, req, "%s", _("unknown type"));
return -2;
}
}
@@ -726,12 +729,12 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUT
nparams = args->params.params_len;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
- remoteDispatchError (client, req, "nparams too large");
+ remoteDispatchError (client, req, "%s", _("nparams too large"));
return -2;
}
params = malloc (sizeof (*params) * nparams);
if (params == NULL) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req, "%s", _("out of memory allocating array"));
return -2;
}
@@ -760,7 +763,7 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUT
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
free (params);
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -786,7 +789,7 @@ remoteDispatchDomainBlockStats (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
path = args->path;
@@ -817,7 +820,7 @@ remoteDispatchDomainInterfaceStats (struct qemud_server *server ATTRIBUTE_UNUSED
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
path = args->path;
@@ -849,7 +852,7 @@ remoteDispatchDomainAttachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -873,7 +876,7 @@ remoteDispatchDomainCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -935,7 +938,7 @@ remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -957,7 +960,7 @@ remoteDispatchDomainDetachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -982,7 +985,7 @@ remoteDispatchDomainDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1008,7 +1011,7 @@ remoteDispatchDomainGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1033,7 +1036,7 @@ remoteDispatchDomainGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1065,7 +1068,7 @@ remoteDispatchDomainGetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1090,7 +1093,7 @@ remoteDispatchDomainGetMaxVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1115,7 +1118,7 @@ remoteDispatchDomainGetOsType (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1144,19 +1147,19 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
if (args->maxinfo > REMOTE_VCPUINFO_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "maxinfo > REMOTE_VCPUINFO_MAX");
+ remoteDispatchError (client, req, "%s", _("maxinfo > REMOTE_VCPUINFO_MAX"));
return -2;
}
if (args->maxinfo * args->maplen > REMOTE_CPUMAPS_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "maxinfo * maplen > REMOTE_CPUMAPS_MAX");
+ remoteDispatchError (client, req, "%s", _("maxinfo * maplen > REMOTE_CPUMAPS_MAX"));
return -2;
}
@@ -1244,7 +1247,7 @@ remoteDispatchDomainMigratePerform (struct qemud_server *server ATTRIBUTE_UNUSED
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1293,7 +1296,7 @@ remoteDispatchListDefinedDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_DOMAIN_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_DOMAIN_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_DOMAIN_NAME_LIST_MAX"));
return -2;
}
@@ -1390,13 +1393,13 @@ remoteDispatchDomainPinVcpu (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
if (args->cpumap.cpumap_len > REMOTE_CPUMAP_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "cpumap_len > REMOTE_CPUMAP_MAX");
+ remoteDispatchError (client, req, "%s", _("cpumap_len > REMOTE_CPUMAP_MAX"));
return -2;
}
@@ -1423,7 +1426,7 @@ remoteDispatchDomainReboot (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1462,7 +1465,7 @@ remoteDispatchDomainResume (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1486,7 +1489,7 @@ remoteDispatchDomainSave (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1510,7 +1513,7 @@ remoteDispatchDomainCoreDump (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1534,7 +1537,7 @@ remoteDispatchDomainSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1558,7 +1561,7 @@ remoteDispatchDomainSetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1582,7 +1585,7 @@ remoteDispatchDomainSetMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1606,7 +1609,7 @@ remoteDispatchDomainSetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1630,7 +1633,7 @@ remoteDispatchDomainShutdown (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1654,7 +1657,7 @@ remoteDispatchDomainSuspend (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1678,7 +1681,7 @@ remoteDispatchDomainUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1701,7 +1704,7 @@ remoteDispatchListDefinedNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -1727,7 +1730,7 @@ remoteDispatchListDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
remoteDispatchError (client, req,
- "maxids > REMOTE_DOMAIN_ID_LIST_MAX");
+ "%s", _("maxids > REMOTE_DOMAIN_ID_LIST_MAX"));
return -2;
}
@@ -1752,7 +1755,7 @@ remoteDispatchListNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -1779,7 +1782,7 @@ remoteDispatchNetworkCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1839,7 +1842,7 @@ remoteDispatchNetworkDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1863,7 +1866,7 @@ remoteDispatchNetworkDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1889,7 +1892,7 @@ remoteDispatchNetworkGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1913,7 +1916,7 @@ remoteDispatchNetworkGetBridgeName (struct qemud_server *server ATTRIBUTE_UNUSED
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1975,7 +1978,7 @@ remoteDispatchNetworkSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1999,7 +2002,7 @@ remoteDispatchNetworkUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -2090,13 +2093,14 @@ static char *addrToString(struct qemud_client *client,
port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
remoteDispatchError(client, req,
- "Cannot resolve address %d: %s", err, gai_strerror(err));
+ _("Cannot resolve address %d: %s"),
+ err, gai_strerror(err));
return NULL;
}
addr = malloc(strlen(host) + 1 + strlen(port) + 1);
if (!addr) {
- remoteDispatchError(client, req, "cannot allocate address");
+ remoteDispatchError(client, req, "%s", _("cannot allocate address"));
return NULL;
}
@@ -2138,7 +2142,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Get local address in form IPADDR:PORT */
salen = sizeof(sa);
if (getsockname(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
- remoteDispatchError(client, req, "failed to get sock address %d (%s)",
+ remoteDispatchError(client, req,
+ _("failed to get sock address %d (%s)"),
errno, strerror(errno));
return -2;
}
@@ -2149,7 +2154,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Get remote address in form IPADDR:PORT */
salen = sizeof(sa);
if (getpeername(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
- remoteDispatchError(client, req, "failed to get peer address %d (%s)",
+ remoteDispatchError(client, req, _("failed to get peer address %d (%s)"),
errno, strerror(errno));
free(localAddr);
return -2;
@@ -2414,7 +2419,8 @@ remoteDispatchAuthSaslStart (struct qemud_server *server,
if (serverout) {
ret->data.data_val = malloc(serveroutlen);
if (!ret->data.data_val) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req,
+ "%s", _("out of memory allocating array"));
return -2;
}
memcpy(ret->data.data_val, serverout, serveroutlen);
@@ -2494,7 +2500,8 @@ remoteDispatchAuthSaslStep (struct qemud_server *server,
if (serverout) {
ret->data.data_val = malloc(serveroutlen);
if (!ret->data.data_val) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req,
+ "%s", _("out of memory allocating array"));
return -2;
}
memcpy(ret->data.data_val, serverout, serveroutlen);
@@ -2738,7 +2745,7 @@ remoteDispatchListDefinedStoragePools (struct qemud_server *server ATTRIBUTE_UNU
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -2764,7 +2771,7 @@ remoteDispatchListStoragePools (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX"));
return -2;
}
@@ -2791,7 +2798,7 @@ remoteDispatchStoragePoolCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2851,7 +2858,7 @@ remoteDispatchStoragePoolBuild (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2876,7 +2883,7 @@ remoteDispatchStoragePoolDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2900,7 +2907,7 @@ remoteDispatchStoragePoolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2924,7 +2931,7 @@ remoteDispatchStoragePoolRefresh (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2949,7 +2956,7 @@ remoteDispatchStoragePoolGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2980,7 +2987,7 @@ remoteDispatchStoragePoolDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3006,7 +3013,7 @@ remoteDispatchStoragePoolGetAutostart (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3089,7 +3096,7 @@ remoteDispatchStoragePoolSetAutostart (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3113,7 +3120,7 @@ remoteDispatchStoragePoolUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3167,13 +3174,13 @@ remoteDispatchStoragePoolListVolumes (struct qemud_server *server ATTRIBUTE_UNUS
if (args->maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX"));
return -2;
}
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3202,7 +3209,7 @@ remoteDispatchStoragePoolNumOfVolumes (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3233,7 +3240,7 @@ remoteDispatchStorageVolCreateXml (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3259,7 +3266,7 @@ remoteDispatchStorageVolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3284,7 +3291,7 @@ remoteDispatchStorageVolGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3314,7 +3321,7 @@ remoteDispatchStorageVolDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3341,7 +3348,7 @@ remoteDispatchStorageVolGetPath (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3369,7 +3376,7 @@ remoteDispatchStorageVolLookupByName (struct qemud_server *server ATTRIBUTE_UNUS
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
diff --git a/src/storage_backend.c b/src/storage_backend.c
index da0f34a..debbce3 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -1,5 +1,5 @@
/*
- * storage_backend.h: internal storage driver backend contract
+ * storage_backend.c: internal storage driver backend contract
*
* Copyright (C) 2007-2008 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
diff --git a/src/util.c b/src/util.c
index 4d61540..8943669 100644
--- a/src/util.c
+++ b/src/util.c
@@ -458,7 +458,7 @@ int
virFileLinkPointsTo (const char *checkLink ATTRIBUTE_UNUSED,
const char *checkDest ATTRIBUTE_UNUSED)
{
- virLog ("%s: not implemented", __FUNCTION__);
+ virLog (_("%s: not implemented"), __FUNCTION__);
return 0;
}
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 6b4b4d7..d50ce46 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -434,7 +434,8 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
virHashRemoveEntry(configCache, path, NULL);
}
free(entry);
- xenXMError (conn, VIR_ERR_INTERNAL_ERROR, "xenXMConfigCacheRefresh: name");
+ xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("xenXMConfigCacheRefresh: name"));
goto cleanup;
}
@@ -444,7 +445,8 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
if (virHashAddEntry(configCache, entry->filename, entry) < 0) {
virConfFree(entry->conf);
free(entry);
- xenXMError (conn, VIR_ERR_INTERNAL_ERROR, "xenXMConfigCacheRefresh: virHashAddEntry");
+ xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("xenXMConfigCacheRefresh: virHashAddEntry"));
goto cleanup;
}
}
@@ -1254,21 +1256,23 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG, "read only connection");
+ xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ "%s", _("read only connection"));
return -1;
}
if (domain->id != -1) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG, "not inactive domain");
+ xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ "%s", _("not inactive domain"));
return -1;
}
if (!(filename = virHashLookup(nameConfigMap, domain->name))) {
- xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, "virHashLookup");
+ xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("virHashLookup"));
return -1;
}
if (!(entry = virHashLookup(configCache, filename))) {
xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR,
- "can't retrieve config file for domain");
+ "%s", _("can't retrieve config file for domain"));
return -1;
}
--
1.5.4.3.326.g7655e3
16 years, 9 months
[Libvir] [PATCH]Change MAC address to case insensitive
by S.Sakamoto
Hi,
xenXMDomainAttachDevice and xenXMDomainDetachDevice
treats "case sensitve" for MAC address of stopping domain.
This patch changes from case sensitive to case insensitive.
Thanks,
Shigeki Sakamoto.
Index: src/xm_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xm_internal.c,v
retrieving revision 1.64
diff -u -p -r1.64 xm_internal.c
--- src/xm_internal.c 20 Feb 2008 15:29:13 -0000 1.64
+++ src/xm_internal.c 26 Feb 2008 06:40:57 -0000
@@ -2812,7 +2812,7 @@ xenXMAttachInterface(virDomainPtr domain
key = nextkey;
}
- if (!(strcmp(dommac, (const char *) mac))) {
+ if (!(strcasecmp(dommac, (const char *) mac))) {
if (autoassign) {
free(mac);
mac = NULL;
@@ -3087,7 +3087,7 @@ xenXMDomainDetachDevice(virDomainPtr dom
mac = nextmac;
}
- if (!(strcmp(dommac, (const char *) key)))
+ if (!(strcasecmp(dommac, (const char *) key)))
break;
}
skip:
16 years, 9 months
[Libvir] [PATCH] fix typos (part3)
by Atsushi SAKAI
Hi,
I guess this is the last one for libvirt.
docs/errors.html | 6 +++---
docs/format.html | 14 +++++++-------
docs/index.html | 2 +-
docs/news.html | 2 +-
docs/python.html | 2 +-
docs/storage.html | 20 ++++++++++----------
include/libvirt/libvirt.h | 18 +++++++++---------
include/libvirt/libvirt.h.in | 18 +++++++++---------
include/libvirt/virterror.h | 4 ++--
python/libvir.c | 10 +++++-----
python/libvirt-python-api.xml | 4 ++--
python/libvirt_wrap.h | 2 +-
qemud/event.c | 4 ++--
qemud/event.h | 8 ++++----
qemud/libvirtd.conf | 4 ++--
qemud/mdns.c | 2 +-
qemud/mdns.h | 4 ++--
qemud/remote.c | 2 +-
18 files changed, 63 insertions(+), 63 deletions(-)
I wrote a small gnulib document on ja.wikipedia
http://ja.wikipedia.org/wiki/Gnulib
Thanks
Atsushi SAKAI
16 years, 10 months
[Libvir] Snapshots in Libvirt
by Gabriel Kaufmann
Hi,
Can anyone tell me on which version of libvirt, the snapshot functionality is planned to be implemented fos Xen and KVM?
By snapshot I mean to be able to save the state of the machine in order to be able to revert to the snapshot.
Best Regards,
Gabriel Kaufmann
Software Engineer
Gabriel.Kaufmann(a)ericom.com<mailto:Gabriel.Kaufmann@ericom.com>
Ericom Software
Tel (Dir): +972 2 591 1700 Ext 754
Tel (Main): +972 2 591 1700
http://www.ericom.com
Access Done Right
Empower Enterprise-Wide Access to Microsoft(r) Terminal Server, Virtual Desktops and Legacy Applications
16 years, 10 months