From nobody Sun Feb 8 12:37:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575469335; cv=none; d=zohomail.com; s=zohoarc; b=HQs0yJ7gf8Y2ReoeOkO2c/0vIVuZCn7XiPL6sRBA+BGA2QP5X8w4+xNE+b3N7jmeDYMYYGkeoZUwN+Y8XA1H2n4amkZ10TyDWO/dBcyHnvKlyT6OIVo1l7bND0wWbZShbCqIOJbjXhY4xr+PsonFn01dE397TSrky1eAxsThIAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575469335; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X2ksm31RmGw47zOTLUXclUt7/OdZ6S/6/CPEojNhQ2g=; b=jtrG7P2+zwKMhHRoDM+YwxhCgFtYnfoHXwhzHo1WHcyzzKrTqtht3zyr2hi5dDE2ZpYx736cNb/bS4f8j1wdfJWR662rd/gz4p3bcIoCmV1Q5yRhI0WHl3C2sQJCtErwg3McHI45xO/Chx9l8qspqKrS8jnAdjqUA7/HjdzevLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1575469335405891.6317006088244; Wed, 4 Dec 2019 06:22:15 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-4JxVfJFuP02rA_k9k1saTA-1; Wed, 04 Dec 2019 09:21:54 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BA58DC13; Wed, 4 Dec 2019 14:21:48 +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 3422F19C68; Wed, 4 Dec 2019 14:21:48 +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 D72D862CF5; Wed, 4 Dec 2019 14:21:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB4ELUR4008145 for ; Wed, 4 Dec 2019 09:21:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 002061D1; Wed, 4 Dec 2019 14:21:30 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-55.ams2.redhat.com [10.36.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A60A691A3; Wed, 4 Dec 2019 14:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575469334; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=X2ksm31RmGw47zOTLUXclUt7/OdZ6S/6/CPEojNhQ2g=; b=hVrufCiLhASNbgqSZW3LIU2kmGryzwd3LSwvwAmXqlhg1c6AZUjBidoQ1M/Bsg2uY9gyew wChWTEAOQbBhLBqU/y4X2dvGz1AVpvB53Zctm37ruOLwdZTR8KPkZ6P1qu/3LQKauFaFw7 upxSgEU3fEP8dyWSJOf91FkwdJw699I= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 4 Dec 2019 14:20:52 +0000 Message-Id: <20191204142113.2961028-10-berrange@redhat.com> In-Reply-To: <20191204142113.2961028-1-berrange@redhat.com> References: <20191204142113.2961028-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/30] conf: move seclabel validation into post-parse phase 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: , 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-MC-Unique: 4JxVfJFuP02rA_k9k1saTA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Currently the disk and chardev seclabels are validated immediately at the time their data is parsed. This forces the parser to fill in the top level secmodel at time of parsing which is an undesirable thing. This validation conceptually should be done in the post-parse phase instead. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_conf.c | 196 ++++++++++++++++++----------------------- src/conf/domain_conf.h | 1 - src/qemu/qemu_driver.c | 2 +- tests/qemublocktest.c | 2 +- 4 files changed, 90 insertions(+), 111 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b45ca4a4d0..f037702ac2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5936,8 +5936,42 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDi= skBus bus, =20 =20 static int -virDomainDiskDefValidate(const virDomainDiskDef *disk) +virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabe= ls, + size_t nseclabels, + virSecurityLabelDefPtr *vmSeclabels, + size_t nvmSeclabels) +{ + virSecurityDeviceLabelDefPtr seclabel; + size_t i; + size_t j; + + for (i =3D 0; i < nseclabels; i++) { + seclabel =3D seclabels[i]; + + /* find the security label that it's being overridden */ + for (j =3D 0; j < nvmSeclabels; j++) { + if (STRNEQ_NULLABLE(vmSeclabels[j]->model, seclabel->model)) + continue; + + if (!vmSeclabels[j]->relabel) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("label overrides require relabeling to be= " + "enabled at the domain level")); + return -1; + } + } + } + + return 0; +} + + +static int +virDomainDiskDefValidate(const virDomainDef *def, + const virDomainDiskDef *disk) { + virStorageSourcePtr next; + /* Validate LUN configuration */ if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) { /* volumes haven't been translated at this point, so accept them */ @@ -5991,6 +6025,14 @@ virDomainDiskDefValidate(const virDomainDiskDef *dis= k) return -1; } =20 + for (next =3D disk->src; next; next =3D next->backingStore) { + if (virSecurityDeviceLabelDefValidateXML(next->seclabels, + next->nseclabels, + def->seclabels, + def->nseclabels) < 0) + return -1; + } + return 0; } =20 @@ -6014,10 +6056,11 @@ virDomainDefHasUSB(const virDomainDef *def) =20 =20 static int -virDomainChrSourceDefValidate(const virDomainChrSourceDef *def, - const virDomainChrDef *chr_def) +virDomainChrSourceDefValidate(const virDomainChrSourceDef *src_def, + const virDomainChrDef *chr_def, + const virDomainDef *def) { - switch ((virDomainChrType) def->type) { + switch ((virDomainChrType) src_def->type) { case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_PTY: case VIR_DOMAIN_CHR_TYPE_VC: @@ -6029,7 +6072,7 @@ virDomainChrSourceDefValidate(const virDomainChrSourc= eDef *def, case VIR_DOMAIN_CHR_TYPE_FILE: case VIR_DOMAIN_CHR_TYPE_DEV: case VIR_DOMAIN_CHR_TYPE_PIPE: - if (!def->data.file.path) { + if (!src_def->data.file.path) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing source path attribute for char devic= e")); return -1; @@ -6037,13 +6080,13 @@ virDomainChrSourceDefValidate(const virDomainChrSou= rceDef *def, break; =20 case VIR_DOMAIN_CHR_TYPE_NMDM: - if (!def->data.nmdm.master) { + if (!src_def->data.nmdm.master) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing master path attribute for nmdm devic= e")); return -1; } =20 - if (!def->data.nmdm.slave) { + if (!src_def->data.nmdm.slave) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing slave path attribute for nmdm device= ")); return -1; @@ -6051,19 +6094,19 @@ virDomainChrSourceDefValidate(const virDomainChrSou= rceDef *def, break; =20 case VIR_DOMAIN_CHR_TYPE_TCP: - if (!def->data.tcp.host) { + if (!src_def->data.tcp.host) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing source host attribute for char devic= e")); return -1; } =20 - if (!def->data.tcp.service) { + if (!src_def->data.tcp.service) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing source service attribute for char de= vice")); return -1; } =20 - if (def->data.tcp.listen && def->data.tcp.reconnect.enabled) { + if (src_def->data.tcp.listen && src_def->data.tcp.reconnect.enable= d) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("chardev reconnect is possible only for conne= ct mode")); return -1; @@ -6071,7 +6114,7 @@ virDomainChrSourceDefValidate(const virDomainChrSourc= eDef *def, break; =20 case VIR_DOMAIN_CHR_TYPE_UDP: - if (!def->data.udp.connectService) { + if (!src_def->data.udp.connectService) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing source service attribute for char de= vice")); return -1; @@ -6082,7 +6125,7 @@ virDomainChrSourceDefValidate(const virDomainChrSourc= eDef *def, /* The source path can be auto generated for certain specific * types of channels, but in most cases we should report an * error if the user didn't provide it */ - if (!def->data.nix.path && + if (!src_def->data.nix.path && !(chr_def && chr_def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNE= L && (chr_def->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TY= PE_XEN || @@ -6092,7 +6135,7 @@ virDomainChrSourceDefValidate(const virDomainChrSourc= eDef *def, return -1; } =20 - if (def->data.nix.listen && def->data.nix.reconnect.enabled) { + if (src_def->data.nix.listen && src_def->data.nix.reconnect.enable= d) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("chardev reconnect is possible only for conne= ct mode")); return -1; @@ -6100,13 +6143,13 @@ virDomainChrSourceDefValidate(const virDomainChrSou= rceDef *def, break; =20 case VIR_DOMAIN_CHR_TYPE_SPICEPORT: - if (!def->data.spiceport.channel) { + if (!src_def->data.spiceport.channel) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing source channel attribute for char de= vice")); return -1; } - if (strspn(def->data.spiceport.channel, - SERIAL_CHANNEL_NAME_CHARS) < strlen(def->data.spiceport= .channel)) { + if (strspn(src_def->data.spiceport.channel, + SERIAL_CHANNEL_NAME_CHARS) < strlen(src_def->data.spice= port.channel)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Invalid character in source channel for char= device")); return -1; @@ -6114,6 +6157,12 @@ virDomainChrSourceDefValidate(const virDomainChrSour= ceDef *def, break; } =20 + if (virSecurityDeviceLabelDefValidateXML(src_def->seclabels, + src_def->nseclabels, + def->seclabels, + def->nseclabels) < 0) + return -1; + return 0; } =20 @@ -6130,7 +6179,7 @@ virDomainRedirdevDefValidate(const virDomainDef *def, return -1; } =20 - return virDomainChrSourceDefValidate(redirdev->source, NULL); + return virDomainChrSourceDefValidate(redirdev->source, NULL, def); } =20 =20 @@ -6253,27 +6302,30 @@ virDomainControllerDefValidate(const virDomainContr= ollerDef *controller) =20 =20 static int -virDomainChrDefValidate(const virDomainChrDef *chr) +virDomainChrDefValidate(const virDomainChrDef *chr, + const virDomainDef *def) { - return virDomainChrSourceDefValidate(chr->source, chr); + return virDomainChrSourceDefValidate(chr->source, chr, def); } =20 =20 static int -virDomainSmartcardDefValidate(const virDomainSmartcardDef *smartcard) +virDomainSmartcardDefValidate(const virDomainSmartcardDef *smartcard, + const virDomainDef *def) { if (smartcard->type =3D=3D VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH) - return virDomainChrSourceDefValidate(smartcard->data.passthru, NUL= L); + return virDomainChrSourceDefValidate(smartcard->data.passthru, NUL= L, def); =20 return 0; } =20 =20 static int -virDomainRNGDefValidate(const virDomainRNGDef *rng) +virDomainRNGDefValidate(const virDomainRNGDef *rng, + const virDomainDef *def) { if (rng->backend =3D=3D VIR_DOMAIN_RNG_BACKEND_EGD) - return virDomainChrSourceDefValidate(rng->source.chardev, NULL); + return virDomainChrSourceDefValidate(rng->source.chardev, NULL, de= f); =20 return 0; } @@ -6470,7 +6522,7 @@ virDomainDeviceDefValidateInternal(const virDomainDev= iceDef *dev, { switch ((virDomainDeviceType) dev->type) { case VIR_DOMAIN_DEVICE_DISK: - return virDomainDiskDefValidate(dev->data.disk); + return virDomainDiskDefValidate(def, dev->data.disk); =20 case VIR_DOMAIN_DEVICE_REDIRDEV: return virDomainRedirdevDefValidate(def, dev->data.redirdev); @@ -6482,13 +6534,13 @@ virDomainDeviceDefValidateInternal(const virDomainD= eviceDef *dev, return virDomainControllerDefValidate(dev->data.controller); =20 case VIR_DOMAIN_DEVICE_CHR: - return virDomainChrDefValidate(dev->data.chr); + return virDomainChrDefValidate(dev->data.chr, def); =20 case VIR_DOMAIN_DEVICE_SMARTCARD: - return virDomainSmartcardDefValidate(dev->data.smartcard); + return virDomainSmartcardDefValidate(dev->data.smartcard, def); =20 case VIR_DOMAIN_DEVICE_RNG: - return virDomainRNGDefValidate(dev->data.rng); + return virDomainRNGDefValidate(dev->data.rng, def); =20 case VIR_DOMAIN_DEVICE_HOSTDEV: return virDomainHostdevDefValidate(dev->data.hostdev); @@ -9044,37 +9096,6 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceL= abelDefPtr **seclabels_rtn, } =20 =20 -static int -virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabe= ls, - size_t nseclabels, - virSecurityLabelDefPtr *vmSeclabels, - size_t nvmSeclabels) -{ - virSecurityDeviceLabelDefPtr seclabel; - size_t i; - size_t j; - - for (i =3D 0; i < nseclabels; i++) { - seclabel =3D seclabels[i]; - - /* find the security label that it's being overridden */ - for (j =3D 0; j < nvmSeclabels; j++) { - if (STRNEQ_NULLABLE(vmSeclabels[j]->model, seclabel->model)) - continue; - - if (!vmSeclabels[j]->relabel) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("label overrides require relabeling to be= " - "enabled at the domain level")); - return -1; - } - } - } - - return 0; -} - - /* Parse the XML definition for a lease */ static virDomainLeaseDefPtr @@ -9703,9 +9724,7 @@ virDomainDiskSourceDefParseAuthValidate(const virStor= ageSource *src) =20 =20 static int -virDomainDiskDefParseValidate(const virDomainDiskDef *def, - virSecurityLabelDefPtr *vmSeclabels, - size_t nvmSeclabels) +virDomainDiskDefParseValidate(const virDomainDiskDef *def) =20 { virStorageSourcePtr next; @@ -9796,12 +9815,6 @@ virDomainDiskDefParseValidate(const virDomainDiskDef= *def, return -1; } } - - if (virSecurityDeviceLabelDefValidateXML(next->seclabels, - next->nseclabels, - vmSeclabels, - nvmSeclabels) < 0) - return -1; } =20 return 0; @@ -9958,8 +9971,6 @@ static virDomainDiskDefPtr virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, - virSecurityLabelDefPtr* vmSeclabels, - int nvmSeclabels, unsigned int flags) { virDomainDiskDefPtr def; @@ -10362,7 +10373,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlo= pt, virDomainDiskDefParsePrivateData(ctxt, def, xmlopt) < 0) goto error; =20 - if (virDomainDiskDefParseValidate(def, vmSeclabels, nvmSeclabels) < 0) + if (virDomainDiskDefParseValidate(def) < 0) goto error; =20 cleanup: @@ -12652,9 +12663,7 @@ static int virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def, xmlNodePtr cur, unsigned int flags, virDomainChrDefPtr chr_def, - xmlXPathContextPtr ctxt, - virSecurityLabelDefPtr* vmSeclabels, - int nvmSeclabels) + xmlXPathContextPtr ctxt) { bool logParsed =3D false; bool protocolParsed =3D false; @@ -12737,11 +12746,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDe= fPtr def, if (virSecurityDeviceLabelDefParseXML(&def->seclabels, &def->nseclabels, ctxt, - flags) < 0 || - virSecurityDeviceLabelDefValidateXML(def->seclabels, - def->nseclabels, - vmSeclabels, - nvmSeclabels) < 0= ) { + flags) < 0) { ctxt->node =3D saved_node; goto error; } @@ -12878,8 +12883,6 @@ static virDomainChrDefPtr virDomainChrDefParseXML(virDomainXMLOptionPtr xmlopt, xmlXPathContextPtr ctxt, xmlNodePtr node, - virSecurityLabelDefPtr* vmSeclabels, - int nvmSeclabels, unsigned int flags) { xmlNodePtr cur; @@ -12926,7 +12929,7 @@ virDomainChrDefParseXML(virDomainXMLOptionPtr xmlop= t, goto error; =20 if (virDomainChrSourceDefParseXML(def->source, node->children, flags, = def, - ctxt, vmSeclabels, nvmSeclabels) < 0) + ctxt) < 0) goto error; =20 if (def->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_SPICEVMC) { @@ -13057,7 +13060,7 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPtr= xmlopt, =20 cur =3D node->children; if (virDomainChrSourceDefParseXML(def->data.passthru, cur, flags, - NULL, ctxt, NULL, 0) < 0) + NULL, ctxt) < 0) goto error; =20 if (def->data.passthru->type =3D=3D VIR_DOMAIN_CHR_TYPE_SPICEVMC) { @@ -14692,7 +14695,7 @@ virDomainRNGDefParseXML(virDomainXMLOptionPtr xmlop= t, =20 if (virDomainChrSourceDefParseXML(def->source.chardev, backends[0]->children, flags, - NULL, ctxt, NULL, 0) < 0) + NULL, ctxt) < 0) goto error; break; =20 @@ -15713,7 +15716,7 @@ virDomainRedirdevDefParseXML(virDomainXMLOptionPtr = xmlopt, /* boot gets parsed in virDomainDeviceInfoParseXML * source gets parsed in virDomainChrSourceDefParseXML */ if (virDomainChrSourceDefParseXML(def->source, cur, flags, - NULL, ctxt, NULL, 0) < 0) + NULL, ctxt) < 0) goto error; =20 if (def->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_SPICEVMC) @@ -16413,8 +16416,6 @@ virDomainDeviceDefParse(const char *xmlStr, switch ((virDomainDeviceType) dev->type) { case VIR_DOMAIN_DEVICE_DISK: if (!(dev->data.disk =3D virDomainDiskDefParseXML(xmlopt, node, ct= xt, - def->seclabels, - def->nseclabels, flags))) return NULL; break; @@ -16484,8 +16485,6 @@ virDomainDeviceDefParse(const char *xmlStr, if (!(dev->data.chr =3D virDomainChrDefParseXML(xmlopt, ctxt, node, - def->seclabels, - def->nseclabels, flags))) return NULL; break; @@ -16552,14 +16551,11 @@ virDomainDeviceDefParse(const char *xmlStr, =20 virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr, - const virDomainDef *def, virDomainXMLOptionPtr xmlopt, unsigned int flags) { g_autoptr(xmlDoc) xml =3D NULL; g_autoptr(xmlXPathContext) ctxt =3D NULL; - virSecurityLabelDefPtr *seclabels =3D NULL; - size_t nseclabels =3D 0; =20 if (!(xml =3D virXMLParseStringCtxt(xmlStr, _("(disk_definition)"), &c= txt))) return NULL; @@ -16571,13 +16567,7 @@ virDomainDiskDefParse(const char *xmlStr, return NULL; } =20 - if (def) { - seclabels =3D def->seclabels; - nseclabels =3D def->nseclabels; - } - - return virDomainDiskDefParseXML(xmlopt, ctxt->node, ctxt, - seclabels, nseclabels, flags); + return virDomainDiskDefParseXML(xmlopt, ctxt->node, ctxt, flags); } =20 =20 @@ -20767,8 +20757,6 @@ virDomainDefParseXML(xmlDocPtr xml, virDomainDiskDefPtr disk =3D virDomainDiskDefParseXML(xmlopt, nodes[i], ctxt, - def->seclabels, - def->nseclabel= s, flags); if (!disk) goto error; @@ -20919,8 +20907,6 @@ virDomainDefParseXML(xmlDocPtr xml, virDomainChrDefPtr chr =3D virDomainChrDefParseXML(xmlopt, ctxt, nodes[i], - def->seclabels, - def->nseclabels, flags); if (!chr) goto error; @@ -20947,8 +20933,6 @@ virDomainDefParseXML(xmlDocPtr xml, virDomainChrDefPtr chr =3D virDomainChrDefParseXML(xmlopt, ctxt, nodes[i], - def->seclabels, - def->nseclabels, flags); if (!chr) goto error; @@ -20977,8 +20961,6 @@ virDomainDefParseXML(xmlDocPtr xml, virDomainChrDefPtr chr =3D virDomainChrDefParseXML(xmlopt, ctxt, nodes[i], - def->seclabels, - def->nseclabels, flags); if (!chr) goto error; @@ -20997,8 +20979,6 @@ virDomainDefParseXML(xmlDocPtr xml, virDomainChrDefPtr chr =3D virDomainChrDefParseXML(xmlopt, ctxt, nodes[i], - def->seclabels, - def->nseclabels, flags); if (!chr) goto error; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 037cebae64..e85d3bd5b5 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3044,7 +3044,6 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(const c= har *xmlStr, void *parseOpaque, unsigned int flags); virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr, - const virDomainDef *def, virDomainXMLOptionPtr xmlopt, unsigned int flags); virDomainDefPtr virDomainDefParseString(const char *xmlStr, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b274542c3e..891ca28d94 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18435,7 +18435,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *d= isk, const char *destxml, } } =20 - if (!(diskdef =3D virDomainDiskDefParse(destxml, vm->def, driver->xmlo= pt, + if (!(diskdef =3D virDomainDiskDefParse(destxml, driver->xmlopt, VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_DISK_SOURCE= ))) goto cleanup; diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index fcdbcefb5d..2c170548ec 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -200,7 +200,7 @@ testQemuDiskXMLToProps(const void *opaque) goto cleanup; =20 /* qemu stores node names in the status XML portion */ - if (!(disk =3D virDomainDiskDefParse(xmlstr, NULL, data->driver->xmlop= t, + if (!(disk =3D virDomainDiskDefParse(xmlstr, data->driver->xmlopt, VIR_DOMAIN_DEF_PARSE_STATUS))) goto cleanup; =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list