Signed-off-by: Lin Ma <lma@xxxxxxxx> --- tools/virsh-domain-monitor.c | 3 +++ tools/virsh-domain.c | 3 +++ tools/virsh-snapshot.c | 3 +++ tools/virsh.h | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 8e071779b4..8ad651626b 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -43,6 +43,9 @@ #define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags) +#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \ + VIRSH_COMMON_OPT_DOMAIN_OT_STRING(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 6601f94a12..8a63761fab 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -68,6 +68,9 @@ #define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags) +#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_PERSISTENT \ {.name = "persistent", \ .type = VSH_OT_BOOL, \ diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index e4908eea70..3d86ac84d1 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -45,6 +45,9 @@ #define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags) +#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \ + VIRSH_COMMON_OPT_DOMAIN_OT_STRING(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 f2213ebb57..9dcf104cc4 100644 --- a/tools/virsh.h +++ b/tools/virsh.h @@ -107,6 +107,14 @@ .help = _helpstr \ } +# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, cflags) \ + {.name = "domain", \ + .type = VSH_OT_STRING, \ + .help = _helpstr, \ + .completer = virshDomainNameCompleter, \ + .completer_flags = cflags, \ + } + typedef struct _virshControl virshControl; typedef virshControl *virshControlPtr; -- 2.15.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list