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