[PATCH] conf: fix virtType FromString check

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

 



In the domain definition, virtType is virDomainVirtType which is
unsigned, so comparing against -1 doesn't work. Cast to int first

Fixes 8e2982b5767

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
This regressed in the past as well, when virtType was changed to
virDomainVirtType in 7383b8cc068, fixed by the follow up 5e06a4f063.
It's strange that virDomainVirtType is unsigned but VirtTypeFromString
can return -1... it should probably either work like virArch, or we
should switch virDomainVirtType to int in the DomainDef, but that
requires fixing a few other places too

 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c27c874d9e..30806d1e59 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19140,7 +19140,7 @@ virDomainDefParseCaps(virDomainDefPtr def,
                        "%s", _("missing domain type attribute"));
         goto cleanup;
     }
-    if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
+    if ((int)(def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("invalid domain type %s"), virttype);
         goto cleanup;
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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