[PATCH] qemu: domainjob: remove async variable from qemuDomainObjBeginJobInternal()

Kristina Hanicova posted 1 patch 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/04336084729f064571c4098d47f627ad5c3abc72.1658234676.git.khanicov@redhat.com
src/qemu/qemu_domainjob.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] qemu: domainjob: remove async variable from qemuDomainObjBeginJobInternal()
Posted by Kristina Hanicova 1 year, 8 months ago
This patch removes variable 'async', which is used only once, and
replaces it with direct comparison with an enum member.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
---
 src/qemu/qemu_domainjob.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 1f6d976558..7c6b697959 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -875,7 +875,6 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
     unsigned long long now;
     unsigned long long then;
     bool nested = job == VIR_JOB_ASYNC_NESTED;
-    bool async = job == VIR_JOB_ASYNC;
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     const char *blocker = NULL;
     const char *agentBlocker = NULL;
@@ -903,7 +902,8 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
     then = now + QEMU_JOB_WAIT_TIME;
 
  retry:
-    if ((!async && job != VIR_JOB_DESTROY) &&
+    if (job != VIR_JOB_ASYNC &&
+        job != VIR_JOB_DESTROY &&
         cfg->maxQueuedJobs &&
         priv->job.jobsQueued > cfg->maxQueuedJobs) {
         goto error;
-- 
2.35.3
Re: [PATCH] qemu: domainjob: remove async variable from qemuDomainObjBeginJobInternal()
Posted by Michal Prívozník 1 year, 8 months ago
On 7/19/22 14:47, Kristina Hanicova wrote:
> This patch removes variable 'async', which is used only once, and
> replaces it with direct comparison with an enum member.
> 
> Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
> ---
>  src/qemu/qemu_domainjob.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal