[PATCH v3 06/11] test_driver: Implement virDomainGetIOThreadInfo

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

 



Signed-off-by: Luke Yue <lukedyue@xxxxxxxxx>
---
 src/test/test_driver.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2813320939..67337879ef 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -9490,6 +9490,34 @@ testDomainGetMessages(virDomainPtr dom,
     return rv;
 }
 
+static int
+testDomainGetIOThreadInfo(virDomainPtr dom,
+                          virDomainIOThreadInfoPtr **info,
+                          unsigned int flags)
+{
+    virDomainObj *vm;
+    virDomainDef *targetDef = NULL;
+    unsigned int bitmap_size = 0;
+    int ret = -1;
+
+    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+                  VIR_DOMAIN_AFFECT_CONFIG, -1);
+
+    if (!(vm = testDomObjFromDomain(dom)))
+        goto cleanup;
+
+    if (!(targetDef = virDomainObjGetOneDef(vm, flags)))
+        goto cleanup;
+
+    bitmap_size = virDomainDefGetVcpus(targetDef);
+
+    ret = virDomainDriverGetIOThreadsConfig(targetDef, info, bitmap_size);
+
+ cleanup:
+    virDomainObjEndAPI(&vm);
+    return ret;
+}
+
 typedef enum {
     VIR_DOMAIN_IOTHREAD_ACTION_ADD,
     VIR_DOMAIN_IOTHREAD_ACTION_DEL,
@@ -9685,6 +9713,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .domainGetVcpus = testDomainGetVcpus, /* 0.7.3 */
     .domainGetVcpuPinInfo = testDomainGetVcpuPinInfo, /* 1.2.18 */
     .domainGetMaxVcpus = testDomainGetMaxVcpus, /* 0.7.3 */
+    .domainGetIOThreadInfo = testDomainGetIOThreadInfo, /* 7.7.0 */
     .domainAddIOThread = testDomainAddIOThread, /* 7.7.0 */
     .domainDelIOThread = testDomainDelIOThread, /* 7.7.0 */
     .domainGetSecurityLabel = testDomainGetSecurityLabel, /* 7.5.0 */
-- 
2.32.0




[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