[PATCH v3 1/3] virerror: Introduce VIR_ERR_OPERATION_UNSAFE

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

 



Similarly to VIR_ERR_MIGRATION_UNSAFE add a error code which will be
reported when an operation is possible with the hypervisor but may lead
to data loss or other problems in certain cases. This error code
notifies the user that the operation can be forced using a specific
flag.
---
 include/libvirt/virterror.h | 1 +
 src/util/virerror.c         | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 2efee8f0c..04fea2e34 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -319,6 +319,7 @@ typedef enum {
     VIR_ERR_AGENT_UNSYNCED = 97,        /* guest agent replies with wrong id
                                            to guest-sync command */
     VIR_ERR_LIBSSH = 98,                /* error in libssh transport driver */
+    VIR_ERR_OPERATION_UNSAFE = 99,      /* unsafe operation requiring override */
 } virErrorNumber;

 /**
diff --git a/src/util/virerror.c b/src/util/virerror.c
index ef17fb5e6..1437cf02b 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1407,6 +1407,11 @@ virErrorMsg(virErrorNumber error, const char *info)
             else
                 errmsg = _("libssh transport error: %s");
             break;
+        case VIR_ERR_OPERATION_UNSAFE:
+            if (info == NULL)
+                errmsg = _("operation unsafe");
+            else
+                errmsg = _("operation unsafe: %s");
     }
     return errmsg;
 }
-- 
2.12.1

--
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]
  Powered by Linux