[PATCH 22/23] test driver: prepare to delete macros in testDomainSetBlockIoTune

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

 



We are going to delete macros for converting from params/adding event params.
Thus let's make macros conform to existing virDomainBlockIoTuneFromParams.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/test/test_driver.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 58d3d79..fba94b9 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3677,7 +3677,6 @@ testDomainSetBlockIoTune(virDomainPtr dom,
     }
 
     info = conf_disk->blkdeviotune;
-    info.group_name = g_strdup(conf_disk->blkdeviotune.group_name);
 
     if (virTypedParamsAddString(&eventParams, &eventNparams, &eventMaxparams,
                                 VIR_DOMAIN_TUNABLE_BLKDEV_DISK, path) < 0)
@@ -3739,7 +3738,6 @@ testDomainSetBlockIoTune(virDomainPtr dom,
                          VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC);
 
         if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME)) {
-            VIR_FREE(info.group_name);
             info.group_name = g_strdup(param->value.s);
             if (virTypedParamsAddString(&eventParams,
                                         &eventNparams,
@@ -3771,6 +3769,9 @@ testDomainSetBlockIoTune(virDomainPtr dom,
     }
 #undef SET_IOTUNE_FIELD
 
+    if (!info.group_name)
+        info.group_name = g_strdup(conf_disk->blkdeviotune.group_name);
+
     if (virDomainBlockIoTuneValidate(&info) < 0)
         goto cleanup;
 
-- 
1.8.3.1




[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