virsh-volume.c: Switch to C99 initialization of vshCmdOptDef

This commit is contained in:
Michal Privoznik 2013-01-14 15:48:52 +01:00
parent 8571608924
commit 4909bcbbc1

View File

@ -112,21 +112,47 @@ static const vshCmdInfo info_vol_create_as[] = {
}; };
static const vshCmdOptDef opts_vol_create_as[] = { static const vshCmdOptDef opts_vol_create_as[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, {.name = "pool",
{"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the volume")}, .type = VSH_OT_DATA,
{"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, .flags = VSH_OFLAG_REQ,
N_("size of the vol, as scaled integer (default bytes)")}, .help = N_("pool name")
{"allocation", VSH_OT_STRING, 0, },
N_("initial allocation size, as scaled integer (default bytes)")}, {.name = "name",
{"format", VSH_OT_STRING, 0, .type = VSH_OT_DATA,
N_("file format type raw,bochs,qcow,qcow2,qed,vmdk")}, .flags = VSH_OFLAG_REQ,
{"backing-vol", VSH_OT_STRING, 0, .help = N_("name of the volume")
N_("the backing volume if taking a snapshot")}, },
{"backing-vol-format", VSH_OT_STRING, 0, {.name = "capacity",
N_("format of backing volume if taking a snapshot")}, .type = VSH_OT_DATA,
{"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " .flags = VSH_OFLAG_REQ,
"instead of full allocation)")}, .help = N_("size of the vol, as scaled integer (default bytes)")
{NULL, 0, 0, NULL} },
{.name = "allocation",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("initial allocation size, as scaled integer (default bytes)")
},
{.name = "format",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("file format type raw,bochs,qcow,qcow2,qed,vmdk")
},
{.name = "backing-vol",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("the backing volume if taking a snapshot")
},
{.name = "backing-vol-format",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("format of backing volume if taking a snapshot")
},
{.name = "prealloc-metadata",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
{.name = NULL}
}; };
static int static int
@ -290,11 +316,22 @@ static const vshCmdInfo info_vol_create[] = {
}; };
static const vshCmdOptDef opts_vol_create[] = { static const vshCmdOptDef opts_vol_create[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, {.name = "pool",
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, .type = VSH_OT_DATA,
{"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " .flags = VSH_OFLAG_REQ,
"instead of full allocation)")}, .help = N_("pool name")
{NULL, 0, 0, NULL} },
{.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML vol description")
},
{.name = "prealloc-metadata",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
{.name = NULL}
}; };
static bool static bool
@ -349,13 +386,32 @@ static const vshCmdInfo info_vol_create_from[] = {
}; };
static const vshCmdOptDef opts_vol_create_from[] = { static const vshCmdOptDef opts_vol_create_from[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, .type = VSH_OT_DATA,
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("input vol name or key")}, .flags = VSH_OFLAG_REQ,
{"inputpool", VSH_OT_STRING, 0, N_("pool name or uuid of the input volume's pool")}, .help = N_("pool name or uuid")
{"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " },
"instead of full allocation)")}, {.name = "file",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML vol description")
},
{.name = "vol",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("input vol name or key")
},
{.name = "inputpool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid of the input volume's pool")
},
{.name = "prealloc-metadata",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
{.name = NULL}
}; };
static bool static bool
@ -446,12 +502,27 @@ static const vshCmdInfo info_vol_clone[] = {
}; };
static const vshCmdOptDef opts_vol_clone[] = { static const vshCmdOptDef opts_vol_clone[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("orig vol name or key")}, {.name = "vol",
{"newname", VSH_OT_DATA, VSH_OFLAG_REQ, N_("clone name")}, .type = VSH_OT_DATA,
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .flags = VSH_OFLAG_REQ,
{"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " .help = N_("orig vol name or key")
"instead of full allocation)")}, },
{NULL, 0, 0, NULL} {.name = "newname",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("clone name")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = "prealloc-metadata",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
{.name = NULL}
}; };
static bool static bool
@ -525,12 +596,32 @@ static const vshCmdInfo info_vol_upload[] = {
}; };
static const vshCmdOptDef opts_vol_upload[] = { static const vshCmdOptDef opts_vol_upload[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, .type = VSH_OT_DATA,
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .flags = VSH_OFLAG_REQ,
{"offset", VSH_OT_INT, 0, N_("volume offset to upload to") }, .help = N_("vol name, key or path")
{"length", VSH_OT_INT, 0, N_("amount of data to upload") }, },
{NULL, 0, 0, NULL} {.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = "offset",
.type = VSH_OT_INT,
.flags = 0,
.help = N_("volume offset to upload to")
},
{.name = "length",
.type = VSH_OT_INT,
.flags = 0,
.help = N_("amount of data to upload")
},
{.name = NULL}
}; };
static int static int
@ -620,12 +711,32 @@ static const vshCmdInfo info_vol_download[] = {
}; };
static const vshCmdOptDef opts_vol_download[] = { static const vshCmdOptDef opts_vol_download[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, .type = VSH_OT_DATA,
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .flags = VSH_OFLAG_REQ,
{"offset", VSH_OT_INT, 0, N_("volume offset to download from") }, .help = N_("vol name, key or path")
{"length", VSH_OT_INT, 0, N_("amount of data to download") }, },
{NULL, 0, 0, NULL} {.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = "offset",
.type = VSH_OT_INT,
.flags = 0,
.help = N_("volume offset to download from")
},
{.name = "length",
.type = VSH_OT_INT,
.flags = 0,
.help = N_("amount of data to download")
},
{.name = NULL}
}; };
static bool static bool
@ -713,9 +824,17 @@ static const vshCmdInfo info_vol_delete[] = {
}; };
static const vshCmdOptDef opts_vol_delete[] = { static const vshCmdOptDef opts_vol_delete[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("vol name, key or path")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -750,10 +869,22 @@ static const vshCmdInfo info_vol_wipe[] = {
}; };
static const vshCmdOptDef opts_vol_wipe[] = { static const vshCmdOptDef opts_vol_wipe[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{"algorithm", VSH_OT_STRING, 0, N_("perform selected wiping algorithm")}, .flags = VSH_OFLAG_REQ,
{NULL, 0, 0, NULL} .help = N_("vol name, key or path")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = "algorithm",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("perform selected wiping algorithm")
},
{.name = NULL}
}; };
VIR_ENUM_DECL(virStorageVolWipeAlgorithm) VIR_ENUM_DECL(virStorageVolWipeAlgorithm)
@ -814,9 +945,17 @@ static const vshCmdInfo info_vol_info[] = {
}; };
static const vshCmdOptDef opts_vol_info[] = { static const vshCmdOptDef opts_vol_info[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("vol name, key or path")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -878,16 +1017,37 @@ static const vshCmdInfo info_vol_resize[] = {
}; };
static const vshCmdOptDef opts_vol_resize[] = { static const vshCmdOptDef opts_vol_resize[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, .type = VSH_OT_DATA,
N_("new capacity for the vol, as scaled integer (default bytes)")}, .flags = VSH_OFLAG_REQ,
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .help = N_("vol name, key or path")
{"allocate", VSH_OT_BOOL, 0, },
N_("allocate the new capacity, rather than leaving it sparse")}, {.name = "capacity",
{"delta", VSH_OT_BOOL, 0, .type = VSH_OT_DATA,
N_("use capacity as a delta to current size, rather than the new size")}, .flags = VSH_OFLAG_REQ,
{"shrink", VSH_OT_BOOL, 0, N_("allow the resize to shrink the volume")}, .help = N_("new capacity for the vol, as scaled integer (default bytes)")
{NULL, 0, 0, NULL} },
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = "allocate",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("allocate the new capacity, rather than leaving it sparse")
},
{.name = "delta",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("use capacity as a delta to current size, rather than the new size")
},
{.name = "shrink",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("allow the resize to shrink the volume")
},
{.name = NULL}
}; };
static bool static bool
@ -960,9 +1120,17 @@ static const vshCmdInfo info_vol_dumpxml[] = {
}; };
static const vshCmdOptDef opts_vol_dumpxml[] = { static const vshCmdOptDef opts_vol_dumpxml[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("vol name, key or path")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -1122,9 +1290,17 @@ static const vshCmdInfo info_vol_list[] = {
}; };
static const vshCmdOptDef opts_vol_list[] = { static const vshCmdOptDef opts_vol_list[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, {.name = "pool",
{"details", VSH_OT_BOOL, 0, N_("display extended details for volumes")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("pool name or uuid")
},
{.name = "details",
.type = VSH_OT_BOOL,
.flags = 0,
.help = N_("display extended details for volumes")
},
{.name = NULL}
}; };
static bool static bool
@ -1391,8 +1567,12 @@ static const vshCmdInfo info_vol_name[] = {
}; };
static const vshCmdOptDef opts_vol_name[] = { static const vshCmdOptDef opts_vol_name[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, {.name = "vol",
{NULL, 0, 0, NULL} .type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("volume key or path")
},
{.name = NULL}
}; };
static bool static bool
@ -1419,9 +1599,17 @@ static const vshCmdInfo info_vol_pool[] = {
}; };
static const vshCmdOptDef opts_vol_pool[] = { static const vshCmdOptDef opts_vol_pool[] = {
{"uuid", VSH_OT_BOOL, 0, N_("return the pool uuid rather than pool name")}, {.name = "uuid",
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, .type = VSH_OT_BOOL,
{NULL, 0, 0, NULL} .flags = 0,
.help = N_("return the pool uuid rather than pool name")
},
{.name = "vol",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("volume key or path")
},
{.name = NULL}
}; };
static bool static bool
@ -1471,9 +1659,17 @@ static const vshCmdInfo info_vol_key[] = {
}; };
static const vshCmdOptDef opts_vol_key[] = { static const vshCmdOptDef opts_vol_key[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or path")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("volume name or path")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool
@ -1499,9 +1695,17 @@ static const vshCmdInfo info_vol_path[] = {
}; };
static const vshCmdOptDef opts_vol_path[] = { static const vshCmdOptDef opts_vol_path[] = {
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or key")}, {.name = "vol",
{"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, .type = VSH_OT_DATA,
{NULL, 0, 0, NULL} .flags = VSH_OFLAG_REQ,
.help = N_("volume name or key")
},
{.name = "pool",
.type = VSH_OT_STRING,
.flags = 0,
.help = N_("pool name or uuid")
},
{.name = NULL}
}; };
static bool static bool