Re: [PATCH] qemu_driver: Don't check for g_strdup_printf() retval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 06, 2021 at 03:12:59PM +0200, Michal Privoznik wrote:
The g_strdup_printf() function can't fail really. There's no need
to check for its return value.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

For the concept:

Reviewed-by: Martin Kletzander <mkletzan@xxxxxxxxxx>

but it needs to be properly rebased as it does not apply any more.

---
src/qemu/qemu_driver.c | 49 +++++++++---------------------------------
1 file changed, 10 insertions(+), 39 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cbd48b1849..2ea67b941e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2953,13 +2932,9 @@ qemuDomainSave(virDomainPtr dom, const char *path)
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);
}


Extra props for this one ^^ though =D

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux