From patchwork Thu Jul 26 17:49:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142990 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp741604ljj; Thu, 26 Jul 2018 10:50:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcTrrHqcWpWjRwSJHmieeTUUPHfqAKD41GlONj+WVsD++dbC/r1BrlWzQ3vxcDO+EsWIJmY X-Received: by 2002:aed:2a33:: with SMTP id c48-v6mr2950856qtd.147.1532627417992; Thu, 26 Jul 2018 10:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532627417; cv=none; d=google.com; s=arc-20160816; b=DJ7SKZDefk4nla5XBQJBglLy1/BqBRaSUWW2Gk8a/qZTVf8spO4eMZ0lr3Fux9GtVh 0bGvY+wup7RDWA1l9tTUqyz0YV6VQ6rlasc+lqJVOA0OUC5AN9rsmU4RyfIfsm0GUL+k yePtkX8sbOVlfu2/zMmSr0gkwUjLYrKBBEw6VcY3RFREps6SkDpY1pKfZRwjxddfmEuB M3WscOn4XSCvYfWyHdQhZcKcOmQP+iqt8DvacuYLby/Bie3/FdrrtScgYBJ7Przl+Lhj xdn5PuIkym5M+KPbyCu49BmoRmZZMG+WAhMLSoKqNilddGKVg2kGutIY18Eho3d+/orU mIYw== 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:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=J9jjBjIvJbmcWirGjsag1HQh7wVVEWMgLwhEy7nu0bo=; b=fy2EeBz2j7Iynmhh410cDc/WCGU+FamE+7NOhrffeRYuBaEIgpvTwY0eZCAKN7aLEO aDjt/C5ALKc+4oJ8PKU+vbRabWnfQf6KvTTWXbRJ8xacGy8tkOp7UYHd52VZmkLHWcZE rPUTjqdIFa0QFVaLHQA3jLDW5uG6MfeHtQwWVr6qUFK/kZDJhFNK03jBV/N8XMRpdEck PPmkai3WNIRl2g0RRIJuO6KIvmHLjrNVYMU6gBjGv0iS/jJPdR5DJrYgx+i64Av90Qva l9xF3ZTgvoWyV7OfaC/W6nbycSKY2MnijC2YyMbu//CmSZe2xkE4nXsCBRnMMmI4kuxD U/4w== 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 m82-v6si1804970qki.213.2018.07.26.10.50.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 10:50:17 -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-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B25C2308214A; Thu, 26 Jul 2018 17:50:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C40F600C5; Thu, 26 Jul 2018 17:50:15 +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 F0B0D18037F2; Thu, 26 Jul 2018 17:50:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6QHo8Eq029341 for ; Thu, 26 Jul 2018 13:50:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id D9ECC1C5B0; Thu, 26 Jul 2018 17:50:08 +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 2653B1C5A2; Thu, 26 Jul 2018 17:50:07 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 26 Jul 2018 13:49:55 -0400 Message-Id: <8e2e9469e7aa25d03c95c92dec137fafc0b17f51.1532625483.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH RFC 2/2] conf: Convert virDomainVirtType to VIR_ENUM_IMPL_LABEL 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 26 Jul 2018 17:50:17 +0000 (UTC) Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 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 f94a90fbcc..eb40b7f349 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -103,7 +103,7 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST, "custom-dtb", "custom-ga-command"); -VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST, +VIR_ENUM_IMPL_LABEL(virDomainVirt, "domain type", VIR_DOMAIN_VIRT_LAST, "none", "qemu", "kqemu", @@ -19141,10 +19141,7 @@ virDomainDefParseCaps(virDomainDefPtr def, goto cleanup; } if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid domain type %s"), virttype); goto cleanup; - } if (!ostype) { if (def->os.bootloader) { @@ -27380,11 +27377,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST, -1); - if (!(type = virDomainVirtTypeToString(def->virtType))) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected domain type %d"), def->virtType); + if (!(type = virDomainVirtTypeToString(def->virtType))) goto error; - } if (def->id == -1) flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;