[libvirt PATCH v2 02/11] virDomainControllerDef: Change type of ioeventfd to virTristateSwitch

Tim Wiederhake twiederh at redhat.com
Fri Apr 23 14:39:13 UTC 2021


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
Reviewed-by: Ján Tomko <jtomko at redhat.com>
---
 src/conf/domain_conf.c | 13 ++++++++-----
 src/conf/domain_conf.h |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 24c0943d62..4ed7c0ef83 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9619,11 +9619,14 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt,
         return NULL;
     }
 
-    if (ioeventfd &&
-        (def->ioeventfd = virTristateSwitchTypeFromString(ioeventfd)) < 0) {
-        virReportError(VIR_ERR_XML_ERROR,
-                       _("Malformed 'ioeventfd' value %s"), ioeventfd);
-        return NULL;
+    if (ioeventfd) {
+        int value;
+        if ((value = virTristateSwitchTypeFromString(ioeventfd)) < 0) {
+            virReportError(VIR_ERR_XML_ERROR,
+                           _("Malformed 'ioeventfd' value %s"), ioeventfd);
+            return NULL;
+        }
+        def->ioeventfd = value;
     }
 
     if (iothread) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a7cad31896..d4344a7158 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -763,7 +763,7 @@ struct _virDomainControllerDef {
     unsigned int queues;
     unsigned int cmd_per_lun;
     unsigned int max_sectors;
-    int ioeventfd; /* enum virTristateSwitch */
+    virTristateSwitch ioeventfd;
     unsigned int iothread; /* unused = 0, > 0 specific thread # */
     union {
         virDomainVirtioSerialOpts vioserial;
-- 
2.26.3




More information about the libvir-list mailing list