[PATCH 08/23] virsh: Move 'virshDomainBlockJobToString' to virsh-util

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

 



The helper function is used in virshBlockJobInfo and also in the
callbacks of cmdEvent. Upcoming patch is going to move out the event
code into a helper so this needs to be in a shared place.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-domain.c | 19 -------------------
 tools/virsh-util.c   | 19 +++++++++++++++++++
 tools/virsh-util.h   |  5 +++++
 3 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 33984618eb..9c304dbf78 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2614,25 +2614,6 @@ static const vshCmdOptDef opts_blockjob[] = {
     {.name = NULL}
 };

-VIR_ENUM_DECL(virshDomainBlockJob);
-VIR_ENUM_IMPL(virshDomainBlockJob,
-              VIR_DOMAIN_BLOCK_JOB_TYPE_LAST,
-              N_("Unknown job"),
-              N_("Block Pull"),
-              N_("Block Copy"),
-              N_("Block Commit"),
-              N_("Active Block Commit"),
-              N_("Backup"),
-);
-
-static const char *
-virshDomainBlockJobToString(int type)
-{
-    const char *str = virshDomainBlockJobTypeToString(type);
-    return str ? _(str) : _("Unknown job");
-}
-
-
 static bool
 virshBlockJobInfo(vshControl *ctl,
                   virDomainPtr dom,
diff --git a/tools/virsh-util.c b/tools/virsh-util.c
index 8fb617fa3c..dc6ed7a86d 100644
--- a/tools/virsh-util.c
+++ b/tools/virsh-util.c
@@ -418,3 +418,22 @@ virshDomainGetXML(vshControl *ctl,

     return ret;
 }
+
+
+VIR_ENUM_IMPL(virshDomainBlockJob,
+              VIR_DOMAIN_BLOCK_JOB_TYPE_LAST,
+              N_("Unknown job"),
+              N_("Block Pull"),
+              N_("Block Copy"),
+              N_("Block Commit"),
+              N_("Active Block Commit"),
+              N_("Backup"),
+);
+
+
+const char *
+virshDomainBlockJobToString(int type)
+{
+    const char *str = virshDomainBlockJobTypeToString(type);
+    return str ? _(str) : _("Unknown job");
+}
diff --git a/tools/virsh-util.h b/tools/virsh-util.h
index 838935d5e8..4d4fe6c01e 100644
--- a/tools/virsh-util.h
+++ b/tools/virsh-util.h
@@ -151,3 +151,8 @@ virshDomainGetXML(vshControl *ctl,
                   xmlXPathContextPtr *ctxt)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
     ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT;
+
+VIR_ENUM_DECL(virshDomainBlockJob);
+
+const char *
+virshDomainBlockJobToString(int type);
-- 
2.35.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]

  Powered by Linux