qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] qemu-img: always goto out in img_snapshot()


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-img: always goto out in img_snapshot() error paths
Date: Tue, 26 Aug 2014 20:32:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

On 26.08.2014 20:17, Stefan Hajnoczi wrote:
The out label has the qemu_progress_end() and other cleanup calls.
Always goto out in error paths so the cleanup happens.

Note that bdrv_unref(NULL) is safe.  We just need to initialize bs to
NULL at the top of the function.

We can now remove the obsolete bs_old_backing = NULL and bs_new_backing
= NULL for safe mode.  Originally it was necessary in commit 3e85c6fd
("qemu-img rebase") but became useless in commit c2abcce ("qemu-img:
avoid calling exit(1) to release resources properly") because the
variables are already initialized during declaration.

Reported-by: John Snow <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
  qemu-img.c | 15 ++++++---------
  1 file changed, 6 insertions(+), 9 deletions(-)

Reviewed-by: Max Reitz <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]