static const vshCmdOptDef opts_attach_device[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("XML file")
- },
+ VIRSH_COMMON_OPT_FILE(N_("XML file")),
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
VIRSH_COMMON_OPT_DOMAIN_LIVE,
static const vshCmdOptDef opts_save[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("where to save the data")
- },
+ VIRSH_COMMON_OPT_FILE(N_("where to save the data")),
{.name = "bypass-cache",
.type = VSH_OT_BOOL,
.help = N_("avoid file system cache when saving")
};
static const vshCmdOptDef opts_save_image_dumpxml[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("saved state file to read")
- },
+ VIRSH_COMMON_OPT_FILE(N_("saved state file to read")),
{.name = "security-info",
.type = VSH_OT_BOOL,
.help = N_("include security sensitive information in XML dump")
};
static const vshCmdOptDef opts_save_image_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("saved state file to modify")
- },
+ VIRSH_COMMON_OPT_FILE(N_("saved state file to modify")),
{.name = "xml",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
};
static const vshCmdOptDef opts_save_image_edit[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("saved state file to edit")
- },
+ VIRSH_COMMON_OPT_FILE(N_("saved state file to edit")),
{.name = "running",
.type = VSH_OT_BOOL,
.help = N_("set domain to be running on restore")
};
static const vshCmdOptDef opts_restore[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("the state to restore")
- },
+ VIRSH_COMMON_OPT_FILE(N_("the state to restore")),
{.name = "bypass-cache",
.type = VSH_OT_BOOL,
.help = N_("avoid file system cache when restoring")
static const vshCmdOptDef opts_dump[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("where to dump the core")
- },
+ VIRSH_COMMON_OPT_FILE(N_("where to dump the core")),
VIRSH_COMMON_OPT_LIVE(N_("perform a live core dump if supported")),
{.name = "crash",
.type = VSH_OT_BOOL,
};
static const vshCmdOptDef opts_cpu_compare[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML CPU description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML CPU description")),
{.name = "error",
.type = VSH_OT_BOOL,
.help = N_("report error if CPUs are incompatible")
};
static const vshCmdOptDef opts_cpu_baseline[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing XML CPU descriptions")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing XML CPU descriptions")),
{.name = "features",
.type = VSH_OT_BOOL,
.help = N_("Show features that are part of the CPU model type")
};
static const vshCmdOptDef opts_create[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML domain description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML domain description")),
#ifndef WIN32
{.name = "console",
.type = VSH_OT_BOOL,
};
static const vshCmdOptDef opts_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML domain description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML domain description")),
{.name = "validate",
.type = VSH_OT_BOOL,
.help = N_("validate the XML against the schema")
static const vshCmdOptDef opts_detach_device[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("XML file")
- },
+ VIRSH_COMMON_OPT_FILE(N_("XML file")),
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
VIRSH_COMMON_OPT_DOMAIN_LIVE,
static const vshCmdOptDef opts_update_device[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("XML file")
- },
+ VIRSH_COMMON_OPT_FILE(N_("XML file")),
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
VIRSH_COMMON_OPT_DOMAIN_LIVE,
/*
* virsh-interface.c: Commands to manage host interface
*
- * Copyright (C) 2005, 2007-2015 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
};
static const vshCmdOptDef opts_interface_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML interface description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML interface description")),
{.name = NULL}
};
};
static const vshCmdOptDef opts_network_create[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML network description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML network description")),
{.name = NULL}
};
};
static const vshCmdOptDef opts_network_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML network description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML network description")),
{.name = NULL}
};
/*
* virsh-nodedev.c: Commands in node device group
*
- * Copyright (C) 2005, 2007-2013 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
};
static const vshCmdOptDef opts_node_device_create[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML description of the device")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML description "
+ "of the device")),
{.name = NULL}
};
/*
* virsh-nwfilter.c: Commands to manage network filters
*
- * Copyright (C) 2005, 2007-2015 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
};
static const vshCmdOptDef opts_nwfilter_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML network filter description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML network "
+ "filter description")),
{.name = NULL}
};
#define VIRSH_COMMON_OPT_POOL_FULL \
VIRSH_COMMON_OPT_POOL(N_("pool name or uuid")) \
-#define VIRSH_COMMON_OPT_POOL_FILE \
- {.name = "file", \
- .type = VSH_OT_DATA, \
- .flags = VSH_OFLAG_REQ, \
- .help = N_("file containing an XML pool description") \
- } \
-
#define VIRSH_COMMON_OPT_POOL_BUILD \
{.name = "build", \
.type = VSH_OT_BOOL, \
};
static const vshCmdOptDef opts_pool_create[] = {
- VIRSH_COMMON_OPT_POOL_FILE,
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML pool description")),
VIRSH_COMMON_OPT_POOL_BUILD,
VIRSH_COMMON_OPT_POOL_NO_OVERWRITE,
VIRSH_COMMON_OPT_POOL_OVERWRITE,
};
static const vshCmdOptDef opts_pool_define[] = {
- VIRSH_COMMON_OPT_POOL_FILE,
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML pool description")),
{.name = NULL}
};
/*
* virsh-secret.c: Commands to manage secret
*
- * Copyright (C) 2005, 2007-2015 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
};
static const vshCmdOptDef opts_secret_define[] = {
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing secret attributes in XML")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing secret attributes in XML")),
{.name = NULL}
};
/*
* virsh-volume.c: Commands to manage storage volume
*
- * Copyright (C) 2005, 2007-2014 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static const vshCmdOptDef opts_vol_create[] = {
VIRSH_COMMON_OPT_POOL_NAME,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML vol description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML vol description")),
{.name = "prealloc-metadata",
.type = VSH_OT_BOOL,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
static const vshCmdOptDef opts_vol_create_from[] = {
VIRSH_COMMON_OPT_POOL_FULL,
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file containing an XML vol description")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file containing an XML vol description")),
{.name = "vol",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.flags = VSH_OFLAG_REQ,
.help = N_("vol name, key or path")
},
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file")),
VIRSH_COMMON_OPT_POOL_OPTIONAL,
{.name = "offset",
.type = VSH_OT_INT,
.flags = VSH_OFLAG_REQ,
.help = N_("vol name, key or path")
},
- {.name = "file",
- .type = VSH_OT_DATA,
- .flags = VSH_OFLAG_REQ,
- .help = N_("file")
- },
+ VIRSH_COMMON_OPT_FILE(N_("file")),
VIRSH_COMMON_OPT_POOL_OPTIONAL,
{.name = "offset",
.type = VSH_OT_INT,
.help = _helpstr \
} \
+# define VIRSH_COMMON_OPT_FILE(_helpstr) \
+ {.name = "file", \
+ .type = VSH_OT_DATA, \
+ .flags = VSH_OFLAG_REQ, \
+ .help = _helpstr \
+ } \
+
typedef struct _virshControl virshControl;
typedef virshControl *virshControlPtr;