[PATCH RFC 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 | 7 +++++++
 src/qemu/qemu_driver.c     | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index fffe274afc..940c3a92d6 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -955,6 +955,13 @@ 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 097366cefb..661dee06cd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14827,6 +14827,11 @@ qemuDomainDiskBlockIoTuneIsSupported(virDomainDiskDef *disk)
                        _("block I/O throttling is not supported for disk '%1$s'"), disk->dst);
         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