From: Peter Krempa Date: Mon, 22 Jun 2015 14:10:49 +0000 (+0200) Subject: test: Refactor testNodeGetCPUMap X-Git-Tag: v1.2.17-rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=774fd39984bf56bca27894195d0b98078f01fe41;p=thirdparty%2Flibvirt.git test: Refactor testNodeGetCPUMap Drop locking of the driver since it is not accessed and simplify the code flow. --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index fcc31b05ff..d38006f59c 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -5617,31 +5617,23 @@ static int testConnectListAllDomains(virConnectPtr conn, } static int -testNodeGetCPUMap(virConnectPtr conn, +testNodeGetCPUMap(virConnectPtr conn ATTRIBUTE_UNUSED, unsigned char **cpumap, unsigned int *online, unsigned int flags) { - testDriverPtr privconn = conn->privateData; - int ret = -1; - virCheckFlags(0, -1); - testDriverLock(privconn); if (cpumap) { if (VIR_ALLOC_N(*cpumap, 1) < 0) - goto cleanup; + return -1; *cpumap[0] = 0x15; } if (online) *online = 3; - ret = 8; - - cleanup: - testDriverUnlock(privconn); - return ret; + return 8; } static char *