There's no difference between virAsprintf() and
virAsprintfQuiet(). Fix places where the latter
is used to use the former.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_audit.c | 38 ++++++++---------
src/locking/lock_driver_sanlock.c | 2 +-
src/security/virt-aa-helper.c | 27 ++++++------
src/util/virdevmapper.c | 6 +--
src/util/virerror.c | 2 +-
src/util/viriptables.c | 4 +-
src/util/virkmod.c | 2 +-
src/util/virlog.c | 16 +++----
src/util/virprocess.c | 6 +--
tests/nssmock.c | 6 +--
tests/scsihosttest.c | 12 +++---
tests/vircgroupmock.c | 8 ++--
tests/virfilemock.c | 2 +-
tests/virfilewrapper.c | 2 +-
tests/virnetdevmock.c | 4 +-
tests/virnumamock.c | 2 +-
tests/virpcimock.c | 70 +++++++++++++++----------------
tests/virtestmock.c | 2 +-
tests/virusbmock.c | 2 +-
19 files changed, 106 insertions(+), 107 deletions(-)
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index 98b80e5bec..2a52e7dc7f 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -53,7 +53,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);
- virAsprintfQuiet(&ret, "%02X:%02X", maj, min);
+ virAsprintf(&ret, "%02X:%02X", maj, min);
}
return ret;
}
@@ -101,8 +101,8 @@ virDomainAuditGenericDev(virDomainObjPtr vm,
if (!newsrcpath && !oldsrcpath)
return;
- virAsprintfQuiet(&newdev, "new-%s", type);
- virAsprintfQuiet(&olddev, "old-%s", type);
+ virAsprintf(&newdev, "new-%s", type);
+ virAsprintf(&olddev, "old-%s", type);
virUUIDFormat(vm->def->uuid, uuidstr);
@@ -373,15 +373,15 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr
hostdev,
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
- virAsprintfQuiet(&address,
- VIR_PCI_DEVICE_ADDRESS_FMT,
- pcisrc->addr.domain,
- pcisrc->addr.bus,
- pcisrc->addr.slot,
- pcisrc->addr.function);
+ virAsprintf(&address,
+ VIR_PCI_DEVICE_ADDRESS_FMT,
+ pcisrc->addr.domain,
+ pcisrc->addr.bus,
+ pcisrc->addr.slot,
+ pcisrc->addr.function);
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
- virAsprintfQuiet(&address, "%.3d.%.3d", usbsrc->bus,
usbsrc->device);
+ virAsprintf(&address, "%.3d.%.3d", usbsrc->bus,
usbsrc->device);
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: {
if (scsisrc->protocol ==
@@ -393,10 +393,10 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr
hostdev,
} else {
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
&scsisrc->u.host;
- virAsprintfQuiet(&address, "%s:%u:%u:%llu",
- scsihostsrc->adapter, scsihostsrc->bus,
- scsihostsrc->target,
- scsihostsrc->unit);
+ virAsprintf(&address, "%s:%u:%u:%llu",
+ scsihostsrc->adapter, scsihostsrc->bus,
+ scsihostsrc->target,
+ scsihostsrc->unit);
}
break;
}
@@ -648,8 +648,8 @@ virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup,
{
char *extra;
- virAsprintfQuiet(&extra, "major category=%s maj=%02X acl=%s",
- name, maj, perms);
+ virAsprintf(&extra, "major category=%s maj=%02X acl=%s",
+ name, maj, perms);
virDomainAuditCgroup(vm, cgroup, reason, extra, success);
@@ -688,8 +688,8 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup,
goto cleanup;
}
- virAsprintfQuiet(&extra, "path %s rdev=%s acl=%s",
- detail, VIR_AUDIT_STR(rdev), perms);
+ virAsprintf(&extra, "path %s rdev=%s acl=%s",
+ detail, VIR_AUDIT_STR(rdev), perms);
virDomainAuditCgroup(vm, cgroup, reason, extra, rc == 0);
@@ -926,7 +926,7 @@ virDomainAuditShmem(virDomainObjPtr vm,
goto cleanup;
}
- virAsprintfQuiet(&shmpath, "/dev/shm/%s", def->name);
+ virAsprintf(&shmpath, "/dev/shm/%s", def->name);
if (!virt) {
VIR_WARN("Unexpected virt type %d while encoding audit message",
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 0aee93c195..55f0a3621d 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -103,7 +103,7 @@ virLockManagerSanlockError(int err,
#if HAVE_SANLOCK_STRERROR
*message = g_strdup(sanlock_strerror(err));
#else
- virAsprintfQuiet(message, _("sanlock error %d"), err);
+ virAsprintf(message, _("sanlock error %d"), err);
#endif
return true;
} else {
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 3fe2da22ef..c2679cdad2 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -157,7 +157,7 @@ parserCommand(const char *profile_name, const char cmd)
snprintf(flag, 3, "-%c", cmd);
- virAsprintfQuiet(&profile, "%s/%s", APPARMOR_DIR "/libvirt",
profile_name);
+ virAsprintf(&profile, "%s/%s", APPARMOR_DIR "/libvirt",
profile_name);
if (!virFileExists(profile)) {
vah_error(NULL, 0, _("profile does not exist"));
@@ -214,9 +214,9 @@ update_include_file(const char *include_file, const char
*included_files,
}
if (append && virFileExists(include_file))
- virAsprintfQuiet(&pcontent, "%s%s", existing, included_files);
+ virAsprintf(&pcontent, "%s%s", existing, included_files);
else
- virAsprintfQuiet(&pcontent, "%s%s", warning, included_files);
+ virAsprintf(&pcontent, "%s%s", warning, included_files);
plen = strlen(pcontent);
if (plen > MAX_FILE_LEN) {
@@ -290,8 +290,7 @@ create_profile(const char *profile, const char *profile_name,
driver_name = virDomainVirtTypeToString(virtType);
}
- virAsprintfQuiet(&template, "%s/TEMPLATE.%s", APPARMOR_DIR
"/libvirt",
- driver_name);
+ virAsprintf(&template, "%s/TEMPLATE.%s", APPARMOR_DIR
"/libvirt", driver_name);
if (!virFileExists(template)) {
vah_error(NULL, 0, _("template does not exist"));
@@ -314,11 +313,11 @@ create_profile(const char *profile, const char *profile_name,
}
/* '\nprofile <profile_name>\0' */
- virAsprintfQuiet(&replace_name, "\nprofile %s", profile_name);
+ virAsprintf(&replace_name, "\nprofile %s", profile_name);
/* '\n<profile_files>\n}\0' */
if (virtType != VIR_DOMAIN_VIRT_LXC)
- virAsprintfQuiet(&replace_files, "\n%s\n}", profile_files);
+ virAsprintf(&replace_files, "\n%s\n}", profile_files);
plen = tlen + strlen(replace_name) - strlen(template_name) + 1;
@@ -769,7 +768,7 @@ vah_add_path(virBufferPtr buf, const char *path, const char *perms,
bool recursi
vah_error(NULL, 0, _("could not find realpath"));
goto cleanup;
}
- virAsprintfQuiet(&tmp, "%s%s", pathreal, pathtmp);
+ virAsprintf(&tmp, "%s%s", pathreal, pathtmp);
}
perms_new = g_strdup(perms);
@@ -836,13 +835,13 @@ vah_add_file_chardev(virBufferPtr buf,
if (type == VIR_DOMAIN_CHR_TYPE_PIPE) {
/* add the pipe input */
- virAsprintfQuiet(&pipe_in, "%s.in", path);
+ virAsprintf(&pipe_in, "%s.in", path);
if (vah_add_file(buf, pipe_in, perms) != 0)
goto clean_pipe_in;
/* add the pipe output */
- virAsprintfQuiet(&pipe_out, "%s.out", path);
+ virAsprintf(&pipe_out, "%s.out", path);
if (vah_add_file(buf, pipe_out, perms) != 0)
goto clean_pipe_out;
@@ -935,7 +934,7 @@ get_files(vahControl * ctl)
/* verify uuid is same as what we were given on the command line */
virUUIDFormat(ctl->def->uuid, uuidstr);
- virAsprintfQuiet(&uuid, "%s%s", AA_PREFIX, uuidstr);
+ virAsprintf(&uuid, "%s%s", AA_PREFIX, uuidstr);
if (STRNEQ(uuid, ctl->uuid)) {
vah_error(ctl, 0, _("given uuid does not match XML uuid"));
@@ -1432,8 +1431,8 @@ main(int argc, char **argv)
if (vahParseArgv(ctl, argc, argv) != 0)
vah_error(ctl, 1, _("could not parse arguments"));
- virAsprintfQuiet(&profile, "%s/%s", APPARMOR_DIR "/libvirt",
ctl->uuid);
- virAsprintfQuiet(&include_file, "%s/%s.files", APPARMOR_DIR
"/libvirt", ctl->uuid);
+ virAsprintf(&profile, "%s/%s", APPARMOR_DIR "/libvirt",
ctl->uuid);
+ virAsprintf(&include_file, "%s/%s.files", APPARMOR_DIR
"/libvirt", ctl->uuid);
if (ctl->cmd == 'a') {
rc = parserLoad(ctl->uuid);
@@ -1495,7 +1494,7 @@ main(int argc, char **argv)
/* create the profile from TEMPLATE */
if (ctl->cmd == 'c') {
char *tmp = NULL;
- virAsprintfQuiet(&tmp, " #include <libvirt/%s.files>\n",
ctl->uuid);
+ virAsprintf(&tmp, " #include <libvirt/%s.files>\n",
ctl->uuid);
if (ctl->dryrun) {
vah_info(profile);
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
index 1c8f356387..4f29f74c77 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -127,9 +127,9 @@ virDevMapperGetTargetsImpl(const char *path,
goto cleanup;
for (i = 0; i < deps->count; i++) {
- virAsprintfQuiet(&devPaths[i], "/dev/block/%u:%u",
- major(deps->device[i]),
- minor(deps->device[i]));
+ virAsprintf(&devPaths[i], "/dev/block/%u:%u",
+ major(deps->device[i]),
+ minor(deps->device[i]));
}
recursiveDevPaths = NULL;
diff --git a/src/util/virerror.c b/src/util/virerror.c
index c31103c3b7..ee0ec1cffc 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1488,7 +1488,7 @@ virLastErrorPrefixMessage(const char *fmt, ...)
if (virVasprintfQuiet(&fmtmsg, fmt, args) < 0)
goto cleanup;
- virAsprintfQuiet(&newmsg, "%s: %s", fmtmsg, err->message);
+ virAsprintf(&newmsg, "%s: %s", fmtmsg, err->message);
VIR_FREE(err->message);
err->message = g_steal_pointer(&newmsg);
diff --git a/src/util/viriptables.c b/src/util/viriptables.c
index e339368040..c8c4d98f30 100644
--- a/src/util/viriptables.c
+++ b/src/util/viriptables.c
@@ -918,10 +918,10 @@ iptablesForwardMasquerade(virFirewallPtr fw,
if (addrStartStr && addrStartStr[0]) {
if (addrEndStr && addrEndStr[0]) {
virAsprintf(&natRangeStr, "%s-%s%s", addrStartStr, addrEndStr,
- portRangeStr ? portRangeStr : "");
+ portRangeStr ? portRangeStr : "");
} else {
virAsprintf(&natRangeStr, "%s%s", addrStartStr,
- portRangeStr ? portRangeStr : "");
+ portRangeStr ? portRangeStr : "");
}
virFirewallRuleAddArgList(fw, rule,
diff --git a/src/util/virkmod.c b/src/util/virkmod.c
index 962b132d31..12e6e5676c 100644
--- a/src/util/virkmod.c
+++ b/src/util/virkmod.c
@@ -149,7 +149,7 @@ virKModIsBlacklisted(const char *module)
g_autofree char *drvblklst = NULL;
g_autofree char *outbuf = NULL;
- virAsprintfQuiet(&drvblklst, "blacklist %s\n", module);
+ virAsprintf(&drvblklst, "blacklist %s\n", module);
/* modprobe will convert all '-' into '_', so we need to as well */
for (i = 0; i < drvblklst[i]; i++)
diff --git a/src/util/virlog.c b/src/util/virlog.c
index bfb2430ed3..880539e5c0 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -453,13 +453,13 @@ virLogFormatString(char **msg,
* to just grep for it to find the right place.
*/
if ((funcname != NULL)) {
- virAsprintfQuiet(msg, "%llu: %s : %s:%d : %s\n",
- virThreadSelfID(), virLogPriorityString(priority),
- funcname, linenr, str);
+ virAsprintf(msg, "%llu: %s : %s:%d : %s\n",
+ virThreadSelfID(), virLogPriorityString(priority),
+ funcname, linenr, str);
} else {
- virAsprintfQuiet(msg, "%llu: %s : %s\n",
- virThreadSelfID(), virLogPriorityString(priority),
- str);
+ virAsprintf(msg, "%llu: %s : %s\n",
+ virThreadSelfID(), virLogPriorityString(priority),
+ str);
}
}
@@ -481,7 +481,7 @@ virLogHostnameString(char **rawmsg,
{
char *hoststr;
- virAsprintfQuiet(&hoststr, "hostname: %s", virLogHostname);
+ virAsprintf(&hoststr, "hostname: %s", virLogHostname);
virLogFormatString(msg, 0, NULL, VIR_LOG_INFO, hoststr);
*rawmsg = hoststr;
@@ -689,7 +689,7 @@ virLogOutputToFd(virLogSourcePtr source G_GNUC_UNUSED,
if (fd < 0)
return;
- virAsprintfQuiet(&msg, "%s: %s", timestamp, str);
+ virAsprintf(&msg, "%s: %s", timestamp, str);
ignore_value(safewrite(fd, msg, strlen(msg)));
VIR_FREE(msg);
}
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 032d09e904..107a0fb9c9 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -129,13 +129,13 @@ virProcessTranslateStatus(int status)
{
char *buf;
if (WIFEXITED(status)) {
- virAsprintfQuiet(&buf, _("exit status %d"),
+ virAsprintf(&buf, _("exit status %d"),
WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
- virAsprintfQuiet(&buf, _("fatal signal %d"),
+ virAsprintf(&buf, _("fatal signal %d"),
WTERMSIG(status));
} else {
- virAsprintfQuiet(&buf, _("invalid value %d"), status);
+ virAsprintf(&buf, _("invalid value %d"), status);
}
return buf;
}
diff --git a/tests/nssmock.c b/tests/nssmock.c
index be70a60790..8d707a64a5 100644
--- a/tests/nssmock.c
+++ b/tests/nssmock.c
@@ -55,9 +55,9 @@ getrealpath(char **newpath,
const char *path)
{
if (STRPREFIX(path, LEASEDIR)) {
- virAsprintfQuiet(newpath, "%s/nssdata/%s",
- abs_srcdir,
- path + strlen(LEASEDIR));
+ virAsprintf(newpath, "%s/nssdata/%s",
+ abs_srcdir,
+ path + strlen(LEASEDIR));
} else {
*newpath = g_strdup(path);
}
diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c
index f86c99df86..947a81560a 100644
--- a/tests/scsihosttest.c
+++ b/tests/scsihosttest.c
@@ -72,10 +72,10 @@ create_scsihost(const char *fakesysfsdir, const char *devicepath,
int ret = -1;
int fd = -1;
- virAsprintfQuiet(&unique_id_path,
"%s/devices/pci0000:00/%s/unique_id",
- fakesysfsdir, devicepath);
- virAsprintfQuiet(&link_path, "%s/class/scsi_host/%s",
- fakesysfsdir, hostname);
+ virAsprintf(&unique_id_path, "%s/devices/pci0000:00/%s/unique_id",
+ fakesysfsdir, devicepath);
+ virAsprintf(&link_path, "%s/class/scsi_host/%s",
+ fakesysfsdir, hostname);
/* Rather than create path & file, temporarily snip off the file to
* create the path
@@ -255,14 +255,14 @@ mymain(void)
goto cleanup;
}
- virAsprintfQuiet(&fakesysfsdir, "%s/sys", fakerootdir);
+ virAsprintf(&fakesysfsdir, "%s/sys", fakerootdir);
if (init_scsihost_sysfs(fakesysfsdir) < 0) {
fprintf(stderr, "Failed to create fakesysfs='%s'\n",
fakesysfsdir);
goto cleanup;
}
- virAsprintfQuiet(&scsihost_class_path, "%s/class/scsi_host",
fakesysfsdir);
+ virAsprintf(&scsihost_class_path, "%s/class/scsi_host", fakesysfsdir);
VIR_DEBUG("Reading from '%s'", scsihost_class_path);
if (virTestRun("testVirReadSCSIUniqueId",
diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
index 4c67b9ad4e..1735852f39 100644
--- a/tests/vircgroupmock.c
+++ b/tests/vircgroupmock.c
@@ -376,8 +376,8 @@ static void init_sysfs(void)
VIR_FREE(fakesysfscgroupdir);
- virAsprintfQuiet(&fakesysfscgroupdir, "%s%s",
- fakerootdir, SYSFS_CGROUP_PREFIX);
+ virAsprintf(&fakesysfscgroupdir, "%s%s",
+ fakerootdir, SYSFS_CGROUP_PREFIX);
if (virFileMakePath(fakesysfscgroupdir) < 0) {
fprintf(stderr, "Cannot create %s\n", fakesysfscgroupdir);
@@ -458,8 +458,8 @@ FILE *fopen(const char *path, const char *mode)
errno = EACCES;
return NULL;
}
- virAsprintfQuiet(&filepath, "%s/vircgroupdata/%s.%s",
- abs_srcdir, filename, type);
+ virAsprintf(&filepath, "%s/vircgroupdata/%s.%s",
+ abs_srcdir, filename, type);
rc = real_fopen(filepath, mode);
free(filepath);
return rc;
diff --git a/tests/virfilemock.c b/tests/virfilemock.c
index e32d749d52..bb5fcc2ed8 100644
--- a/tests/virfilemock.c
+++ b/tests/virfilemock.c
@@ -188,7 +188,7 @@ canonicalize_file_name(const char *path)
char *ret;
if ((p = STRSKIP(path, "/some/symlink")))
- virAsprintfQuiet(&ret, "/gluster%s", p);
+ virAsprintf(&ret, "/gluster%s", p);
else
ret = g_strdup(path);
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index 765b3b31d9..e3d3c225ad 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -124,7 +124,7 @@ virMockStatRedirect(const char *path, char **newpath)
if (!tmp)
continue;
- virAsprintfQuiet(newpath, "%s%s", overrides[i], tmp);
+ virAsprintf(newpath, "%s%s", overrides[i], tmp);
break;
}
diff --git a/tests/virnetdevmock.c b/tests/virnetdevmock.c
index 574a26af2d..8834b2ca6a 100644
--- a/tests/virnetdevmock.c
+++ b/tests/virnetdevmock.c
@@ -30,8 +30,8 @@ virNetDevSysfsFile(char **pf_sysfs_device_link,
const char *ifname,
const char *file)
{
- virAsprintfQuiet(pf_sysfs_device_link, "%s/%s/%s",
- NET_DEV_TEST_DATA_PREFIX, ifname, file);
+ virAsprintf(pf_sysfs_device_link, "%s/%s/%s",
+ NET_DEV_TEST_DATA_PREFIX, ifname, file);
return 0;
}
#else
diff --git a/tests/virnumamock.c b/tests/virnumamock.c
index faff8bb4a2..4a52483a7f 100644
--- a/tests/virnumamock.c
+++ b/tests/virnumamock.c
@@ -43,7 +43,7 @@ virNumaIsAvailable(void)
if (numa_avail < 0) {
char *sysfs_node_path = NULL;
- virAsprintfQuiet(&sysfs_node_path, "%s/node", SYSFS_SYSTEM_PATH);
+ virAsprintf(&sysfs_node_path, "%s/node", SYSFS_SYSTEM_PATH);
numa_avail = virFileExists(sysfs_node_path);
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index a6bdad7a75..67107450e6 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -186,7 +186,7 @@ make_file(const char *path,
if (value && len == -1)
len = strlen(value);
- virAsprintfQuiet(&filepath, "%s/%s", path, name);
+ virAsprintf(&filepath, "%s/%s", path, name);
if ((fd = real_open(filepath, O_CREAT|O_WRONLY, 0666)) < 0)
ABORT("Unable to open: %s", filepath);
@@ -203,7 +203,7 @@ make_dir(const char *path,
{
g_autofree char *dirpath = NULL;
- virAsprintfQuiet(&dirpath, "%s/%s", path, name);
+ virAsprintf(&dirpath, "%s/%s", path, name);
if (virFileMakePath(dirpath) < 0)
ABORT("Unable to create: %s", dirpath);
@@ -216,7 +216,7 @@ make_symlink(const char *path,
{
g_autofree char *filepath = NULL;
- virAsprintfQuiet(&filepath, "%s/%s", path, name);
+ virAsprintf(&filepath, "%s/%s", path, name);
if (symlink(target, filepath) < 0)
ABORT("Unable to create symlink filepath -> target");
@@ -232,7 +232,7 @@ pci_read_file(const char *path,
int fd = -1;
g_autofree char *newpath = NULL;
- virAsprintfQuiet(&newpath, "%s/%s", fakerootdir, path);
+ virAsprintf(&newpath, "%s/%s", fakerootdir, path);
if ((fd = real_open(newpath, O_RDWR)) < 0)
goto cleanup;
@@ -269,13 +269,13 @@ getrealpath(char **newpath,
init_env();
if (STRPREFIX(path, SYSFS_PCI_PREFIX)) {
- virAsprintfQuiet(newpath, "%s/sys/bus/pci/%s",
- fakerootdir,
- path + strlen(SYSFS_PCI_PREFIX));
+ virAsprintf(newpath, "%s/sys/bus/pci/%s",
+ fakerootdir,
+ path + strlen(SYSFS_PCI_PREFIX));
} else if (pathPrefixIsMocked(path)) {
- virAsprintfQuiet(newpath, "%s/%s",
- fakerootdir,
- path);
+ virAsprintf(newpath, "%s/%s",
+ fakerootdir,
+ path);
} else {
*newpath = g_strdup(path);
}
@@ -356,9 +356,9 @@ pci_address_format(struct pciDeviceAddress const *addr)
{
char *ret;
- virAsprintfQuiet(&ret, ADDR_STR_FMT,
- addr->domain, addr->bus,
- addr->device, addr->function);
+ virAsprintf(&ret, ADDR_STR_FMT,
+ addr->domain, addr->bus,
+ addr->device, addr->function);
return ret;
}
@@ -393,13 +393,13 @@ pci_device_get_path(const struct pciDevice *dev,
* and then they are just symlinked to /sys/bus/pci/devices/
*/
if (file) {
- virAsprintfQuiet(&ret, "%s/sys/devices/pci%04x:%02x/%s/%s",
- prefix, dev->addr.domain, dev->addr.bus,
- devid, file);
+ virAsprintf(&ret, "%s/sys/devices/pci%04x:%02x/%s/%s",
+ prefix, dev->addr.domain, dev->addr.bus,
+ devid, file);
} else {
- virAsprintfQuiet(&ret, "%s/sys/devices/pci%04x:%02x/%s",
- prefix, dev->addr.domain, dev->addr.bus,
- devid);
+ virAsprintf(&ret, "%s/sys/devices/pci%04x:%02x/%s",
+ prefix, dev->addr.domain, dev->addr.bus,
+ devid);
}
return ret;
@@ -415,8 +415,8 @@ pci_device_create_iommu(const struct pciDevice *dev,
char tmp[256];
size_t i;
- virAsprintfQuiet(&iommuPath, "%s/sys/kernel/iommu_groups/%d/devices/",
- fakerootdir, dev->iommuGroup);
+ virAsprintf(&iommuPath, "%s/sys/kernel/iommu_groups/%d/devices/",
+ fakerootdir, dev->iommuGroup);
if (virFileMakePath(iommuPath) < 0)
ABORT("Unable to create: %s", iommuPath);
@@ -482,7 +482,7 @@ pci_device_new_from_stub(const struct pciDevice *data)
if (VIR_ALLOC_QUIET(dev) < 0)
ABORT_OOM();
- virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config", abs_srcdir,
id);
+ virAsprintf(&configSrc, "%s/virpcitestdata/%s.config", abs_srcdir,
id);
memcpy(dev, data, sizeof(*dev));
@@ -544,7 +544,7 @@ pci_device_new_from_stub(const struct pciDevice *data)
ABORT("@tmp overflow");
}
- virAsprintfQuiet(&devsympath, "%s" SYSFS_PCI_PREFIX
"devices", fakerootdir);
+ virAsprintf(&devsympath, "%s" SYSFS_PCI_PREFIX "devices",
fakerootdir);
make_symlink(devsympath, devid, tmp);
@@ -625,9 +625,9 @@ pci_vfio_release_iommu(struct pciDevice *device)
pciIommuGroups[i]->nDevicesBoundToVFIO--;
if (!pciIommuGroups[i]->nDevicesBoundToVFIO) {
- virAsprintfQuiet(&vfiopath, "%s/dev/vfio/%d",
- fakerootdir,
- device->iommuGroup);
+ virAsprintf(&vfiopath, "%s/dev/vfio/%d",
+ fakerootdir,
+ device->iommuGroup);
if (unlink(vfiopath) < 0)
return -1;
@@ -651,9 +651,9 @@ pci_vfio_lock_iommu(struct pciDevice *device)
continue;
if (pciIommuGroups[i]->nDevicesBoundToVFIO == 0) {
- virAsprintfQuiet(&vfiopath, "%s/dev/vfio/%d",
- fakerootdir,
- device->iommuGroup);
+ virAsprintf(&vfiopath, "%s/dev/vfio/%d",
+ fakerootdir,
+ device->iommuGroup);
if ((fd = real_open(vfiopath, O_CREAT)) < 0)
goto cleanup;
@@ -685,11 +685,11 @@ pci_driver_get_path(const struct pciDriver *driver,
prefix = fakerootdir;
if (file) {
- virAsprintfQuiet(&ret, "%s" SYSFS_PCI_PREFIX
"drivers/%s/%s",
- prefix, driver->name, file);
+ virAsprintf(&ret, "%s" SYSFS_PCI_PREFIX "drivers/%s/%s",
+ prefix, driver->name, file);
} else {
- virAsprintfQuiet(&ret, "%s" SYSFS_PCI_PREFIX
"drivers/%s",
- prefix, driver->name);
+ virAsprintf(&ret, "%s" SYSFS_PCI_PREFIX "drivers/%s",
+ prefix, driver->name);
}
return ret;
@@ -971,7 +971,7 @@ init_env(void)
if (!(fakerootdir = getenv("LIBVIRT_FAKE_ROOT_DIR")))
ABORT("Missing LIBVIRT_FAKE_ROOT_DIR env variable\n");
- virAsprintfQuiet(&tmp, "%s%s", fakerootdir, SYSFS_PCI_PREFIX);
+ virAsprintf(&tmp, "%s%s", fakerootdir, SYSFS_PCI_PREFIX);
if (virFileMakePath(tmp) < 0)
ABORT("Unable to create: %s", tmp);
@@ -982,7 +982,7 @@ init_env(void)
/* Create /dev/vfio/ dir and /dev/vfio/vfio file */
VIR_FREE(tmp);
- virAsprintfQuiet(&tmp, "%s/dev/vfio", fakerootdir);
+ virAsprintf(&tmp, "%s/dev/vfio", fakerootdir);
if (virFileMakePath(tmp) < 0)
ABORT("Unable to create: %s", tmp);
diff --git a/tests/virtestmock.c b/tests/virtestmock.c
index 7c10a045b3..116a6ad400 100644
--- a/tests/virtestmock.c
+++ b/tests/virtestmock.c
@@ -110,7 +110,7 @@ checkPath(const char *path,
char *crippledPath = NULL;
if (path[0] != '/')
- virAsprintfQuiet(&relPath, "./%s", path);
+ virAsprintf(&relPath, "./%s", path);
/* Le sigh. virFileCanonicalizePath() expects @path to exist, otherwise
* it will return an error. So if we are called over an non-existent
diff --git a/tests/virusbmock.c b/tests/virusbmock.c
index 7b7d24ac77..1b0beb81cb 100644
--- a/tests/virusbmock.c
+++ b/tests/virusbmock.c
@@ -54,7 +54,7 @@ static char *get_fake_path(const char *real_path)
char *path = NULL;
if ((p = STRSKIP(real_path, USB_SYSFS)))
- virAsprintfQuiet(&path, "%s/%s/%s", abs_srcdir, FAKE_USB_SYSFS,
p);
+ virAsprintf(&path, "%s/%s/%s", abs_srcdir, FAKE_USB_SYSFS, p);
else if (!p)
path = g_strdup(real_path);
--
2.21.0