From nobody Mon Feb 9 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1618587629; cv=none; d=zohomail.com; s=zohoarc; b=Im4rw65Nk+C7yAqvkwqwV0MbfW7wi8dHzDMLbbV5Pef38oraLS2zXD/G0+bquI1mfBQHuAO66QYtdQ2X9XZJbll8K63+IRm3Bduq0bQGw5dl+QsEy9jkRqC0M6kR6KsYhbPkZPkdIsVDPLc24wvfgO/jPedpEIfAAoZNiLmnkbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618587629; 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=f9kuqdjQSoQi4toJ+w1V57l1Qw0APcapNRwV32EMtvs=; b=eqIpxSmuBadXrmBxm9/XLL24HVcdg3r2lRVcVlv6G6dJbg53tSFpeZQe6FQOkgjLSMiXPEIvxmdzjlIYc49SYcLykbu93yv//zwIMfDdDgkz35H4v/lhAChWLe/FOji0pazNu7UqyRihcNNRNvCwMN3uvMo8wpDKMxR/jp8imPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 161858762932284.33262533771267; Fri, 16 Apr 2021 08:40:29 -0700 (PDT) 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-44-08FbFdtoMNWIIpcrSHUWUQ-1; Fri, 16 Apr 2021 11:38:33 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C3B5107ACF5; Fri, 16 Apr 2021 15:38:28 +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 6B5A96E6F9; Fri, 16 Apr 2021 15:38:28 +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 271EA44A5F; Fri, 16 Apr 2021 15:38:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13GFYvks009284 for ; Fri, 16 Apr 2021 11:34:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id A744B1C4; Fri, 16 Apr 2021 15:34:57 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 147A45C3DF for ; Fri, 16 Apr 2021 15:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618587627; 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=f9kuqdjQSoQi4toJ+w1V57l1Qw0APcapNRwV32EMtvs=; b=D/E2YhxWjW5s2MeVpEjvBM4EtIXo6D23xiHFOeDss8yYCcgA93rpxuABayJF1wpzwldZCK cy/wuuqYuFp/jfvGnDG5WZnlqVK9oTt3vdpUlJQR43ID3+12p//J0qiTKwfSfI3q+iKfNb iEXXP1xxuOvkqsnd9F28Jt8jTFop0W0= X-MC-Unique: 08FbFdtoMNWIIpcrSHUWUQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/25] conf: domain: Remove VIR_DOMAIN_DEF_PARSE_DISK_SOURCE parser flag Date: Fri, 16 Apr 2021 17:34:26 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There's no code which would assert it at this point. Remove the flag. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 47 ++++++++++++++++++++---------------------- src/conf/domain_conf.h | 14 ++++++------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1793032301..3f32e046f3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9603,14 +9603,13 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, * to indicate no media present. LUN is for raw access CD-ROMs * that are not attached to a physical device presently */ if (virStorageSourceIsEmpty(def->src) && - (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_DISK || - (flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE))) { + def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_DISK) { virReportError(VIR_ERR_NO_SOURCE, target ? "%s" : NULL, target); return NULL; } - if (!target && !(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { + if (!target) { if (def->src->srcpool) { tmp =3D g_strdup_printf("pool =3D '%s', volume =3D '%s'", def->src->srcpool->pool, def->src->srcpo= ol->volume); @@ -9623,29 +9622,27 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, return NULL; } - if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { - if (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY && - !STRPREFIX(target, "fd")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid floppy device name: %s"), target); - return NULL; - } + if (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY && + !STRPREFIX(target, "fd")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid floppy device name: %s"), target); + return NULL; + } - /* Force CDROM to be listed as read only */ - if (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) - def->src->readonly =3D true; + /* Force CDROM to be listed as read only */ + if (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) + def->src->readonly =3D true; - if ((def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_DISK || - def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) && - !STRPREFIX((const char *)target, "hd") && - !STRPREFIX((const char *)target, "sd") && - !STRPREFIX((const char *)target, "vd") && - !STRPREFIX((const char *)target, "xvd") && - !STRPREFIX((const char *)target, "ubd")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid harddisk device name: %s"), target); - return NULL; - } + if ((def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_DISK || + def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) && + !STRPREFIX((const char *)target, "hd") && + !STRPREFIX((const char *)target, "sd") && + !STRPREFIX((const char *)target, "vd") && + !STRPREFIX((const char *)target, "xvd") && + !STRPREFIX((const char *)target, "ubd")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid harddisk device name: %s"), target); + return NULL; } if (snapshot) { @@ -9686,7 +9683,7 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, } else { if (def->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY) { def->bus =3D VIR_DOMAIN_DISK_BUS_FDC; - } else if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { + } else { if (STRPREFIX(target, "hd")) def->bus =3D VIR_DOMAIN_DISK_BUS_IDE; else if (STRPREFIX(target, "sd")) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 83b9288941..1a2e0fc872 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3353,25 +3353,23 @@ typedef enum { VIR_DOMAIN_DEF_PARSE_ALLOW_ROM =3D 1 << 4, /* internal flag passed to device info sub-parser to allow specifying = boot order */ VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT =3D 1 << 5, - /* parse only source half of */ - VIR_DOMAIN_DEF_PARSE_DISK_SOURCE =3D 1 << 6, /* perform RNG schema validation on the passed XML document */ - VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA =3D 1 << 7, + VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA =3D 1 << 6, /* allow updates in post parse callback that would break ABI otherwise= */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE =3D 1 << 8, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE =3D 1 << 7, /* skip definition validation checks meant to be executed on define ti= me only */ - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE =3D 1 << 9, + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE =3D 1 << 8, /* skip parsing of security labels */ - VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL =3D 1 << 10, + VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL =3D 1 << 9, /* Allows updates in post parse callback for incoming persistent migra= tion * that would break ABI otherwise. This should be used only if it's s= afe * to do such change. */ - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION =3D 1 << 11, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION =3D 1 << 10, /* Allows to ignore certain failures in the post parse callbacks, which * may happen due to missing packages and can be fixed by re-running t= he * post parse callbacks before starting. Failure of the post parse cal= lback * is recorded as def->postParseFail */ - VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL =3D 1 << 12, + VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL =3D 1 << 11, } virDomainDefParseFlags; typedef enum { --=20 2.30.2