typedef struct {
const char *name; /* the name of option, or NULL for list end */
vshCmdOptType type; /* option type */
- int flag; /* flags */
+ unsigned int flags; /* flags */
const char *help; /* non-NULL help string */
} vshCmdOptDef;
virDomainPtr dom;
bool ret = true;
const char *name = NULL;
- int flags = 0;
+ unsigned int flags = 0;
int managed_save = vshCommandOptBool(cmd, "managed-save");
int has_managed_save = 0;
int rc = -1;
const char *name = NULL;
const char *to = NULL;
bool ret = false;
- int flags = 0;
+ unsigned int flags = 0;
const char *xmlfile = NULL;
char *xml = NULL;
{
const char *file = NULL;
bool ret = false;
- int flags = 0;
+ unsigned int flags = 0;
char *xml = NULL;
if (vshCommandOptBool(cmd, "security-info"))
char *tmp = NULL;
char *doc = NULL;
char *doc_edited = NULL;
- int flags = VIR_DOMAIN_XML_SECURE;
+ unsigned int flags = VIR_DOMAIN_XML_SECURE;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
virDomainPtr dom;
const char *name;
bool ret = false;
- int flags = 0;
+ unsigned int flags = 0;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
{
const char *from = NULL;
bool ret = false;
- int flags = 0;
+ unsigned int flags = 0;
const char *xmlfile = NULL;
char *xml = NULL;
const char *name = NULL;
const char *to = NULL;
bool ret = false;
- int flags = 0;
+ unsigned int flags = 0;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
int live = vshCommandOptBool(cmd, "live");
int current = vshCommandOptBool(cmd, "current");
bool query = false; /* Query mode if no cpulist */
- int flags = 0;
+ unsigned int flags = 0;
if (current) {
if (live || config) {
int config = vshCommandOptBool(cmd, "config");
int live = vshCommandOptBool(cmd, "live");
int current = vshCommandOptBool(cmd, "current");
- int flags = 0;
+ unsigned int flags = 0;
if (current) {
if (live || config) {
int config = vshCommandOptBool(cmd, "config");
int live = vshCommandOptBool(cmd, "live");
int current = vshCommandOptBool(cmd, "current");
- int flags = 0;
+ unsigned int flags = 0;
if (current) {
if (live || config) {
int config = vshCommandOptBool(cmd, "config");
int live = vshCommandOptBool(cmd, "live");
int current = vshCommandOptBool(cmd, "current");
- int flags = VIR_DOMAIN_MEM_MAXIMUM;
+ unsigned int flags = VIR_DOMAIN_MEM_MAXIMUM;
if (current) {
if (live || config) {
virDomainPtr dom;
bool ret = true;
char *dump;
- int flags = 0;
+ unsigned int flags = 0;
int inactive = vshCommandOptBool(cmd, "inactive");
int secure = vshCommandOptBool(cmd, "security-info");
int update = vshCommandOptBool(cmd, "update-cpu");
const char *configFile = NULL;
char *configData;
char *xmlData;
- int flags = 0;
+ unsigned int flags = 0;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
const char *xmlFile = NULL;
char *configData;
char *xmlData;
- int flags = 0;
+ unsigned int flags = 0;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
const char *desturi = NULL;
const char *migrateuri = NULL;
const char *dname = NULL;
- int flags = 0;
+ unsigned int flags = 0;
vshCtrlData *data = opaque;
vshControl *ctl = data->ctl;
const vshCmd *cmd = data->cmd;
char *doc = NULL;
char *doc_edited = NULL;
char *doc_reread = NULL;
- int flags = VIR_INTERFACE_XML_INACTIVE;
+ unsigned int flags = VIR_INTERFACE_XML_INACTIVE;
if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
virInterfacePtr iface;
bool ret = true;
char *dump;
- int flags = 0;
+ unsigned int flags = 0;
int inactive = vshCommandOptBool(cmd, "inactive");
if (inactive)
char *doc = NULL;
char *doc_edited = NULL;
char *doc_reread = NULL;
- int flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE;
+ unsigned int flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE;
if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (i > 31)
return -1; /* too many options */
if (opt->type == VSH_OT_BOOL) {
- if (opt->flag & VSH_OFLAG_REQ)
+ if (opt->flags & VSH_OFLAG_REQ)
return -1; /* bool options can't be mandatory */
continue;
}
- if (opt->flag & VSH_OFLAG_REQ_OPT) {
- if (opt->flag & VSH_OFLAG_REQ)
+ if (opt->flags & VSH_OFLAG_REQ_OPT) {
+ if (opt->flags & VSH_OFLAG_REQ)
*opts_required |= 1 << i;
continue;
}
*opts_need_arg |= 1 << i;
- if (opt->flag & VSH_OFLAG_REQ) {
+ if (opt->flags & VSH_OFLAG_REQ) {
if (optional)
return -1; /* mandatory options must be listed first */
*opts_required |= 1 << i;
break;
case VSH_OT_INT:
/* xgettext:c-format */
- fmt = ((opt->flag & VSH_OFLAG_REQ) ? "<%s>"
+ fmt = ((opt->flags & VSH_OFLAG_REQ) ? "<%s>"
: _("[--%s <number>]"));
break;
case VSH_OT_STRING:
fmt = _("[--%s <string>]");
break;
case VSH_OT_DATA:
- fmt = ((opt->flag & VSH_OFLAG_REQ) ? "<%s>" : "[<%s>]");
+ fmt = ((opt->flags & VSH_OFLAG_REQ) ? "<%s>" : "[<%s>]");
break;
case VSH_OT_ARGV:
/* xgettext:c-format */
- fmt = (opt->flag & VSH_OFLAG_REQ) ? _("<%s>...")
+ fmt = (opt->flags & VSH_OFLAG_REQ) ? _("<%s>...")
: _("[<%s>]...");
break;
default:
break;
case VSH_OT_INT:
snprintf(buf, sizeof(buf),
- (opt->flag & VSH_OFLAG_REQ) ? _("[--%s] <number>")
+ (opt->flags & VSH_OFLAG_REQ) ? _("[--%s] <number>")
: _("--%s <number>"), opt->name);
break;
case VSH_OT_STRING:
if (!valid->name)
break;
if (STREQ(name, valid->name))
- return (valid->flag & VSH_OFLAG_REQ) == 0 ? 0 : -1;
+ return (valid->flags & VSH_OFLAG_REQ) == 0 ? 0 : -1;
valid++;
}
/* If we got here, the name is unknown. */
return -2;
}
- if (!*arg->data && !(arg->def->flag & VSH_OFLAG_EMPTY_OK)) {
+ if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) {
return -1;
}
*value = arg->data;