[libvirt] [PATCH 06/12] virsh: Create macros for VSH_OT_ARGV "domain" option

Lin Ma lma at suse.com
Fri May 4 09:25:27 UTC 2018


Signed-off-by: Lin Ma <lma at suse.com>
---
 tools/virsh-domain-monitor.c | 3 +++
 tools/virsh-domain.c         | 3 +++
 tools/virsh-snapshot.c       | 3 +++
 tools/virsh.h                | 9 +++++++++
 4 files changed, 18 insertions(+)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 8ad651626b..e4a21534cb 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -46,6 +46,9 @@
 #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
     VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
 
+#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
+    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
+
 VIR_ENUM_DECL(virshDomainIOError)
 VIR_ENUM_IMPL(virshDomainIOError,
               VIR_DOMAIN_DISK_ERROR_LAST,
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 689f9d686b..89aefbf86a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -71,6 +71,9 @@
 #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
     VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
 
+#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
+    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
+
 #define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \
     {.name = "persistent", \
      .type = VSH_OT_BOOL, \
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 3d86ac84d1..0c86b6c950 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -48,6 +48,9 @@
 #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
     VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
 
+#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
+    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
+
 /* Helper for snapshot-create and snapshot-create-as */
 static bool
 virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
diff --git a/tools/virsh.h b/tools/virsh.h
index 9dcf104cc4..a33d108b2d 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -115,6 +115,15 @@
      .completer_flags = cflags, \
     }
 
+# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \
+    {.name = "domain", \
+     .type = VSH_OT_ARGV, \
+     .flags = VSH_OFLAG_NONE, \
+     .help = _helpstr, \
+     .completer = virshDomainNameCompleter, \
+     .completer_flags = cflags, \
+    }
+
 typedef struct _virshControl virshControl;
 typedef virshControl *virshControlPtr;
 
-- 
2.15.1




More information about the libvir-list mailing list