diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 963eecb241..9d89c940bf 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); - virAsprintf(&ret, "%02X:%02X", maj, min); + ignore_value(virAsprintf(&ret, "%02X:%02X", maj, min)); } return ret; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 0a60bb861a..c7d2dfd4e0 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -60,6 +60,7 @@ #include "dnsmasq.h" #include "util/network.h" #include "configmake.h" +#include "ignore-value.h" #define NETWORK_PID_DIR LOCALSTATEDIR "/run/libvirt/network" #define NETWORK_STATE_DIR LOCALSTATEDIR "/lib/libvirt/network" @@ -125,8 +126,8 @@ networkDnsmasqLeaseFileNameDefault(const char *netname) { char *leasefile; - virAsprintf(&leasefile, DNSMASQ_STATE_DIR "/%s.leases", - netname); + ignore_value(virAsprintf(&leasefile, DNSMASQ_STATE_DIR "/%s.leases", + netname)); return leasefile; } @@ -139,7 +140,7 @@ networkRadvdPidfileBasename(const char *netname) /* this is simple but we want to be sure it's consistently done */ char *pidfilebase; - virAsprintf(&pidfilebase, "%s-radvd", netname); + ignore_value(virAsprintf(&pidfilebase, "%s-radvd", netname)); return pidfilebase; } @@ -148,8 +149,8 @@ networkRadvdConfigFileName(const char *netname) { char *configfile; - virAsprintf(&configfile, RADVD_STATE_DIR "/%s-radvd.conf", - netname); + ignore_value(virAsprintf(&configfile, RADVD_STATE_DIR "/%s-radvd.conf", + netname)); return configfile; } @@ -166,12 +167,13 @@ networkBridgeDummyNicName(const char *brname) * a possible numeric ending (eg virbr0, virbr1, etc), we grab * the first 8 and last 3 characters of the string. */ - virAsprintf(&nicname, "%.*s%s%s", - /* space for last 3 chars + "-nic" + NULL */ - (int)(IFNAMSIZ - (3 + sizeof(dummyNicSuffix))), - brname, brname + strlen(brname) - 3, dummyNicSuffix); + ignore_value(virAsprintf(&nicname, "%.*s%s%s", + /* space for last 3 chars + "-nic" + NULL */ + (int)(IFNAMSIZ - (3 + sizeof(dummyNicSuffix))), + brname, brname + strlen(brname) - 3, + dummyNicSuffix)); } else { - virAsprintf(&nicname, "%s%s", brname, dummyNicSuffix); + ignore_value(virAsprintf(&nicname, "%s%s", brname, dummyNicSuffix)); } return nicname; } diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index df2079e49a..b9dc712056 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -710,7 +710,7 @@ openvzGenerateContainerVethName(int veid) } /* set new name */ - virAsprintf(&name, "eth%d", max + 1); + ignore_value(virAsprintf(&name, "eth%d", max + 1)); } VIR_FREE(temp); diff --git a/src/util/command.c b/src/util/command.c index 475eb62857..26fcb287f9 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -1543,11 +1543,13 @@ virCommandTranslateStatus(int status) { char *buf; if (WIFEXITED(status)) { - virAsprintf(&buf, _("exit status %d"), WEXITSTATUS(status)); + ignore_value(virAsprintf(&buf, _("exit status %d"), + WEXITSTATUS(status))); } else if (WIFSIGNALED(status)) { - virAsprintf(&buf, _("fatal signal %d"), WTERMSIG(status)); + ignore_value(virAsprintf(&buf, _("fatal signal %d"), + WTERMSIG(status))); } else { - virAsprintf(&buf, _("invalid value %d"), status); + ignore_value(virAsprintf(&buf, _("invalid value %d"), status)); } return buf; } diff --git a/src/util/storage_file.c b/src/util/storage_file.c index 68e82a9f2c..f33ea74a92 100644 --- a/src/util/storage_file.c +++ b/src/util/storage_file.c @@ -512,7 +512,7 @@ absolutePathFromBaseFile(const char *base_file, const char *path) if (d_len > INT_MAX) return NULL; - virAsprintf(&res, "%.*s/%s", (int) d_len, base_file, path); + ignore_value(virAsprintf(&res, "%.*s/%s", (int) d_len, base_file, path)); return res; }