mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
test: Refactor testNodeGetCPUMap
Drop locking of the driver since it is not accessed and simplify the code flow.
This commit is contained in:
parent
3dd859c0c2
commit
774fd39984
@ -5617,31 +5617,23 @@ static int testConnectListAllDomains(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testNodeGetCPUMap(virConnectPtr conn,
|
testNodeGetCPUMap(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||||
unsigned char **cpumap,
|
unsigned char **cpumap,
|
||||||
unsigned int *online,
|
unsigned int *online,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
testDriverPtr privconn = conn->privateData;
|
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
testDriverLock(privconn);
|
|
||||||
if (cpumap) {
|
if (cpumap) {
|
||||||
if (VIR_ALLOC_N(*cpumap, 1) < 0)
|
if (VIR_ALLOC_N(*cpumap, 1) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
*cpumap[0] = 0x15;
|
*cpumap[0] = 0x15;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (online)
|
if (online)
|
||||||
*online = 3;
|
*online = 3;
|
||||||
|
|
||||||
ret = 8;
|
return 8;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
testDriverUnlock(privconn);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user