[PATCH v5 2/7] virerror: add error for libssh transport

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

 



Add a new error domain and number for a new libssh-based transport.
---
 include/libvirt/virterror.h | 2 ++
 src/util/virerror.c         | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index efe83aa..2efee8f 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -131,6 +131,7 @@ typedef enum {
     VIR_FROM_XENXL = 64,        /* Error from Xen xl config code */
 
     VIR_FROM_PERF = 65,         /* Error from perf */
+    VIR_FROM_LIBSSH = 66,       /* Error from libssh connection transport */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_ERR_DOMAIN_LAST
@@ -317,6 +318,7 @@ typedef enum {
     VIR_ERR_NO_CLIENT = 96,             /* Client was not found */
     VIR_ERR_AGENT_UNSYNCED = 97,        /* guest agent replies with wrong id
                                            to guest-sync command */
+    VIR_ERR_LIBSSH = 98,                /* error in libssh transport driver */
 } virErrorNumber;
 
 /**
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 2958308..ef17fb5 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -137,7 +137,8 @@ VIR_ENUM_IMPL(virErrorDomain, VIR_ERR_DOMAIN_LAST,
               "Log Manager",
               "Xen XL Config",
 
-              "Perf",
+              "Perf", /* 65 */
+              "Libssh transport layer",
     )
 
 
@@ -1400,6 +1401,12 @@ virErrorMsg(virErrorNumber error, const char *info)
             else
                 errmsg = _("guest agent replied with wrong id to guest-sync command: %s");
             break;
+        case VIR_ERR_LIBSSH:
+            if (info == NULL)
+                errmsg = _("libssh transport error");
+            else
+                errmsg = _("libssh transport error: %s");
+            break;
     }
     return errmsg;
 }
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]