From 35de7404370eb24089b6160d109f6fe559a91864 Mon Sep 17 00:00:00 2001
From: mayunlong <mayunlong6@huawei.com>
Date: Fri, 24 Mar 2023 11:31:49 +0800
Subject: [PATCH] bugfix: move the check function
 qemuDomainDiskBlockIoTuneIsSupported to currect place.

move the check function qemuDomainDiskBlockIoTuneIsSupported for
conf_disk to currect place in function: qemuDomainSetBlockIotTune.

fix commit: e07709c7275349eac376660c08bacc6d18f28ff8
origin commit: https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=d763466edc6e8d4965fb42092c6e8f4296acf6c6
Signed-off-by:mayunlong<mayunlong6@huawei.com>
---
 src/qemu/qemu_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 32b3ef3cf1..c7545a7a98 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19301,9 +19301,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
                 goto endjob;
         }
 
-        if (!qemuDomainDiskBlockIoTuneIsSupported(conf_disk->src))
-            goto endjob;
-
         cur_info = qemuDomainFindGroupBlockIoTune(def, disk, &info);
 
         if (qemuDomainSetBlockIoTuneDefaults(&info, cur_info,
@@ -19386,6 +19383,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
             goto endjob;
         }
 
+	if (!qemuDomainDiskBlockIoTuneIsSupported(conf_disk->src))
+            goto endjob;
+
         conf_cur_info = qemuDomainFindGroupBlockIoTune(persistentDef, conf_disk, &info);
 
         if (qemuDomainSetBlockIoTuneDefaults(&conf_info, conf_cur_info,
-- 
2.25.1

