]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Use old API if remote libvirtd does not support new
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Sep 2011 15:16:45 +0000 (17:16 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 13 Sep 2011 22:55:04 +0000 (16:55 -0600)
Commit ffe28ab74b821c916ec4ba8efb5c992454e4bd24 introduced regression
while communicating with older libvirtd command 'domblkstat' used the new
API and did not check for VIR_ERR_RPC error code signalling the remote
server does not support this API and did not fall back to older API.
Thereafter 'domblkstat' ended with "error: unknown procedure: 243".

tools/virsh.c

index 3b060bfdc4588e5ea13c13b1d8941c92ea1433e8..430168c02632859eaa09c38dfb26e91d2f95c1c1 100644 (file)
@@ -1090,7 +1090,8 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
      * then.
      */
     if (rc < 0) {
-        if (last_error->code != VIR_ERR_NO_SUPPORT) {
+        if (last_error->code != VIR_ERR_NO_SUPPORT &&
+            last_error->code != VIR_ERR_RPC) {
             virshReportError(ctl);
             goto cleanup;
         } else {