From patchwork Thu Jul 26 15:30:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142980 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp598827ljj; Thu, 26 Jul 2018 08:30:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDcbEqqBQen6EfiIuzlPaUlYUXCfu6nDsYEbmWE/quY7oyhnn4lKgFf9YC8TiX0zQvVqLL X-Received: by 2002:a37:6f84:: with SMTP id k126-v6mr2139178qkc.342.1532619016658; Thu, 26 Jul 2018 08:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532619016; cv=none; d=google.com; s=arc-20160816; b=ll7TAoEPaqczOxb0sCrcSHeYYExRe9xaDY8O6U60v2dquBnEianHZvRw/FrYMdMIjI wCBI6Kp8IEW6x2sEuElsZQFR3AYGGSiCs3OF25r7rNR1kWFsgrl3q3+UyXaBpal1i+Hw HjoQHCaTNLGpEn4mic6teY1H0SKTG3TJ/8LwM0ztE9aeF1oie9SyPdAdVf7CmhruXNvw ezXU+kbC76HfJITscJDO5sV48G6FnGIJLmaZ+9udBePGsP7jtiFDR+rfgnatk/OUt262 g86zxI7f+UoqoBT/Oup9pJ8roVw+RYQ6NOpqu2LtM+X1OH3f/5nTMmWztlvb8gc5zEn7 Jqkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=fmER+6ZC0K8f5ZKCRUMuAsgimQQ0n3dNgKcdjeXGry4=; b=Bm+Oy0+PZfH8fywqEgQkuJnMjadSSWbuh0c0vJ6GO1rOMEkRZEt4VpplWNUrfmBQzM Xu17TQ9zNDAYuD5EhDGT9uQnCyO9qPh+JB6Dh7V43P8wOk0b3RxwLJdHSAXdqfmAM2Ii EeNHv6CwCfe7whnbAoLli7FWPly3ZBFqfpRndxmtk8+2JsDLjzRnvfUI6GnuoweuM2iZ XQTt6CEe9DqDin/0pe7h+L4RkY0j+/dYtlCkUVTyQLi1NjqscEZKTbuIHEIJMY84MlZJ QCzgvfWYFAi3v53lHB52VdrSr3snMFLEHtNDGpX3ErStFp494dfiH9132SMX90ag4W3T 7Kbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id s11-v6si1569911qtb.137.2018.07.26.08.30.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 08:30:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9769430E6876; Thu, 26 Jul 2018 15:30:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A481C28D24; Thu, 26 Jul 2018 15:30:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AC35F4A464; Thu, 26 Jul 2018 15:30:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6QFU9C4007723 for ; Thu, 26 Jul 2018 11:30:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 467E72027EB6; Thu, 26 Jul 2018 15:30:09 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C7AF2026D68; Thu, 26 Jul 2018 15:30:09 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 26 Jul 2018 11:30:07 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: fix virtType FromString check X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 26 Jul 2018 15:30:15 +0000 (UTC) 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 --- 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(-) -- 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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;