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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>

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;
    }
----------------------------------------------------------------------



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]