[PATCH RFC v2 11/12] config: validate: Use "iotune" and "throttlefilters" exclusively for specific disk

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

 



From: Yan Xiu Wu <wuyx@xxxxxxxxxxxxx>

No need to use both "iotune" and "throttlefilters" for specific disk

Signed-off-by: Yan Xiu Wu <wuyx@xxxxxxxxxxxxx>
---
 src/conf/domain_validate.c | 8 ++++++++
 src/qemu/qemu_driver.c     | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index fffe274afc..be51e66ac8 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -956,6 +956,14 @@ virDomainDiskDefValidate(const virDomainDef *def,
         }
     }
 
+    if (disk->throttlefilters && (disk->blkdeviotune.group_name ||
+        virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune))) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("block 'throttlefilters' can't be used together with 'iotune' for disk '%1$s'"),
+                       disk->dst);
+        return -1;
+    }
+
     return 0;
 }
 
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index da0f9590db..d74a970aae 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14828,6 +14828,12 @@ qemuDomainDiskBlockIoTuneIsSupported(virDomainDiskDef *disk)
         return false;
     }
 
+    if (disk->throttlefilters) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("block 'iotune' can't be used together with 'throttlefilters' for disk '%1$s'"), disk->dst);
+        return false;
+    }
+
     return true;
 }
 
-- 
2.34.1
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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