priv = vm->privateData;
- if (!(snapDir = g_strdup_printf("%s/%s", baseDir, vm->def->name))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to allocate memory for "
- "snapshot directory for domain %s"),
- vm->def->name);
- goto cleanup;
- }
+ snapDir = g_strdup_printf("%s/%s", baseDir, vm->def->name);
VIR_INFO("Scanning for snapshots for domain %s in %s", vm->def->name,
snapDir);
kill the whole process */
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
- if (!(fullpath = g_strdup_printf("%s/%s", snapDir, entry->d_name))) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Failed to allocate memory for path"));
- continue;
- }
+ fullpath = g_strdup_printf("%s/%s", snapDir, entry->d_name);
if (virFileReadAll(fullpath, 1024*1024*1, &xmlStr) < 0) {
/* Nothing we can do here, skip this one */
virObjectLock(vm);
priv = vm->privateData;
- if (!(chkDir = g_strdup_printf("%s/%s", baseDir, vm->def->name))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to allocate memory for "
- "checkpoint directory for domain %s"),
- vm->def->name);
- goto cleanup;
- }
+ chkDir = g_strdup_printf("%s/%s", baseDir, vm->def->name);
VIR_INFO("Scanning for checkpoints for domain %s in %s", vm->def->name,
chkDir);
kill the whole process */
VIR_INFO("Loading checkpoint file '%s'", entry->d_name);
- if (!(fullpath = g_strdup_printf("%s/%s", chkDir, entry->d_name))) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Failed to allocate memory for path"));
- continue;
- }
+ fullpath = g_strdup_printf("%s/%s", chkDir, entry->d_name);
if (virFileReadAll(fullpath, 1024*1024*1, &xmlStr) < 0) {
/* Nothing we can do here, skip this one */
if (!(qemu_driver->config = cfg = virQEMUDriverConfigNew(privileged, root)))
goto error;
- if (!(driverConf = g_strdup_printf("%s/qemu.conf", cfg->configBaseDir)))
- goto error;
+ driverConf = g_strdup_printf("%s/qemu.conf", cfg->configBaseDir);
if (virQEMUDriverConfigLoadFile(cfg, driverConf, privileged) < 0)
goto error;
static char *
qemuDomainManagedSavePath(virQEMUDriver *driver, virDomainObj *vm)
{
- char *ret;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
- if (!(ret = g_strdup_printf("%s/%s.save", cfg->saveDir, vm->def->name)))
- return NULL;
-
- return ret;
+ return g_strdup_printf("%s/%s.save", cfg->saveDir, vm->def->name);
}
static int
}
}
- if (!(tmp = g_strdup_printf("%s/qemu.screendump.XXXXXX", cfg->cacheDir)))
- goto endjob;
+ tmp = g_strdup_printf("%s/qemu.screendump.XXXXXX", cfg->cacheDir);
if ((tmp_fd = g_mkstemp_full(tmp, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR)) == -1) {
virReportSystemError(errno, _("g_mkstemp(\"%s\") failed"), tmp);
bool threadAdded = false;
bool objectAdded = false;
- if (!(alias = g_strdup_printf("iothread%u", iothread_id)))
- return -1;
+ alias = g_strdup_printf("iothread%u", iothread_id);
if (qemuMonitorCreateObjectProps(&props, "iothread", alias, NULL) < 0)
goto cleanup;
int new_niothreads = 0;
qemuMonitorIOThreadInfo **new_iothreads = NULL;
- if (!(alias = g_strdup_printf("iothread%u", iothread_id)))
- return -1;
+ alias = g_strdup_printf("iothread%u", iothread_id);
qemuDomainObjEnterMonitor(driver, vm);
if (virDomainObjCheckActive(vm) < 0)
goto endjob;
- if (!(tmp = g_strdup_printf("%s/qemu.mem.XXXXXX", cfg->cacheDir)))
- goto endjob;
+ tmp = g_strdup_printf("%s/qemu.mem.XXXXXX", cfg->cacheDir);
/* Create a temporary filename. */
if ((fd = g_mkstemp_full(tmp, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR)) == -1) {