[Libvir] [PATCH]Report the error from xend for Domain-0

Kazuki Mizushima mizushima.kazuk at jp.fujitsu.com
Tue Feb 27 10:34:01 UTC 2007


Hi,


When I test virsh subcommands, dump save, for Domain-0,
It says following normal messages, but the processing is not done.

#virsh dump 0 a
 Domain 0 dumpd to a
#echo $?
 0
#virsh save 0 a
 Domain 0 saved to a
#echo $?
 0

I made a patch which reports the error from xend like this.

#virsh dump 0 a
libvir: Xen Daemon error : POST operation failed: (xend.err 'Cannot save privileged domain 0')
libvir: error : library call virDomainSave failed, possibly not supported
error: Failed to save domain 0 to a
# echo $?
1

#virsh dump 0 a
libvir: Xen Daemon error : POST operation failed: (xend.err 'Cannot dump core for privileged domain 0')
libvir: error : library call virDomainCoreDump failed, possibly not supported
error: Failed to core dump domain 0 to a
# echo $?
1

Signed-off-by: Kazuki Mizushima <mizushima.kazuk at jp.fujitsu.com>

Thanks,
Kazuki Mizushima

Index: xend_internal.c (libvirt-0.2.0)
----------------------------------------------------------------------
--- ../../libvirt-0.2.0/src/xend_internal.c     2007-02-15 01:16:16.000000000 +0900
+++ xend_internal.c     2007-02-27 22:45:05.000000000 +0900
@@ -507,7 +507,10 @@ xend_post(virConnectPtr xend, const char

     if ((ret < 0) || (ret >= 300)) {
         virXendError(xend, VIR_ERR_POST_FAILED, content);
-    } else if ((ret = 202) && (strstr(content, "failed") != NULL)) {
+    } else if ((ret == 202) && (strstr(content, "failed") != NULL)) {
+        virXendError(xend, VIR_ERR_POST_FAILED, content);
+        ret = -1;
+    } else if ((ret == 202) && (strcasestr(content, "cannot") != NULL)) {
         virXendError(xend, VIR_ERR_POST_FAILED, content);
         ret = -1;
     }
----------------------------------------------------------------------





More information about the libvir-list mailing list