"ebtables --concurrent -t nat -X libvirt-I-vnet0\n"
"ebtables --concurrent -t nat -F libvirt-O-vnet0\n"
"ebtables --concurrent -t nat -X libvirt-O-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
"ebtables --concurrent -t nat -L libvirt-P-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-J-vnet0 libvirt-I-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-P-vnet0 libvirt-O-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
"ebtables --concurrent -t nat -X libvirt-J-vnet0\n"
"ebtables --concurrent -t nat -F libvirt-P-vnet0\n"
"ebtables --concurrent -t nat -X libvirt-P-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
const char *expected =
VIR_NWFILTER_NEW_RULES_TEARDOWN;
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
"ebtables --concurrent -t nat -A libvirt-J-vnet0 -j DROP\n"
"ebtables --concurrent -t nat -A PREROUTING -i vnet0 -j libvirt-J-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-J-vnet0 libvirt-I-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
virMacAddr mac = { .addr = { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60 } };
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
"ebtables --concurrent -t nat -A POSTROUTING -o vnet0 -j libvirt-P-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-J-vnet0 libvirt-I-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-P-vnet0 libvirt-O-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
virMacAddr mac = { .addr = { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60 } };
const char *servers[] = { "192.168.122.1", "10.0.0.1", "10.0.0.2" };
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
"ebtables --concurrent -t nat -A POSTROUTING -o vnet0 -j libvirt-P-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-J-vnet0 libvirt-I-vnet0\n"
"ebtables --concurrent -t nat -E libvirt-P-vnet0 libvirt-O-vnet0\n";
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
ret = 0;
cleanup:
- VIR_FREE(actual);
return ret;
}
{
GHashTable *tmpvars = NULL;
int ret = -1;
- char *xml;
+ g_autofree char *xml = NULL;
xml = g_strdup_printf("%s/nwfilterxml2firewalldata/%s.xml", abs_srcdir,
inc->filterref);
if (ret < 0)
virNWFilterInstReset(inst);
virHashFree(tmpvars);
- VIR_FREE(xml);
return ret;
}
static int testCompareXMLToArgvFiles(const char *xml,
const char *cmdline)
{
- char *actualargv = NULL;
+ g_autofree char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
GHashTable *vars = virHashNew(virNWFilterVarValueHashFree);
virNWFilterInst inst;
ret = 0;
cleanup:
- VIR_FREE(actualargv);
virNWFilterInstReset(&inst);
virHashFree(vars);
return ret;
{
int result = -1;
const struct testInfo *info = data;
- char *xml = NULL;
- char *args = NULL;
+ g_autofree char *xml = NULL;
+ g_autofree char *args = NULL;
xml = g_strdup_printf("%s/nwfilterxml2firewalldata/%s.xml",
abs_srcdir, info->name);
result = testCompareXMLToArgvFiles(xml, args);
- VIR_FREE(xml);
- VIR_FREE(args);
return result;
}
testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
bool expect_error)
{
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
virNWFilterDef *dev = NULL;
ret = 0;
fail:
- VIR_FREE(actual);
virNWFilterDefFree(dev);
return ret;
}
{
int result = -1;
const test_parms *tp = data;
- char *inxml = NULL;
- char *outxml = NULL;
+ g_autofree char *inxml = NULL;
+ g_autofree char *outxml = NULL;
inxml = g_strdup_printf("%s/nwfilterxml2xmlin/%s.xml", abs_srcdir, tp->name);
outxml = g_strdup_printf("%s/nwfilterxml2xmlout/%s.xml", abs_srcdir, tp->name);
result = testCompareXMLToXMLFiles(inxml, outxml, tp->expect_warning);
- VIR_FREE(inxml);
- VIR_FREE(outxml);
-
return result;
}