[libvirt] [PATCH] virsh: Don't infloop on snapshot/storage_vol failure

Ján Tomko jtomko at redhat.com
Thu Mar 28 16:36:17 UTC 2019


On Wed, Mar 27, 2019 at 09:20:58PM -0500, Eric Blake wrote:
>Most of our completers used the pattern:
>if ((nITEM = virITEMListAll()) < 0)
>    return NULL;
>
>but the virDomainSnapshot and virStorageVolume completers were instead
>using goto error because of a prior allocation. If the ListAll fails
>with -1, the cleanup label was running a loop of 'size_t i < int
>nITEM', which is an extreme waste of CPU cycles.
>
>Reported-by: Ján Tomko <jtomko at redhat.com>
>Signed-off-by: Eric Blake <eblake at redhat.com>
>---
>
>This one is a bug fix, so worth having in 5.2.
>
> tools/virsh-completer.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190328/870a8e5e/attachment-0001.sig>


More information about the libvir-list mailing list