Make use of the common VIRSH_COMMON_OPT_DOMAIN macro for each of the
matching '.name = "domain"' command options.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
tools/virsh-snapshot.c | 60 +++++++++-----------------------------------------
1 file changed, 10 insertions(+), 50 deletions(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 3ab2104..b806d7c 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -123,11 +123,7 @@ static const vshCmdInfo info_snapshot_create[] = {
};
static const vshCmdOptDef opts_snapshot_create[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "xmlfile",
.type = VSH_OT_STRING,
.help = N_("domain snapshot XML")
@@ -328,11 +324,7 @@ static const vshCmdInfo info_snapshot_create_as[] = {
};
static const vshCmdOptDef opts_snapshot_create_as[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "name",
.type = VSH_OT_STRING,
.help = N_("name of snapshot")
@@ -524,11 +516,7 @@ static const vshCmdInfo info_snapshot_edit[] = {
};
static const vshCmdOptDef opts_snapshot_edit[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_STRING,
.help = N_("snapshot name")
@@ -645,11 +633,7 @@ static const vshCmdInfo info_snapshot_current[] = {
};
static const vshCmdOptDef opts_snapshot_current[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "name",
.type = VSH_OT_BOOL,
.help = N_("list the name, rather than the full xml")
@@ -882,11 +866,7 @@ static const vshCmdInfo info_snapshot_info[] = {
};
static const vshCmdOptDef opts_snapshot_info[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_STRING,
.help = N_("snapshot name")
@@ -1441,11 +1421,7 @@ static const vshCmdInfo info_snapshot_list[] = {
};
static const vshCmdOptDef opts_snapshot_list[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "parent",
.type = VSH_OT_BOOL,
.help = N_("add a column showing parent snapshot")
@@ -1705,11 +1681,7 @@ static const vshCmdInfo info_snapshot_dumpxml[] = {
};
static const vshCmdOptDef opts_snapshot_dumpxml[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
@@ -1773,11 +1745,7 @@ static const vshCmdInfo info_snapshot_parent[] = {
};
static const vshCmdOptDef opts_snapshot_parent[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_STRING,
.help = N_("find parent of snapshot name")
@@ -1841,11 +1809,7 @@ static const vshCmdInfo info_snapshot_revert[] = {
};
static const vshCmdOptDef opts_snapshot_revert[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_STRING,
.help = N_("snapshot name")
@@ -1934,11 +1898,7 @@ static const vshCmdInfo info_snapshot_delete[] = {
};
static const vshCmdOptDef opts_snapshot_delete[] = {
- {.name = "domain",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("domain name, id or uuid")
- },
+ VIRSH_COMMON_OPT_DOMAIN,
{.name = "snapshotname",
.type = VSH_OT_STRING,
.help = N_("snapshot name")
--
2.5.0