if (!log)
goto cleanup;
- for (i = 1; i < argc; i++) {
+ for (i = 1; i < argc; i++)
fprintf(log, "ARG:%s\n", argv[i]);
- }
origenv = environ;
n = 0;
goto failure;
}
- if (paths[i].result < 0) {
+ if (paths[i].result < 0)
continue;
- }
if (STRNEQ(paths[i].datastoreName, datastoreName)) {
virtTestDifference(stderr, paths[i].datastoreName, datastoreName);
return -1;
}
- if (times[i].calendarTime != calendarTime) {
+ if (times[i].calendarTime != calendarTime)
return -1;
- }
}
return 0;
escaped = esxUtil_EscapeDatastoreItem(datastoreItems[i].string);
- if (escaped == NULL) {
+ if (escaped == NULL)
return -1;
- }
if (STRNEQ(datastoreItems[i].escaped, escaped)) {
VIR_FREE(escaped);
utf8 = virVMXConvertToUTF8("Windows-1252",
windows1252ToUTF8[i].windows1252);
- if (utf8 == NULL) {
+ if (utf8 == NULL)
return -1;
- }
if (STRNEQ(windows1252ToUTF8[i].utf8, utf8)) {
VIR_FREE(utf8);
ATTRIBUTE_NORETURN static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) {
while (1) {
pthread_mutex_lock(&eventThreadMutex);
- while (!eventThreadRunOnce) {
+ while (!eventThreadRunOnce)
pthread_cond_wait(&eventThreadRunCond, &eventThreadMutex);
- }
eventThreadRunOnce = 0;
pthread_mutex_unlock(&eventThreadMutex);
char *conf = NULL;
char *value = NULL;
- if (virAsprintf(&conf, "%s/openvzutilstest.conf", abs_srcdir) < 0) {
+ if (virAsprintf(&conf, "%s/openvzutilstest.conf", abs_srcdir) < 0)
return -1;
- }
for (i = 0; i < ARRAY_CARDINALITY(configParams); ++i) {
if (openvzReadConfigParam(conf, configParams[i].param,
goto cleanup;
}
- if (configParams[i].ret != 1) {
+ if (configParams[i].ret != 1)
continue;
- }
if (STRNEQ(configParams[i].value, value)) {
virtTestDifference(stderr, configParams[i].value, value);
abs_srcdir, testname) < 0)
goto cleanup;
- if (!(fp = fopen(path, "r"))) {
+ if (!(fp = fopen(path, "r")))
goto cleanup;
- }
if (VIR_ALLOC_N(line, 1024) < 0)
goto cleanup;
abs_srcdir, testname) < 0)
goto cleanup;
- if (virFileReadAll(xmlfile, 1024*1024, &xmlstr) < 0) {
+ if (virFileReadAll(xmlfile, 1024*1024, &xmlstr) < 0)
goto cleanup;
- }
if (!(def = virDomainDefParseString(xmlstr, caps, xmlopt,
QEMU_EXPECTED_VIRT_TYPES,
pthread_cond_signal(&cond);
}
- while (!quit) {
+ while (!quit)
pthread_cond_wait(&cond, &lock);
- }
pthread_mutex_unlock(&lock);
return NULL;
/* Wait for the thread to start and call libvirt */
pthread_mutex_lock(&lock);
- while (!running && !failstart) {
+ while (!running && !failstart)
pthread_cond_wait(&cond, &lock);
- }
/* Close the shared library (and thus make libvirt.so
* non-resident */
return -1;
}
- if (result < 0) {
+ if (result < 0)
continue;
- }
if (version != versions[i].version) {
if (virTestGetDebug() > 0) {
* which was the case after the above addchar at the time of the bug.
* This test is a bit fragile, since it relies on virBuffer internals.
*/
- if (virAsprintf(&addstr, "%*s", buf->a - buf->b - 1, "a") < 0) {
+ if (virAsprintf(&addstr, "%*s", buf->a - buf->b - 1, "a") < 0)
goto out;
- }
if (info->doEscape)
virBufferEscapeString(buf, "%s", addstr);
virHashAddEntry(hash, keya, value3) < 0 ||
virHashAddEntry(hash, keyc, value1) < 0 ||
virHashAddEntry(hash, keyb, value2) < 0) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to create hash");
- }
goto cleanup;
}
if (!(array = virHashGetItems(hash, NULL)) ||
array[3].key || array[3].value) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to get items with NULL sort");
- }
goto cleanup;
}
VIR_FREE(array);
STRNEQ(array[2].key, "c") ||
STRNEQ(array[2].value, "1") ||
array[3].key || array[3].value) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to get items with key sort");
- }
goto cleanup;
}
VIR_FREE(array);
STRNEQ(array[2].key, "a") ||
STRNEQ(array[2].value, "3") ||
array[3].key || array[3].value) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to get items with value sort");
- }
goto cleanup;
}
virHashAddEntry(hash1, keyc, value3_l) < 0 ||
virHashAddEntry(hash2, keya, value1_u) < 0 ||
virHashAddEntry(hash2, keyb, value2_u) < 0) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to create hashes");
- }
goto cleanup;
}
if (virHashEqual(hash1, hash2, testHashEqualCompValue)) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed equal test for different number of elements");
- }
goto cleanup;
}
if (virHashAddEntry(hash2, keyc, value4_u) < 0) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to add element to hash2");
- }
goto cleanup;
}
if (virHashEqual(hash1, hash2, testHashEqualCompValue)) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed equal test for same number of elements");
- }
goto cleanup;
}
if (virHashUpdateEntry(hash2, keyc, value3_u) < 0) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed to update element in hash2");
- }
goto cleanup;
}
if (!virHashEqual(hash1, hash2, testHashEqualCompValue)) {
- if (virTestGetVerbose()) {
+ if (virTestGetVerbose())
testError("\nfailed equal test for equal hash tables");
- }
goto cleanup;
}
}
tzset();
- if (virTimeLocalOffsetFromUTC(&actual) < 0) {
+ if (virTimeLocalOffsetFromUTC(&actual) < 0)
return -1;
- }
if (data->offset != actual) {
VIR_DEBUG("Expect Offset %ld got %ld\n",
caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
- if (caps == NULL) {
+ if (caps == NULL)
return;
- }
virCapabilitiesAddHostMigrateTransport(caps, "esx");
VIR_ARCH_I686,
NULL, NULL, 0, NULL);
- if (guest == NULL) {
+ if (guest == NULL)
goto failure;
- }
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
NULL) == NULL) {
VIR_ARCH_X86_64,
NULL, NULL, 0, NULL);
- if (guest == NULL) {
+ if (guest == NULL)
goto failure;
- }
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
NULL) == NULL) {
testCapsInit();
- if (caps == NULL) {
+ if (caps == NULL)
return EXIT_FAILURE;
- }
if (!(xmlopt = virVMXDomainXMLConfInit()))
return EXIT_FAILURE;
caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
- if (caps == NULL) {
+ if (caps == NULL)
return;
- }
virCapabilitiesAddHostMigrateTransport(caps, "esx");
VIR_ARCH_I686,
NULL, NULL, 0, NULL);
- if (guest == NULL) {
+ if (guest == NULL)
goto failure;
- }
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
NULL) == NULL) {
VIR_ARCH_X86_64,
NULL, NULL, 0, NULL);
- if (guest == NULL) {
+ if (guest == NULL)
goto failure;
- }
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
NULL) == NULL) {
char *formatted = NULL;
virDomainDefPtr def = NULL;
- if (virtTestLoadFile(xml, &xmlData) < 0) {
+ if (virtTestLoadFile(xml, &xmlData) < 0)
goto failure;
- }
- if (virtTestLoadFile(vmx, &vmxData) < 0) {
+ if (virtTestLoadFile(vmx, &vmxData) < 0)
goto failure;
- }
def = virDomainDefParseString(xmlData, caps, xmlopt,
1 << VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_XML_INACTIVE);
- if (def == NULL) {
+ if (def == NULL)
goto failure;
- }
if (!virDomainDefCheckABIStability(def, def)) {
fprintf(stderr, "ABI stability check failed on %s", xml);
formatted = virVMXFormatConfig(&ctx, xmlopt, def, virtualHW_version);
- if (formatted == NULL) {
+ if (formatted == NULL)
goto failure;
- }
if (STRNEQ(vmxData, formatted)) {
virtTestDifference(stderr, vmxData, formatted);
success = true;
cleanup:
- if (! success) {
+ if (! success)
VIR_FREE(absolutePath);
- }
VIR_FREE(copyOfDatastorePath);
testCapsInit();
- if (caps == NULL) {
+ if (caps == NULL)
return EXIT_FAILURE;
- }
if (!(xmlopt = virVMXDomainXMLConfInit()))
return EXIT_FAILURE;