[libvirt PATCH 1/2] conf: reformat virDomainDefCompatibleDevice for upcoming additional check

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

 



The next patch will add another check similar to the existing check
for a change in alias name. This patch reformats the code in
preparation so that the next patch's purpose will be clear.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cb9e7218ff..fefc527901 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -28477,13 +28477,14 @@ virDomainDefCompatibleDevice(virDomainDef *def,
         data.oldInfo = virDomainDeviceGetInfo(oldDev);
 
     if (action == VIR_DOMAIN_DEVICE_ACTION_UPDATE &&
-        live &&
-        (data.newInfo && data.oldInfo &&
-         data.newInfo->alias && data.oldInfo->alias &&
-         STRNEQ(data.newInfo->alias, data.oldInfo->alias))) {
-        virReportError(VIR_ERR_OPERATION_DENIED, "%s",
-                       _("changing device alias is not allowed"));
-        return -1;
+        live && data.newInfo && data.oldInfo) {
+
+        if (data.newInfo->alias && data.oldInfo->alias &&
+            STRNEQ(data.newInfo->alias, data.oldInfo->alias)) {
+            virReportError(VIR_ERR_OPERATION_DENIED, "%s",
+                           _("changing device alias is not allowed"));
+            return -1;
+        }
     }
 
     if (!virDomainDefHasUSB(def) &&
-- 
2.31.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