From nobody Sun Feb 8 12:32:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1611847363; cv=none; d=zohomail.com; s=zohoarc; b=OA0xhOa+q7YjjGOzIsasvhWMpNWrXuEZcHQ/lXGmmn99cDlmOQysecUcjp29uLsmyiNNGQds8EeBzGSj9ZQ655jsGL+6DZWSxgTGH2/3L2UKOENTmEAINFJ5PYq+VfFbXiUo6RaWAlTl6gNrGbc4Ab2PkSVfceD03sF6lnxMPMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611847363; h=Content-Type:Content-Transfer-Encoding:Cc: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=kZAZOAkCJTE0GfDsFzEN53RGHTsKifj5vhDWlKF2nrY=; b=mMW8WoIsEN4BkZqivY0moAvel3xMCffU7PSs690iXygFvWI77EWn0stL7WeNnQoSTz6WFVpgeg5oWllHlnElpV+C9XdmY6dY5K7vjSjbaG5fyfCMnYJXrJGlttJ8tM+2rBaSdBzDn7vKAF0RM04rOAJIbb49A2p/7uoKFAR3eKg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611847363275868.08272284038; Thu, 28 Jan 2021 07:22:43 -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-202-PeTfo3mIO76jrN1V74YSjA-1; Thu, 28 Jan 2021 10:22:39 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43C6759; Thu, 28 Jan 2021 15:22:34 +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 1F2536085D; Thu, 28 Jan 2021 15:22:34 +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 DA3DB1809CA4; Thu, 28 Jan 2021 15:22:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SFFuSY029986 for ; Thu, 28 Jan 2021 10:15:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id C69255D9F4; Thu, 28 Jan 2021 15:15:56 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06D475D9EF; Thu, 28 Jan 2021 15:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611847362; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=kZAZOAkCJTE0GfDsFzEN53RGHTsKifj5vhDWlKF2nrY=; b=HxspTTUcT44XbfKxhlrNxnpNJ6BpQcd5cMg02OloBsZES7ukVNR5A3ppolbx9hK9I/Drog HS9T+tQjvZNEOZ48NEKlJ+pLRYRYpOgUz5+7MxR9XKui9Tae7Xuurc184MlwlYqm9Tz8gd 15uYmuFDON1aX8Rb1QcTE6b1jPB9NzI= X-MC-Unique: PeTfo3mIO76jrN1V74YSjA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/7] Add validation for virtiofs boot order setting Date: Thu, 28 Jan 2021 16:15:39 +0100 Message-Id: <29b85075f7e658139c7bb8fc7ba386c0dbce73e2.1611846597.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: lersek@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.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- src/conf/domain_validate.c | 17 ++++++++++++++++- src/qemu/qemu_validate.c | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 649fc335ac..404eee09a9 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1528,6 +1528,19 @@ virDomainShmemDefValidate(const virDomainShmemDef *s= hmem) return 0; } =20 +static int +virDomainFSDefValidate(const virDomainFSDef *fs) +{ + if (fs->info.bootIndex && + fs->fsdriver !=3D VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("boot order is only supported for virtiofs")); + return -1; + } + + return 0; +} + =20 static int virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev, @@ -1573,10 +1586,12 @@ virDomainDeviceDefValidateInternal(const virDomainD= eviceDef *dev, case VIR_DOMAIN_DEVICE_SHMEM: return virDomainShmemDefValidate(dev->data.shmem); =20 + case VIR_DOMAIN_DEVICE_FS: + return virDomainFSDefValidate(dev->data.fs); + case VIR_DOMAIN_DEVICE_AUDIO: /* TODO: validate? */ case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_SOUND: case VIR_DOMAIN_DEVICE_WATCHDOG: case VIR_DOMAIN_DEVICE_GRAPHICS: diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index a060bd98ba..92319ab3a5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4093,6 +4093,12 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, } if (qemuValidateDomainDefVirtioFSSharedMemory(def, qemuCaps) < 0) return -1; + if (fs->info.bootIndex && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOST_USER_FS_BOOTINDEX)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting virtiofs boot order is not supported= with this QEMU binary")); + return -1; + } break; =20 case VIR_DOMAIN_FS_DRIVER_TYPE_LAST: --=20 2.29.2