diff --git a/cfg.mk b/cfg.mk index 147e788a6d46f30cdda6d89cebd76c13a51abfc4..66b49e6c830fff2f897a1c8dd9425fe893495b28 100644 --- a/cfg.mk +++ b/cfg.mk @@ -900,7 +900,7 @@ exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \ ^python/(libvirt-(lxc-|qemu-)?override|typewrappers)\.c$$ exclude_file_name_regexp--sc_prohibit_asprintf = \ - ^(bootstrap.conf$$|src/util/virstring\.c$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$) + ^(bootstrap.conf$$|src/util/virstring\.[ch]$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$) exclude_file_name_regexp--sc_prohibit_strdup = \ ^(docs/|examples/|python/|src/util/virstring\.c$$) diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 97e71f7934f811d66a94ff26d97aa7d9074cab70..e53daf8b9180854b4b551849298b074bcbec1b32 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -46,7 +46,7 @@ virDomainAuditGetRdev(const char *path) (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode))) { int maj = major(sb.st_rdev); int min = minor(sb.st_rdev); - ignore_value(virAsprintf(&ret, "%02X:%02X", maj, min)); + ignore_value(virAsprintfQuiet(&ret, "%02X:%02X", maj, min)); } return ret; } @@ -382,29 +382,29 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: switch (hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - if (virAsprintf(&address, "%.4x:%.2x:%.2x.%.1x", - hostdev->source.subsys.u.pci.addr.domain, - hostdev->source.subsys.u.pci.addr.bus, - hostdev->source.subsys.u.pci.addr.slot, - hostdev->source.subsys.u.pci.addr.function) < 0) { + if (virAsprintfQuiet(&address, "%.4x:%.2x:%.2x.%.1x", + hostdev->source.subsys.u.pci.addr.domain, + hostdev->source.subsys.u.pci.addr.bus, + hostdev->source.subsys.u.pci.addr.slot, + hostdev->source.subsys.u.pci.addr.function) < 0) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: - if (virAsprintf(&address, "%.3d.%.3d", - hostdev->source.subsys.u.usb.bus, - hostdev->source.subsys.u.usb.device) < 0) { + if (virAsprintfQuiet(&address, "%.3d.%.3d", + hostdev->source.subsys.u.usb.bus, + hostdev->source.subsys.u.usb.device) < 0) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: - if (virAsprintf(&address, "%s:%d:%d:%d", - hostdev->source.subsys.u.scsi.adapter, - hostdev->source.subsys.u.scsi.bus, - hostdev->source.subsys.u.scsi.target, - hostdev->source.subsys.u.scsi.unit) < 0) { + if (virAsprintfQuiet(&address, "%s:%d:%d:%d", + hostdev->source.subsys.u.scsi.adapter, + hostdev->source.subsys.u.scsi.bus, + hostdev->source.subsys.u.scsi.target, + hostdev->source.subsys.u.scsi.unit) < 0) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } @@ -654,8 +654,8 @@ virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup, { char *extra; - if (virAsprintf(&extra, "major category=%s maj=%02X acl=%s", - name, maj, perms) < 0) { + if (virAsprintfQuiet(&extra, "major category=%s maj=%02X acl=%s", + name, maj, perms) < 0) { VIR_WARN("OOM while encoding audit message"); return; } @@ -693,8 +693,8 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup, rdev = virDomainAuditGetRdev(path); if (!(detail = virAuditEncode("path", path)) || - virAsprintf(&extra, "path %s rdev=%s acl=%s", - detail, VIR_AUDIT_STR(rdev), perms) < 0) { + virAsprintfQuiet(&extra, "path %s rdev=%s acl=%s", + detail, VIR_AUDIT_STR(rdev), perms) < 0) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } diff --git a/src/driver.c b/src/driver.c index c35fcd2de2ba81702f21574a68480d27be07e8bc..a08dd34cbe56c4589ddc9e8566c674fffedf2846 100644 --- a/src/driver.c +++ b/src/driver.c @@ -65,7 +65,7 @@ virDriverLoadModule(const char *name) VIR_DEBUG("Module load %s", name); - if (virAsprintf(&modfile, "%s/libvirt_driver_%s.so", moddir, name) < 0) + if (virAsprintfQuiet(&modfile, "%s/libvirt_driver_%s.so", moddir, name) < 0) return NULL; if (access(modfile, R_OK) < 0) { @@ -79,7 +79,7 @@ virDriverLoadModule(const char *name) goto cleanup; } - if (virAsprintf(®func, "%sRegister", name) < 0) { + if (virAsprintfQuiet(®func, "%sRegister", name) < 0) { goto cleanup; } diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6df55005e921a2b1fae56c1d1fdce22c2743b27a..59583ec7e2925ce2bf003a602c9016b5b6f54689 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1871,7 +1871,7 @@ virStorageFileResize; # util/virstring.h virArgvToString; -virAsprintf; +virAsprintfInternal; virSkipSpaces; virSkipSpacesAndBackslash; virSkipSpacesBackwards; @@ -1892,7 +1892,7 @@ virStrToLong_ui; virStrToLong_ul; virStrToLong_ull; virTrimSpaces; -virVasprintf; +virVasprintfInternal; # util/virsysinfo.h diff --git a/src/util/virerror.c b/src/util/virerror.c index e238dceda1290e2db0fd63cb0a8465e1282838bb..ce3ab859f2803e1db013683632b3838f2d2107e5 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -674,7 +674,7 @@ virRaiseErrorFull(const char *filename ATTRIBUTE_UNUSED, } else { va_list ap; va_start(ap, fmt); - ignore_value(virVasprintf(&str, fmt, ap)); + ignore_value(virVasprintfQuiet(&str, fmt, ap)); va_end(ap); } diff --git a/src/util/virlog.c b/src/util/virlog.c index 20af4ce5364da15402176e7f52fb9dbb898779c5..1efa65d3e252703da0d067dc7469c8d7651bef41 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -711,13 +711,13 @@ virLogFormatString(char **msg, * to just grep for it to find the right place. */ if ((funcname != NULL)) { - ret = virAsprintf(msg, "%llu: %s : %s:%d : %s\n", - virThreadSelfID(), virLogPriorityString(priority), - funcname, linenr, str); + ret = virAsprintfQuiet(msg, "%llu: %s : %s:%d : %s\n", + virThreadSelfID(), virLogPriorityString(priority), + funcname, linenr, str); } else { - ret = virAsprintf(msg, "%llu: %s : %s\n", - virThreadSelfID(), virLogPriorityString(priority), - str); + ret = virAsprintfQuiet(msg, "%llu: %s : %s\n", + virThreadSelfID(), virLogPriorityString(priority), + str); } return ret; } @@ -833,7 +833,7 @@ virLogVMessage(virLogSource source, /* * serialize the error message, add level and timestamp */ - if (virVasprintf(&str, fmt, vargs) < 0) { + if (virVasprintfQuiet(&str, fmt, vargs) < 0) { goto cleanup; } @@ -945,7 +945,7 @@ virLogOutputToFd(virLogSource source ATTRIBUTE_UNUSED, if (fd < 0) return; - if (virAsprintf(&msg, "%s: %s", timestamp, str) < 0) + if (virAsprintfQuiet(&msg, "%s: %s", timestamp, str) < 0) return; ignore_value(safewrite(fd, msg, strlen(msg))); diff --git a/src/util/virstring.c b/src/util/virstring.c index 1937f82858fc2353c92274917d136b2c567f4e40..6fc015b093aba413f865d7fe373669b1dc685db6 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -321,35 +321,41 @@ virStrToDouble(char const *s, return 0; } -/** - * virVasprintf - * - * like glibc's vasprintf but makes sure *strp == NULL on failure - */ int -virVasprintf(char **strp, const char *fmt, va_list list) +virVasprintfInternal(bool report, + int domcode, + const char *filename, + const char *funcname, + size_t linenr, + char **strp, + const char *fmt, + va_list list) { int ret; - if ((ret = vasprintf(strp, fmt, list)) == -1) + if ((ret = vasprintf(strp, fmt, list)) == -1) { + if (report) + virReportOOMErrorFull(domcode, filename, funcname, linenr); *strp = NULL; - + } return ret; } -/** - * virAsprintf - * - * like glibc's_asprintf but makes sure *strp == NULL on failure - */ int -virAsprintf(char **strp, const char *fmt, ...) +virAsprintfInternal(bool report, + int domcode, + const char *filename, + const char *funcname, + size_t linenr, + char **strp, + const char *fmt, ...) { va_list ap; int ret; va_start(ap, fmt); - ret = virVasprintf(strp, fmt, ap); + ret = virVasprintfInternal(report, domcode, filename, + funcname, linenr, strp, fmt, ap); va_end(ap); return ret; } diff --git a/src/util/virstring.h b/src/util/virstring.h index 34ffae118a9631b25455a53b25c07ea599d12332..8b66b23fdc8b4907a1024e51acd3be8735418bd4 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -76,12 +76,6 @@ void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1); void virSkipSpacesBackwards(const char *str, char **endp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virAsprintf(char **strp, const char *fmt, ...) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3) - ATTRIBUTE_RETURN_CHECK; -int virVasprintf(char **strp, const char *fmt, va_list list) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 0) - ATTRIBUTE_RETURN_CHECK; char *virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) ATTRIBUTE_RETURN_CHECK; char *virStrcpy(char *dest, const char *src, size_t destbytes) @@ -96,6 +90,16 @@ int virStrdup(char **dest, const char *src, bool report, int domcode, int virStrndup(char **dest, const char *src, ssize_t n, bool report, int domcode, const char *filename, const char *funcname, size_t linenr) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1); +int virAsprintfInternal(bool report, int domcode, const char *filename, + const char *funcname, size_t linenr, char **strp, + const char *fmt, ...) + ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7) ATTRIBUTE_FMT_PRINTF(7, 8) + ATTRIBUTE_RETURN_CHECK; +int virVasprintfInternal(bool report, int domcode, const char *filename, + const char *funcname, size_t linenr, char **strp, + const char *fmt, va_list list) + ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7) ATTRIBUTE_FMT_PRINTF(7, 0) + ATTRIBUTE_RETURN_CHECK; /** * VIR_STRDUP: @@ -166,4 +170,55 @@ int virStrndup(char **dest, const char *src, ssize_t n, bool report, int domcode size_t virStringListLength(char **strings); +/** + * virVasprintf + * + * Like glibc's vasprintf but makes sure *strp == NULL on failure, in which + * case the OOM error is reported too. + * + * Returns -1 on failure (with OOM error reported), 0 on success. + */ +# define virVasprintf(strp, fmt, list) \ + virVasprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, \ + __LINE__, strp, fmt, list) + +/** + * virVasprintfQuiet + * + * Like glibc's vasprintf but makes sure *strp == NULL on failure. + * + * Returns -1 on failure, 0 on success. + */ +# define virVasprintfQuiet(strp, fmt, list) \ + virVasprintfInternal(false, 0, NULL, NULL, 0, strp, fmt, list) + +/** + * virAsprintf: + * @strp: variable to hold result (char **) + * @fmt: printf format + * + * Like glibc's_asprintf but makes sure *strp == NULL on failure, in which case + * the OOM error is reported too. + * + * Returns -1 on failure (with OOM error reported), 0 on success. + */ + +# define virAsprintf(strp, ...) \ + virAsprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__, \ + strp, __VA_ARGS__) + +/** + * virAsprintfQuiet: + * @strp: variable to hold result (char **) + * @fmt: printf format + * + * Like glibc's_asprintf but makes sure *strp == NULL on failure. + * + * Returns -1 on failure, 0 on success. + */ + +# define virAsprintfQuiet(strp, ...) \ + virAsprintfInternal(false, 0, NULL, NULL, 0, \ + strp, __VA_ARGS__) + #endif /* __VIR_STRING_H__ */ diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 9eddf458fe2c10353254e7f3258ec26155b729e8..defa9553e481d678cc9ec136c3d05c3fed64ea04 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -18,6 +18,8 @@ # include "testutilsqemu.h" # include "virstring.h" +# define VIR_FROM_THIS VIR_FROM_NONE + static virQEMUDriver driver; static int diff --git a/tests/fchosttest.c b/tests/fchosttest.c index 76d1795f754497939f9a555261cb985f91e59044..05ff20ba6944c6abc69dcf55b629b9ab9fb75e16 100644 --- a/tests/fchosttest.c +++ b/tests/fchosttest.c @@ -23,6 +23,8 @@ #include "virutil.h" #include "testutils.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static char *fchost_prefix; #define TEST_FC_HOST_PREFIX fchost_prefix diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index 9d86198bcbc706de2da3a6e8ae020b39bddc9b48..8092a5964a8425337790744967419ed9edb9bec7 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *xml) { diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 97f792c25e14a6bb106292e4ea70dc7ff0f04fa5..ca05d291f755d4e79595995f7dffad1eb7e40ce3 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -17,6 +17,8 @@ # include "testutilslxc.h" # include "virstring.h" +# define VIR_FROM_THIS VIR_FROM_NONE + static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 5eca143ccce2a8cd14ed4fba3acca774ccada85c..0dfed161ac7d745f22bb18bb10ff82ded20f6b63 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml, unsigned int flags) diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index ed49857089976d8f29d8c209b96224a81c3b6741..d4f7ee742564de10bc41db7ceee723ee7cb06ed8 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *xml) { diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index bce56f3f536e0722d1a307896fcbb95779c50455..def366cad8b397c200603a9d01898ec5f144b48b 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -11,6 +11,8 @@ #include "virfile.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + #if ! (defined __linux__ && (defined(__x86_64__) || \ defined(__amd64__) || \ defined(__i386__) || \ diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index 158bc9f4ce1071971b53846d22334bb54d8ee4a8..5476284d7318a635fbe56b783cb5efaa10d6c7e7 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -17,6 +17,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml, bool expect_error) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 652cd09219320f2154e50bb3d7ff10220971cfb1..5cf78289869842826cd06fa4ea4f9ce12529ed8e 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -17,6 +17,8 @@ # include "testutilsqemu.h" # include "virstring.h" +# define VIR_FROM_THIS VIR_FROM_NONE + static virQEMUDriver driver; static int blankProblemElements(char *data) diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 2a3b019068c7998ee27b3afdfaa2f2e594ce97d2..3826849db3ef773c0023c37a426f427d92130e86 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -11,6 +11,8 @@ # include "viralloc.h" # include "virstring.h" +# define VIR_FROM_THIS VIR_FROM_NONE + struct testInfo { const char *name; virQEMUCapsPtr flags; diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index f8daff9eb05cfce032916f7f9435c547d720d044..76570c5c9560ed6ea5b554caea03062c8eee478a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -18,6 +18,8 @@ # include "testutilsqemu.h" # include "virstring.h" +# define VIR_FROM_THIS VIR_FROM_NONE + static virQEMUDriver driver; static int diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index f4d119e3b3f5d062885cb46d776e87ad399fda22..eafefda0c72646c9af5f94f2d24da9fd24617a2e 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsxen.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static virCapsPtr caps; static int diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 0376e63b54ee62e41cfb34fa19d60b6df35373fe..53a7f83ca177dfda56d2877fa906f773e87e6ed3 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml) { diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 6a6c8e3e1c60fb4168de285e8db02a87bbc7bf63..89c233fa7bf6686110fdf04a30a97b4237f4fd9e 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -7,6 +7,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + const char create_tool[] = "qemu-img"; static int diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index e87b0163bae53b91f68f1d62f853c21f0a3689c7..05d2306f45197f89744cd7d1dc8a3d73b37dad12 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -14,6 +14,8 @@ #include "testutilsqemu.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareXMLToXMLFiles(const char *poolxml, const char *inxml, const char *outxml) diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index dc0451b8d3d15ab5a1f28008c760b49dd9f8f845..ba57a7a740b1cc10f80471f72b904bc6246401e2 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -36,6 +36,8 @@ #include "virfile.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + #if defined (__linux__) # if defined(__s390__) || defined(__s390x__) || \ diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 3938f0df57bfbc3187dc69addb17804aaf3b893d..febe6e456cca12c9aba93f4568b8aea2f447d4d6 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -10,6 +10,8 @@ #include "viralloc.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + #define TEST_ERROR(...) \ do { \ if (virTestGetDebug()) \ diff --git a/tests/virhashtest.c b/tests/virhashtest.c index f36fc76c7ce2fc92bd239bf8732e7244e540d512..9b7fcbbf5804f97909efeeebf0237aa7d0d84ea6 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -13,6 +13,8 @@ #include "virlog.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + #define testError(...) \ do { \ char *str; \ diff --git a/tests/virshtest.c b/tests/virshtest.c index fad67745be3178028f232739d7168d979a6398d9..ca35bb0acad065ab5e641d73301bc762f7cff563 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -9,6 +9,8 @@ #include "testutils.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + #ifdef WIN32 int diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 8bdd6cde138d0e4ba0976e0747b085bc790316cd..9de3919fef230a8813bdb58be7101617c21436a0 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -12,6 +12,8 @@ #include "virfile.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static int testCompareFiles(virArch hostmachine, const char *xml_rel, const char *cpuinfo_rel, const char *capabilities_rel) diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index ec196c41d4aded3b20298999327f02029d29d2fb..87ac2c3e2037d62da7b7ac4a36b8933f400bb700 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -16,6 +16,8 @@ #include "testutilsxen.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index c17c2574d1b3081af2dab859499e94abd551fc51..496324e63bc6c2d8cbf261d9d077a1a9838ff982 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -33,6 +33,8 @@ #include "virt-host-validate-common.h" #include "virstring.h" +#define VIR_FROM_THIS VIR_FROM_NONE + static bool quiet; void virHostMsgSetQuiet(bool quietFlag)