Re: [PATCH] qemu: Use virDomainObjCheckActive() more

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

 



On a Monday in 2022, Michal Privoznik wrote:
Using the following spatch, I've identified two places which
could be switched from explicit virDomainObjIsActive() +
virReportError() to virDomainObjCheckActive():

 @@
 expression dom;
 @@
     if (
 -        !virDomainObjIsActive(dom)
 +        virDomainObjCheckActive(dom) < 0
     ) {
 -        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("domain is not running"));
         ...
     }

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

BTW. if I'm more aggressive and let virReportError() have just any args
then even more places fit the rule (approx. two dozen more).


Had you sent that as a patch, we would have been able to see what kind
of error messages are used in those places without having to run the
spatch.

src/qemu/qemu_driver.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)


Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

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