From nobody Tue Sep 9 03:20:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332328; cv=none; d=zohomail.com; s=zohoarc; b=XrxZ1AYBxtwqKHcrn1K6nOdEH7MqUnZCaHHMZ4P69QIPpr2Rdy9+6Px2djb3cx6Am1PCJzk/fyUVAyqJMK1A+tc3nqwbCPBS6LSaDtFyIwRRUay/rL25WW+KqM524KjclOdQeE1TBrT5bM+lDefssr9a2L1wADTWfjaNyRkGHag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332328; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=tbA4t5/I+Jgw2JEvVcxppxBHJnV9ZyEZuuke39msDt0=; b=KyTvSZtylMJQjB/O451wYIwyb56xRlLWgghIz+fHj2pvzyz6WrK4A48tm5YjmgMo6FhbgVTcly16Zy9ie0zuF76G+3QZ757AvXv5aKHn9i52Y1K0sfv52/+UDxHevFA5eledR0WZBjYBIqmg/kgGKXMyg3edFzEv6il/z8eYFSU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1748332328120575.3448019831233; Tue, 27 May 2025 00:52:08 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 22B8616B2; Tue, 27 May 2025 03:52:07 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B3BE1177A; Tue, 27 May 2025 03:49:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BA83F1290; Tue, 27 May 2025 03:49:31 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E219212C2 for ; Tue, 27 May 2025 03:49:18 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-189-Bk653UToNQuqQ3VkoCzNpw-1; Tue, 27 May 2025 03:49:16 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 656021956080 for ; Tue, 27 May 2025 07:49:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9662318001DB for ; Tue, 27 May 2025 07:49:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748332158; h=from:from: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; bh=q5LfOfbv5/riJyTuVSK2IZ7KoYWDFBJUSlOLL/HsRF4=; b=G15ptHGpIg4cyhN6DYsEWAUwjh5Za9QLxj9JsVHT64Etoz4Mipkkpyes8vqbjP/YZ7Ij1m +MM/NWxkk5lR6KuiE9nil1B2h0jRJkXLa5TMmwE4o4a5qojxU7V287DUvKWdUcKkZETgYW vbmL4iyt9KhlHq9Hb+nzx+AeiohOAyg= X-MC-Unique: Bk653UToNQuqQ3VkoCzNpw-1 X-Mimecast-MFC-AGG-ID: Bk653UToNQuqQ3VkoCzNpw_1748332155 To: devel@lists.libvirt.org Subject: [PATCH 6/9] qemu: Move logic from qemuProcessStartValidateShmem to qemuValidateDomainDeviceDefShmem Date: Tue, 27 May 2025 09:49:02 +0200 Message-ID: <01f0b7b9eef5924fb50daa96ef6467feb3caea6f.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: t1or7f-2O-b_c77_Naw-W2MzBlqdSYe0pe5wwqnLnVg_1748332155 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BB5TYA6LRTUGQSAFZIYOF46BZKKMSID7 X-Message-ID-Hash: BB5TYA6LRTUGQSAFZIYOF46BZKKMSID7 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332330238116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the check to the appropriate central place. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 23 ----------------------- src/qemu/qemu_validate.c | 7 +++++++ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c13a284473..9fbb03ee8b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5580,26 +5580,6 @@ qemuProcessStartValidateGraphics(virDomainObj *vm) } -static int -qemuProcessStartValidateShmem(virDomainObj *vm) -{ - size_t i; - - for (i =3D 0; i < vm->def->nshmems; i++) { - virDomainShmemDef *shmem =3D vm->def->shmems[i]; - - if (strchr(shmem->name, '/')) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("shmem name '%1$s' must not contain '/'"), - shmem->name); - return -1; - } - } - - return 0; -} - - /* 250 parts per million (ppm) is a half of NTP threshold */ #define TSC_TOLERANCE 250 @@ -5707,9 +5687,6 @@ qemuProcessStartValidate(virQEMUDriver *driver, if (qemuProcessStartValidateGraphics(vm) < 0) return -1; - if (qemuProcessStartValidateShmem(vm) < 0) - return -1; - if (vm->def->cpu) { if (virCPUValidateFeatures(vm->def->os.arch, vm->def->cpu) < 0) return -1; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e45f636418..0e7dd3fc58 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5472,6 +5472,13 @@ static int qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem, virQEMUCaps *qemuCaps) { + if (strchr(shmem->name, '/')) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("shmem name '%1$s' must not contain '/'"), + shmem->name); + return -1; + } + if (shmem->size > 0) { if (shmem->size < 1024 * 1024 || !VIR_IS_POW2(shmem->size)) { --=20 2.49.0