On Mon, Sep 06, 2021 at 03:59:04PM +0200, Martin Kletzander wrote:
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(a)redhat.com>
For the concept:
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
but it needs to be properly rebased as it does not apply any more.
Sorry for that, I tried applying it on an older worktree.
>---
> 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