mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemu: change two-state int parameters to bool
This commit is contained in:
parent
817a67b925
commit
5debc7224a
@ -917,7 +917,7 @@ error:
|
||||
static int
|
||||
virQEMUCapsComputeCmdFlags(const char *help,
|
||||
unsigned int version,
|
||||
unsigned int is_kvm,
|
||||
bool is_kvm,
|
||||
unsigned int kvm_version,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
bool check_yajl ATTRIBUTE_UNUSED)
|
||||
@ -1221,7 +1221,7 @@ int virQEMUCapsParseHelpStr(const char *qemu,
|
||||
const char *help,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
unsigned int *version,
|
||||
unsigned int *is_kvm,
|
||||
bool *is_kvm,
|
||||
unsigned int *kvm_version,
|
||||
bool check_yajl)
|
||||
{
|
||||
@ -1229,7 +1229,8 @@ int virQEMUCapsParseHelpStr(const char *qemu,
|
||||
const char *p = help;
|
||||
char *strflags;
|
||||
|
||||
*version = *is_kvm = *kvm_version = 0;
|
||||
*version = *kvm_version = 0;
|
||||
*is_kvm = false;
|
||||
|
||||
if (STRPREFIX(p, QEMU_VERSION_STR_1))
|
||||
p += strlen(QEMU_VERSION_STR_1);
|
||||
@ -1262,12 +1263,12 @@ int virQEMUCapsParseHelpStr(const char *qemu,
|
||||
SKIP_BLANKS(p);
|
||||
|
||||
if (STRPREFIX(p, QEMU_KVM_VER_PREFIX)) {
|
||||
*is_kvm = 1;
|
||||
*is_kvm = true;
|
||||
p += strlen(QEMU_KVM_VER_PREFIX);
|
||||
} else if (STRPREFIX(p, KVM_VER_PREFIX)) {
|
||||
int ret;
|
||||
|
||||
*is_kvm = 1;
|
||||
*is_kvm = true;
|
||||
p += strlen(KVM_VER_PREFIX);
|
||||
|
||||
ret = virParseNumber(&p);
|
||||
@ -2282,7 +2283,7 @@ static int
|
||||
virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid)
|
||||
{
|
||||
virCommandPtr cmd = NULL;
|
||||
unsigned int is_kvm;
|
||||
bool is_kvm;
|
||||
char *help = NULL;
|
||||
int ret = -1;
|
||||
const char *tmp;
|
||||
|
@ -261,7 +261,7 @@ int virQEMUCapsParseHelpStr(const char *qemu,
|
||||
const char *str,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
unsigned int *version,
|
||||
unsigned int *is_kvm,
|
||||
bool *is_kvm,
|
||||
unsigned int *kvm_version,
|
||||
bool check_yajl);
|
||||
/* Only for use by test suite */
|
||||
|
@ -331,7 +331,7 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
|
||||
virNetDevVPortProfilePtr virtPort,
|
||||
const virMacAddrPtr macaddr,
|
||||
const unsigned char *uuid,
|
||||
int associate)
|
||||
bool associate)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
@ -376,7 +376,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
|
||||
int ret = -1;
|
||||
int vf = -1;
|
||||
int vlanid = -1;
|
||||
int port_profile_associate = 1;
|
||||
bool port_profile_associate = true;
|
||||
int isvf;
|
||||
|
||||
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
||||
@ -441,7 +441,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
|
||||
virNetDevVPortProfilePtr virtPort;
|
||||
int ret = -1;
|
||||
int vf = -1;
|
||||
int port_profile_associate = 0;
|
||||
bool port_profile_associate = false;
|
||||
int isvf;
|
||||
|
||||
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
||||
|
@ -15,7 +15,7 @@ struct testInfo {
|
||||
const char *name;
|
||||
virQEMUCapsPtr flags;
|
||||
unsigned int version;
|
||||
unsigned int is_kvm;
|
||||
bool is_kvm;
|
||||
unsigned int kvm_version;
|
||||
};
|
||||
|
||||
@ -39,7 +39,8 @@ static int testHelpStrParsing(const void *data)
|
||||
const struct testInfo *info = data;
|
||||
char *path = NULL;
|
||||
char *help = NULL;
|
||||
unsigned int version, is_kvm, kvm_version;
|
||||
unsigned int version, kvm_version;
|
||||
bool is_kvm;
|
||||
virQEMUCapsPtr flags = NULL;
|
||||
int ret = -1;
|
||||
char *got = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user