From patchwork Tue Jul 24 21:23:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142823 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55708ljj; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdaXUTGyJdtEOpm6IjZeCWWmlo/47Qe3OIGsgOZZe8W9vdjU4yMMYxOGYZ5kVl9SorgstpW X-Received: by 2002:ae9:e64c:: with SMTP id x12-v6mr17170321qkl.41.1532467436445; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467436; cv=none; d=google.com; s=arc-20160816; b=BqIVTkN+0/DfgWtFNOBriP1bZFQergS0746eebQfU9p+GyLNFAIWtSN6E5ihfW94n3 VeypyGtajv5co8+DaQ5CkjcgKFl91DWIa3+eM0xXjAbsSOlgPkUKWAUi72Vv3ci/6OAE aIXiY9GEbW9/lCsXwFW1eA3qXZbmKrwH2MIOSiNpmHBNHo78jusz2XtIFKWpYFbsBnTA 38J2e1cRwNL9kXdB/yCFIPIA4mJTh4BD1tgAKag7GOMLdFgl2+/6ZW2Ao2hwXlXOgYkD sHX2/7fD1mX/9g3uUqxduYCR+paVRglrH0gzdaBAS5qP0UfHLQpsXYLEMFaRfNjr0H+7 rOdA== 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=Q3XBH8KytM9Ia6OWcaeWPsLmtQllCevTKUnJVerN47k=; b=pb6NTr7AqE+jwGx3C7f43nn0g2yL6cZTqzMLbj7uNI4eOdNYUY7QyOIXJ1lT81pXKl q6Tk6QKn4fFol0hMzdFMM1L2Ys66a7v0ojkO3S85nC4IP6P+7YqiScLuRnd167DwZd2A eqgcPB9Qz5Hwh2prW5zYcWJwIsR618TxOs90Py3ItwJF5xKD1i5ukJ4Yc0pRTePt1ImC g3B6XNMaAT5mpdNeE6Gwe/CjOwm6hHECbm5XFXoPIxrgQo9XWX3cd0dpvT3rgZ3p2Bmb wGjTkL90VOmMu09KI/+rfyaoT5XItIoH8F/UXNPApkykAUk3tHqCs2w9DF58v1OGH2L0 N2jQ== 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 s82-v6si9059217qkl.76.2018.07.24.14.23.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:23:56 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF3053084036; Tue, 24 Jul 2018 21:23:54 +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 6B5895DA60; Tue, 24 Jul 2018 21:23:54 +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 CE5404A460; Tue, 24 Jul 2018 21:23:53 +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 w6OLNpVC018717 for ; Tue, 24 Jul 2018 17:23:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 626D62026E0E; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48AAF2026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:42 -0400 Message-Id: <005b16b12e4cda51ddc497fa4962a1b794d723d9.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/7] conf: Break out virDomainDefParseCaps 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 24 Jul 2018 21:23:55 +0000 (UTC) Handles parse virtType, os.type, bootloader bits, arch, machine, emulator Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 96 +++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 38 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 178c6d2711..7eb5ffc718 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19114,46 +19114,15 @@ virDomainCachetuneDefParse(virDomainDefPtr def, } -static virDomainDefPtr -virDomainDefParseXML(xmlDocPtr xml, - xmlNodePtr root, - xmlXPathContextPtr ctxt, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, - unsigned int flags) +static int +virDomainDefParseCaps(virDomainDefPtr def, + xmlXPathContextPtr ctxt, + virCapsPtr caps, + unsigned int flags) { - xmlNodePtr *nodes = NULL, node = NULL; + int ret = -1; + int virtType; char *tmp = NULL; - size_t i, j; - int n, virtType, gic_version; - long id = -1; - virDomainDefPtr def; - bool uuid_generated = false; - bool usb_none = false; - bool usb_other = false; - bool usb_master = false; - char *netprefix = NULL; - - if (flags & VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA) { - char *schema = virFileFindResource("domain.rng", - abs_topsrcdir "/docs/schemas", - PKGDATADIR "/schemas"); - if (!schema) - return NULL; - if (virXMLValidateAgainstSchema(schema, xml) < 0) { - VIR_FREE(schema); - return NULL; - } - VIR_FREE(schema); - } - - if (!(def = virDomainDefNew())) - return NULL; - - if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) - if (virXPathLong("string(./@id)", ctxt, &id) < 0) - id = -1; - def->id = (int)id; /* Find out what type of virtualization to use */ if (!(tmp = virXMLPropString(ctxt->node, "type"))) { @@ -19239,6 +19208,57 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(capsdata); } + ret = 0; + error: + VIR_FREE(tmp); + return ret; +} + + +static virDomainDefPtr +virDomainDefParseXML(xmlDocPtr xml, + xmlNodePtr root, + xmlXPathContextPtr ctxt, + virCapsPtr caps, + virDomainXMLOptionPtr xmlopt, + unsigned int flags) +{ + xmlNodePtr *nodes = NULL, node = NULL; + char *tmp = NULL; + size_t i, j; + int n, gic_version; + long id = -1; + virDomainDefPtr def; + bool uuid_generated = false; + bool usb_none = false; + bool usb_other = false; + bool usb_master = false; + char *netprefix = NULL; + + if (flags & VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA) { + char *schema = virFileFindResource("domain.rng", + abs_topsrcdir "/docs/schemas", + PKGDATADIR "/schemas"); + if (!schema) + return NULL; + if (virXMLValidateAgainstSchema(schema, xml) < 0) { + VIR_FREE(schema); + return NULL; + } + VIR_FREE(schema); + } + + if (!(def = virDomainDefNew())) + return NULL; + + if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) + if (virXPathLong("string(./@id)", ctxt, &id) < 0) + id = -1; + def->id = (int)id; + + if (virDomainDefParseCaps(def, ctxt, caps, flags) < 0) + goto error; + /* Extract domain name */ if (!(def->name = virXPathString("string(./name[1])", ctxt))) { virReportError(VIR_ERR_NO_NAME, NULL); From patchwork Tue Jul 24 21:23:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142825 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55824ljj; Tue, 24 Jul 2018 14:24:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcCEHngB8XW0K2gl0ZmzjzjBVfKv1lDHyMrnjR2Fnp7S3yIApqUde9BNSFzYXlqB5gZxso1 X-Received: by 2002:a37:f86:: with SMTP id 6-v6mr16453009qkp.48.1532467446841; Tue, 24 Jul 2018 14:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467446; cv=none; d=google.com; s=arc-20160816; b=M09K6ppmn73ZZjQkwpPgfYSeo876e6OcOKb8qqC0KzpFYBai4mq/qq8Jguni0OZXcr MlypxSCUgVQH7ucAT3dRBcd6ALKe3IQQ2ObtzpZYzfv0jS7P/ZxfDQcyM6Nsxcn28BJn lBNRigp9Nj0+jWu4WimKyvNsKhqxhEUPhOq7O0wmGnNtRlO6uCd1GcCdUqaGD6HW8Po0 3PkyJQUTRJHr8OG05ATkmr8GxqstmQk1oxKVBQlS/8DWrNlnIEzFUSk8zkBW0u3YrJpm DtDl/fPvKK9KzhAfPyNGA94dxtF7zW1hMmc9t/z4FHOdu+HuC9jjcCwxJ+Q9HRUYq/iG GAMg== 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=JNk3ZgqSba/BXK510wlUACxzYSxOVgFMCOxWf6cEiqU=; b=DegQxDnEoTR+0QEWxsetm1KqlY0T280ShmWWm9F3Uzl+z8JDwxU7ThY06LYPhaBIkL xDg/EhqKZySzQZVSwXNRdIsc9/th2ppZzhmb1gYPDnAP89eGKrovJth9WLsG2oUWdr+Y JuwVqmCMb8FG8BDT7LoBEnMvzUg+tthXksa2G9KVo4zA1VkPxLKaxmywj49ihLJEPgPM XC7iIpsVyoHSeUDCRuXn/sI8gpWuunLggzNlfpES5YHVRGPRcVjsPL71loWBEz3Dm6T1 UsitL/sIkB+n1Re5RYCeqWWIODUrK/hAdbdN4yqihS/+Yatp9QYLhNKkDj13HypzqSUa WmTw== 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 r13-v6si8108765qtm.243.2018.07.24.14.24.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:06 -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 EA36FC0587F8; Tue, 24 Jul 2018 21:24:04 +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 A000816E27; Tue, 24 Jul 2018 21:24:04 +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 38F524A469; Tue, 24 Jul 2018 21:24:04 +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 w6OLNpmw018726 for ; Tue, 24 Jul 2018 17:23:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 894F92026E18; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DC602026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:43 -0400 Message-Id: <1a4c1a045146524152f4d06fe8740504cef38d8b.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] conf: Clean up virDomainDefParseCaps 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.32]); Tue, 24 Jul 2018 21:24:05 +0000 (UTC) - Convert to 'cleanup' label naming - Use more than one 'tmp' string and do all freeing at the end - Make the code easier to follow Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 76 ++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 39 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 7eb5ffc718..5a90429cd6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19121,43 +19121,45 @@ virDomainDefParseCaps(virDomainDefPtr def, unsigned int flags) { int ret = -1; - int virtType; - char *tmp = NULL; + char *virttype = NULL; + char *arch = NULL; + char *ostype = NULL; + virCapsDomainDataPtr capsdata = NULL; - /* Find out what type of virtualization to use */ - if (!(tmp = virXMLPropString(ctxt->node, "type"))) { + virttype = virXPathString("string(./@type)", ctxt); + ostype = virXPathString("string(./os/type[1])", ctxt); + arch = virXPathString("string(./os/type[1]/@arch)", ctxt); + + def->os.bootloader = virXPathString("string(./bootloader)", ctxt); + def->os.bootloaderArgs = virXPathString("string(./bootloader_args)", ctxt); + def->os.machine = virXPathString("string(./os/type[1]/@machine)", ctxt); + def->emulator = virXPathString("string(./devices/emulator[1])", ctxt); + + if (!virttype) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing domain type attribute")); - goto error; + goto cleanup; } - - if ((virtType = virDomainVirtTypeFromString(tmp)) < 0) { + if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid domain type %s"), tmp); - goto error; + _("invalid domain type %s"), virttype); + goto cleanup; } - def->virtType = virtType; - VIR_FREE(tmp); - - def->os.bootloader = virXPathString("string(./bootloader)", ctxt); - def->os.bootloaderArgs = virXPathString("string(./bootloader_args)", ctxt); - tmp = virXPathString("string(./os/type[1])", ctxt); - if (!tmp) { + if (!ostype) { if (def->os.bootloader) { def->os.type = VIR_DOMAIN_OSTYPE_XEN; } else { virReportError(VIR_ERR_XML_ERROR, "%s", _("an os must be specified")); - goto error; + goto cleanup; } } else { - if ((def->os.type = virDomainOSTypeFromString(tmp)) < 0) { + if ((def->os.type = virDomainOSTypeFromString(ostype)) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown OS type '%s'"), tmp); - goto error; + _("unknown OS type '%s'"), ostype); + goto cleanup; } - VIR_FREE(tmp); } /* @@ -19170,17 +19172,11 @@ virDomainDefParseCaps(virDomainDefPtr def, def->os.type = VIR_DOMAIN_OSTYPE_XEN; } - tmp = virXPathString("string(./os/type[1]/@arch)", ctxt); - if (tmp && !(def->os.arch = virArchFromString(tmp))) { + if (arch && !(def->os.arch = virArchFromString(arch))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unknown architecture %s"), - tmp); - goto error; + _("Unknown architecture %s"), arch); + goto cleanup; } - VIR_FREE(tmp); - - def->os.machine = virXPathString("string(./os/type[1]/@machine)", ctxt); - def->emulator = virXPathString("string(./devices/emulator[1])", ctxt); if ((!def->os.arch || !def->os.machine) && !(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) { @@ -19191,26 +19187,28 @@ virDomainDefParseCaps(virDomainDefPtr def, * in numerous minor ways. */ bool use_virttype = ((def->os.arch == VIR_ARCH_NONE) || !def->os.machine); - virCapsDomainDataPtr capsdata = NULL; - if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type, - def->os.arch, use_virttype ? def->virtType : VIR_DOMAIN_VIRT_NONE, + if (!(capsdata = virCapabilitiesDomainDataLookup(caps, + def->os.type, + def->os.arch, + use_virttype ? def->virtType : VIR_DOMAIN_VIRT_NONE, NULL, NULL))) - goto error; + goto cleanup; if (!def->os.arch) def->os.arch = capsdata->arch; if ((!def->os.machine && VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0)) { - VIR_FREE(capsdata); - goto error; + goto cleanup; } - VIR_FREE(capsdata); } ret = 0; - error: - VIR_FREE(tmp); + cleanup: + VIR_FREE(virttype); + VIR_FREE(ostype); + VIR_FREE(arch); + VIR_FREE(capsdata); return ret; } From patchwork Tue Jul 24 21:23:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142826 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55838ljj; Tue, 24 Jul 2018 14:24:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdznUYmXl5ZavD0CNNWhsdxa18StRLqSgGX8mX8cwA5iWZ6M+SOzgmcKBd0qMNkbAquDkh8 X-Received: by 2002:a0c:b65a:: with SMTP id q26-v6mr16933822qvf.43.1532467447882; Tue, 24 Jul 2018 14:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467447; cv=none; d=google.com; s=arc-20160816; b=YPTDAawXo+NJrt9+ygLe2yc7UIRYOXcVuTtJriMe6YCVjtng5MhXxmr4LMhaZXZaGw hjZgwOcRKgk2tCyS9BZvWFt3zToFjtI8xvX7H98H2biqp9Dhbd96eXezStSpI3K1dS1K ihLEqQKJAhVCZbwXL/TtA8mNtQaumNOKJtuilNIqoPKaZjbaBnXVG9INkUKX7qeEKkNe 5rb5YA0UVf4KcPlIbxeYPGzLxKO9YZKzS9hFhJ+wi6TJ7uXUuBw4jKwsH9IbrQTPFe9S otAUZBD3yQaJXOWQ8zOvVQ47pyv93beKsCP1DNjPUnyVc8unxTaEGtlYVWuLI0NiZwuj B1aA== 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=zUkH6mFz9rMt6AgVv2GkDbXYtPryc37MaPlugj4pYYE=; b=0i2MJoYenl5hAbBrB9KYH4r+9ryWON8iZpHJ60X4s1phDJRONh5hDIufrmZJaVznpQ DbPVzC+TZ67nDEGHyMMZOi4yxVqkaI9kQQ/tGRNb9flQyBf0dSwIxk+mfc1hSWCDybh0 UfhbpLZ3OdpIxTyqQGMAhrQdH0qFArHXX5fd9M2WQZ79rlp5a8rsPPzDset3RkTtUpqD OSYMZFiVzS+6bfnee5SmbIBPpwHaw4mI9ZQ/+AbtktIwSpPl44RRHTo2/6umgnk4z7GT elTolPZv04eRHa/hE3OicdRsF4a0K8Ljy04k9kESQ9IaFA2+gd05v7gH4a9F3IodTNad Jq2A== 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 l6-v6si5510313qvc.189.2018.07.24.14.24.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:07 -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 EDCFC300177C; Tue, 24 Jul 2018 21:24:05 +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 A1DAB6017D; Tue, 24 Jul 2018 21:24:05 +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 143314BB78; Tue, 24 Jul 2018 21:24:05 +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 w6OLNpE8018727 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE16D2026E1A; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93CA82026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:44 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] tests: qemuhotplug: Fix segfault when XML loading fails 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.46]); Tue, 24 Jul 2018 21:24:06 +0000 (UTC) Some tests use the same VM state multiple times in a row. But if we failed loading the VM XML, subsequent tests crash on the NULL def pointer Signed-off-by: Cole Robinson --- I hit this with failing tests while writing this series tests/qemuhotplugtest.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 674ba92b27..4f9e127f88 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -268,6 +268,8 @@ testQemuHotplug(const void *data) if (test->vm) { vm = test->vm; + if (!vm->def) + goto cleanup; } else { if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, test->deviceDeletedEvent) < 0) From patchwork Tue Jul 24 21:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142827 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55898ljj; Tue, 24 Jul 2018 14:24:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdIY+lHWFzl01xi/aUnk2TszoYv5Vj5QFjvuhdOlVCwfCHjJh9C6XRRxFa5YRSN+aa89MDa X-Received: by 2002:a37:184b:: with SMTP id j72-v6mr17030497qkh.94.1532467454559; Tue, 24 Jul 2018 14:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467454; cv=none; d=google.com; s=arc-20160816; b=S2JPgTjsCWUmLoX87dlwLCIASz3KJDKh82dYeqSvcFvgq69Ga8rL+w9bo/yskxb8yA G1lp4+NgjfPNgJFoR8d4pUv87GEgt0DF1AXmDKIfb9erBQXRAsaWmwIQWiPrtVUXZmik D3xmNKMjBAJTKSCQM852D8hyRjfzGBcdDVuDq97PuiwrxHopF53H9mm1kwBf6kuH7K2N wSYECUtwc8koKzQFY9CVgkCgqqCkrIMfLlHyL6y5Orl7rBctP0Pe9bIOcc8aqJ7KFAKx 0ph3J//M9vCYtUqTdacK1FkU9oW5DlocamzK2M9WvHFD24gfoCUkz0m+zKSCxlFqZboe OUDQ== 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=IyNxElLalotf1uvEYKp7gC41L0jcYpxEtx1cK4Oc8ic=; b=DDHHzN2gzXyi3689NCZjknNHB/CswL7mI5dcZ+QVFkdTTE+n5vyzTBlJe4aAcbj3Bd bLfKGqPRu+jwOQ3Axd2KBRv3kHywWOxfd1BaOO+1HF6uImlG3D1JDdMDvEyVnuUpt8E3 st5CHKbSlUx6koGu8mUYlcd4PgJz+S4n5bCG0aJpU/nPtKBjoKYH+/OmD0DRTEZAQ4wd ZWofd2AbFfHGB5PGSNZJlsC+vEr8tLNXL/pnUovyd5NavsGdmDdGxhA/U8rejdQMwZV9 FVrfXxcYd5oiZrobKglAy1X1KvIOuR6RFREUQMz2WrJf69rOKAlX5SMOHkYwlNUNZyJQ lovw== 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 t13-v6si5455028qto.159.2018.07.24.14.24.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:14 -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-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97488300271A; Tue, 24 Jul 2018 21:24:11 +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 3DCB760910; Tue, 24 Jul 2018 21:24:11 +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 C614B4A464; Tue, 24 Jul 2018 21:24: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 w6OLNqKT018728 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id D50722026E0E; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id B95462026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:45 -0400 Message-Id: <2622a099eb9fc903cddc3c99e18876b671338f58.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] conf: Drop unneccessary caps parsing logic 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 24 Jul 2018 21:24:13 +0000 (UTC) The comment says: /* If the logic here seems fairly arbitrary, that's because it is :) * This is duplicating how the code worked before * CapabilitiesDomainDataLookup was added. We can simplify this, * but it would take a bit of work because the test suite fails * in numerous minor ways. */ Nowadays the test suite changes appear quite simple, just extending test capabilities data a bit so that we aren't trying to define invalid arch/os/virtType/machine combos Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 15 ++------------- tests/testutils.c | 13 ++++++++++++- tests/testutilsqemu.c | 18 ++++++++++++++++++ tests/vircapstest.c | 2 -- 4 files changed, 32 insertions(+), 16 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 5a90429cd6..b7f6a22e20 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19178,20 +19178,9 @@ virDomainDefParseCaps(virDomainDefPtr def, goto cleanup; } - if ((!def->os.arch || !def->os.machine) && - !(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) { - /* If the logic here seems fairly arbitrary, that's because it is :) - * This is duplicating how the code worked before - * CapabilitiesDomainDataLookup was added. We can simplify this, - * but it would take a bit of work because the test suite fails - * in numerous minor ways. */ - bool use_virttype = ((def->os.arch == VIR_ARCH_NONE) || - !def->os.machine); - + if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) { if (!(capsdata = virCapabilitiesDomainDataLookup(caps, - def->os.type, - def->os.arch, - use_virttype ? def->virtType : VIR_DOMAIN_VIRT_NONE, + def->os.type, def->os.arch, def->virtType, NULL, NULL))) goto cleanup; diff --git a/tests/testutils.c b/tests/testutils.c index 423f4bfdff..ab938c12fc 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1196,7 +1196,12 @@ virCapsPtr virTestGenericCapsInit(void) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL)) goto error; - + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, + NULL, NULL, 0, NULL)) + goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, "/usr/bin/acme-virt", NULL, @@ -1205,6 +1210,12 @@ virCapsPtr virTestGenericCapsInit(void) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, + NULL, NULL, 0, NULL)) + goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; if (virTestGetDebug() > 1) { diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index dc7e90b952..cc2f8a7b64 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -219,6 +219,9 @@ static int testQemuAddPPC64Guest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; @@ -246,6 +249,9 @@ static int testQemuAddPPC64LEGuest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; @@ -276,6 +282,9 @@ static int testQemuAddPPCGuest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; @@ -307,6 +316,9 @@ static int testQemuAddS390Guest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; @@ -338,6 +350,9 @@ static int testQemuAddArmGuest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; @@ -367,6 +382,9 @@ static int testQemuAddAARCH64Guest(virCapsPtr caps) if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL)) goto error; + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, + NULL, NULL, 0, NULL)) + goto error; return 0; diff --git a/tests/vircapstest.c b/tests/vircapstest.c index 1df3fa091f..19e3c79302 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -195,8 +195,6 @@ test_virCapsDomainDataLookupQEMU(const void *data ATTRIBUTE_UNUSED) CAPS_EXPECT_ERR(VIR_DOMAIN_OSTYPE_LINUX, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, NULL); CAPS_EXPECT_ERR(-1, VIR_ARCH_PPC64LE, VIR_DOMAIN_VIRT_NONE, NULL, "pc"); CAPS_EXPECT_ERR(-1, VIR_ARCH_MIPS, VIR_DOMAIN_VIRT_NONE, NULL, NULL); - CAPS_EXPECT_ERR(-1, VIR_ARCH_AARCH64, VIR_DOMAIN_VIRT_KVM, - "/usr/bin/qemu-system-aarch64", NULL); CAPS_EXPECT_ERR(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, "/usr/bin/qemu-system-aarch64", "pc"); CAPS_EXPECT_ERR(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_VMWARE, NULL, "pc"); From patchwork Tue Jul 24 21:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142829 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55967ljj; Tue, 24 Jul 2018 14:24:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfOC2Br2HS7Col+Da+EuqzqKjCy7yWLm8/EHStFwJosjiHq9taZDdcOmRddCtAA7PHQv4Dv X-Received: by 2002:a37:4b46:: with SMTP id y67-v6mr16239985qka.207.1532467460596; Tue, 24 Jul 2018 14:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467460; cv=none; d=google.com; s=arc-20160816; b=d6o2rpumVBaPf0mXjqx0xds/w3XJpeBh5q8DDDz1+bsKsfI29nOMOc1wRUC8/tDdcv JHRfJ4UYxr39s6VwTdV8lJ9WpcY5cAyc2C4RhSyNdBWGVtjDoTnZoes5E9QhBQ5VI4Ks 99SOvpq9MHfeBm3VmgrHptU5oCT2uFuUATbL0roDBZAzmKNec2u96gqeIiRPQqV2fpJp 4XbJVYITH4PBAekzXW+JMBz6jgGOSGFtU1MrtJySLNDHrMM3EG2JD5oXu1KqK1pJHDrS SLeCn+Es7V+5fRtMs3++O+TTAJPYpEcWdhdPs58a9AzNsnwxcLcof05wI5YzZQ33LVOZ iAIg== 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=VBFQLjQ1DW6mFjB8Z0z2CgH+cBTOAJxZV9JD0qdSrxM=; b=e/X+7sGfZCP7DCO6Yse4losmLPAn4t3qeWMZsO1SRlBxsh7mfnHXH9Mg8w1Qhpkl3v WEtCLcp8MdQK6JsIO8eqrPBss7LUXqsot5shLscTMu0lY4LI0HNKuLallGUFwpBws6VT 0e5NwT639m0fcGdNXSvIdfrQniwitkfDdlZO3VtkX318a5ySNHpLf/rzJDuff3v6BUJD zUpZ5Uvai1J9I1xMH7plbqjYUvQ33XGeEcrr8sgp32qNo9dIv00iRXYK7k95d6wcQml0 g9BbEMHvNciBnF9InAK953KKetcz5reAwP+98nfi3jBFKlGTpKhWOJrCwkTOzysn0JX3 s0NQ== 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 e65-v6si755694qkd.158.2018.07.24.14.24.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:20 -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 4693681108; Tue, 24 Jul 2018 21:24:17 +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 0972316BF5; Tue, 24 Jul 2018 21:24:17 +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 9710D1800B6B; Tue, 24 Jul 2018 21:24:16 +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 w6OLNqGf018734 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 09C3C2027047; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id E185E2026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:46 -0400 Message-Id: <09f9dd272a34ce25dd6f18a25c46645df24740d8.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] conf: Sync caps data even when SKIP_OSTYPE_CHECKS 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.28]); Tue, 24 Jul 2018 21:24:19 +0000 (UTC) We should still make an effort to fill in data, just not raise an error if say an ostype/virttype combo disappeared from caps. Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 13 ++++++------- tests/qemuxml2argvdata/missing-machine.xml | 2 +- tests/qemuxml2argvtest.c | 3 +++ 3 files changed, 10 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 b7f6a22e20..78ee000857 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19178,18 +19178,17 @@ virDomainDefParseCaps(virDomainDefPtr def, goto cleanup; } - if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) { - if (!(capsdata = virCapabilitiesDomainDataLookup(caps, - def->os.type, def->os.arch, def->virtType, - NULL, NULL))) + if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type, + def->os.arch, def->virtType, NULL, NULL))) { + if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)) goto cleanup; - + virResetLastError(); + } else { if (!def->os.arch) def->os.arch = capsdata->arch; if ((!def->os.machine && - VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0)) { + VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0)) goto cleanup; - } } ret = 0; diff --git a/tests/qemuxml2argvdata/missing-machine.xml b/tests/qemuxml2argvdata/missing-machine.xml index 4ce7b377a5..2900baec90 100644 --- a/tests/qemuxml2argvdata/missing-machine.xml +++ b/tests/qemuxml2argvdata/missing-machine.xml @@ -6,7 +6,7 @@ 219100 1 - hvm + hvm diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1a936faef1..03b6d92912 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2773,6 +2773,9 @@ mymain(void) QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_NEC_USB_XHCI); + /* VM XML has invalid arch/ostype/virttype combo, but the SKIP flag + * will avoid the error. Still, we expect qemu driver to complain about + * missing machine error, and not crash */ DO_TEST_PARSE_FLAGS_ERROR("missing-machine", VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, NONE); From patchwork Tue Jul 24 21:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142828 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55904ljj; Tue, 24 Jul 2018 14:24:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfgHUTuf3CSlJgwOVODlGEwQZcmLQSDlNyjIoUzCe6c51lzMGubdzdPo8OkxuxdjLcAvz0E X-Received: by 2002:a0c:e74c:: with SMTP id g12-v6mr16712516qvn.118.1532467454994; Tue, 24 Jul 2018 14:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467454; cv=none; d=google.com; s=arc-20160816; b=Oq/bqFHlOSvurVod5lTwklywtQmGojgoNv0GIkdgGPR2aenwMAiOkyg92fZn/cKq8y Jh84I0hXNQF/ER7OtmovsP8Gye4m97U5qY+gO8TQbM3G4Vt6mOfoTRjIuItMsYF520Ml +sUFAUUrq900FLzxeS7Ky77FZDrJ4bIz8ZTYTbsqayQ/eoTjJjqBNshMZKFenkPV2VR0 0tNLdtKIUWjr4bntBR/SQlQV8gY5Jnv64mwBAcgEhl+8o1gBB+XF1bp08iP6TqQc2aYn bAmnj9OGMZBEIMrbcvvW1ifmD+HU6KNYE9qWP6a2KzJAuLBLQDsrG+EvaAbCLSZmmzlP EVOQ== 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=be/Ex96pJD9j5lpdRcBbzhuSyTI3YltClANT7MuBdQ4=; b=a4++abSkz+0m0aUGIG4bOX2rJfGFUX2mOPOOz6VQFISesnB9UIgPh8hyYkHLut9Kgl A6812GjqR60vywmW2aDh8WwZzv1KrquweZLRkIGpBsQO2vq1rwWM/GRWCIWFyN0fPBd8 Q2T8H2r0uCoHHTzDEO+aqTan6NS4DjqPiTzsuXSCSGoFfmAI4odYPWBoNgdSTdwJHK2k d9fYzBsqFjoaKM7jJTCM9c8CL5Vc/VuA9Z+oBT1wf1CTRmbd35vsdxBzdakdbhw4PUKY pMzKbYrp/+VzPZjOABgbzvkbY3J95IFfyy4PNVqz5auPM8WsKRVhk4+QyfYQOlp2tgWJ /Uhw== 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 k63-v6si8566407qkd.196.2018.07.24.14.24.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:14 -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-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C19E307D875; Tue, 24 Jul 2018 21:24:12 +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 D8400CD481; Tue, 24 Jul 2018 21:24:11 +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 896FF4A46E; Tue, 24 Jul 2018 21:24:11 +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 w6OLNpn0018726 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 30857202704E; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16B1A2026D68; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:47 -0400 Message-Id: <5cac0b104fec38c5ef2fe0884b0707234cc76665.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] tests: Remove redundant lxc test 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 24 Jul 2018 21:24:14 +0000 (UTC) This test was added in 2d40e2da7ba to ensure LXC domains could be defined correctly when caps probing was skipped due to SKIP_OSTYPE. However we do caps probing unconditionally now, so this test case is redundant Signed-off-by: Cole Robinson --- tests/lxcxml2xmltest.c | 2 -- 1 file changed, 2 deletions(-) -- 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 3b96862c62..5dbeb0b2eb 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -96,8 +96,6 @@ mymain(void) DO_TEST("sharenet"); DO_TEST("ethernet"); DO_TEST("ethernet-hostip"); - DO_TEST_FULL("filesystem-root", 0, false, - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS); DO_TEST("initenv"); DO_TEST("initdir"); DO_TEST("inituser"); From patchwork Tue Jul 24 21:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142824 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55717ljj; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdxeOCoqkhy9dQoeXxRq3qbOV4B7aUbZE8yU9quNyA/4vxgJnq3WcHV0vzc4H7ux15V4L0w X-Received: by 2002:a37:1194:: with SMTP id 20-v6mr17795008qkr.379.1532467436810; Tue, 24 Jul 2018 14:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467436; cv=none; d=google.com; s=arc-20160816; b=r3KuZe6YzW55wLpankzPYSnexEYYqv6oY/2gn8xffKPCRqSvb6SjBz3Opg+rqaYxVY rMJvPRGnOnnHsGxsp5HLUL5H9Bz+B5b7PDmFLFCWJq+M/zQPuou3kVGpxIfjNwy+5Jwd GRY4H2YjJ6kmLnbrBRksAIN83GsMUo6rg5Tmze167nnqn7q+h/sV+kgPRM+k6YGpKEMO yPakc/HmDU2WYL8lg4+w9rEGF/jfqK0vSKqtLaSemEqPw0WHSnN9sdh5VrKFd6LIw45/ MDfh8LE2ryytvmW5Z69AeqbhC+V8ffEFkekhbCrNI4AuK+iJ6c28Gg79csasrV8et46m IB+Q== 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=I1eL8XCTXwc/xOPyGgYWCLXwzY3APZtyUEGMAHkM+os=; b=ZhIgYiyDbPiUIq7HfAPsSyZjSlCsoyOC+PfnEJa3j8uJYoVPgXXejdWiH5j0nAtgpl j43b21iY0rcbqJwZXR28qVtbRIiD4CPNQ4tCVkVEyGBCRfj2UXf4MKSCCII/XBJdcc/M nkrrSehe/f8ttyJ0LPlMcJ3N+Z7idzpf88UQCiVrnuxQkfs+LHy/EJgWiYhTMnldpJ2w Agl7YcaPHoMV/ialcrYDmHc8T0qPT7kEcFq/cAqJ1xy10KfTgDt7TvVDvZSehVDY6MWd zouGYtNuXU72fjZCfSUofLfOqQH6kZfc8F4d+oli8rBAYF1ZeMij3GmHAfQ+xfR7fq6v JXwA== 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 k1-v6si3793233qkc.104.2018.07.24.14.23.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:23:56 -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-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5157308FB9A; Tue, 24 Jul 2018 21:23:54 +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 6F1412016208; Tue, 24 Jul 2018 21:23:54 +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 F2A751800B69; Tue, 24 Jul 2018 21:23:52 +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 w6OLNpEA018727 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55008202704B; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B8112026D68; Tue, 24 Jul 2018 21:23:52 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:48 -0400 Message-Id: <41c968ac8374fcc8bc515e766062c5b7ca213448.1532467269.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] conf: Replace SKIP_OSTYPE_CHECKS with SKIP_VALIDATE 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.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 24 Jul 2018 21:23:55 +0000 (UTC) SKIP_OSTYPE_CHECKS only hides some error reporting at this point, so it can be foled into SKIP_VALIDATE Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 3 +-- src/conf/domain_conf.h | 13 +++++-------- src/conf/snapshot_conf.c | 2 -- src/conf/virdomainobjlist.c | 2 -- tests/qemuxml2argvtest.c | 2 +- tests/qemuxml2xmltest.c | 1 - 6 files changed, 7 insertions(+), 16 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 78ee000857..41baac08c0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28780,8 +28780,7 @@ virDomainDefCopy(virDomainDefPtr src, virDomainDefPtr ret; unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS; + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; if (migratable) format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5e2f21dea3..a804e86f6c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2981,24 +2981,21 @@ typedef enum { VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6, /* perform RNG schema validation on the passed XML document */ VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 7, - /* don't validate os.type and arch against capabilities. Prevents - * VMs from disappearing when qemu is removed and libvirtd is restarted */ - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8, /* allow updates in post parse callback that would break ABI otherwise */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 8, /* skip definition validation checks meant to be executed on define time only */ - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10, + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 9, /* skip parsing of security labels */ - VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 11, + VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 10, /* Allows updates in post parse callback for incoming persistent migration * that would break ABI otherwise. This should be used only if it's safe * to do such change. */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 12, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 11, /* Allows to ignore certain failures in the post parse callbacks, which * may happen due to missing packages and can be fixed by re-running the * post parse callbacks before starting. Failure of the post parse callback * is recorded as def->postParseFail */ - VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 13, + VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 12, } virDomainDefParseFlags; typedef enum { diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 9c537ac7d1..adba149241 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -273,8 +273,6 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, if ((tmp = virXPathString("string(./domain/@type)", ctxt))) { int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; - if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL) - domainflags |= VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS; xmlNodePtr domainNode = virXPathNode("./domain", ctxt); VIR_FREE(tmp); diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c index 72064d7c66..52171594f3 100644 --- a/src/conf/virdomainobjlist.c +++ b/src/conf/virdomainobjlist.c @@ -492,7 +492,6 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms, goto error; if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto error; @@ -544,7 +543,6 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms, VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto error; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 03b6d92912..84117a3e63 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2777,7 +2777,7 @@ mymain(void) * will avoid the error. Still, we expect qemu driver to complain about * missing machine error, and not crash */ DO_TEST_PARSE_FLAGS_ERROR("missing-machine", - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, NONE); DO_TEST("name-escape", diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 795ddc7003..c6cb2dda0c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -76,7 +76,6 @@ testCompareStatusXMLToXMLFiles(const void *opaque) VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) goto cleanup;