From nobody Fri Dec 19 15:57:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1685027939; cv=none; d=zohomail.com; s=zohoarc; b=WzVnS4QYCecrFnhA0s1/FcmCy270Bf3TRyQqn7nDFSmOmMxPlGe6U4cYhllI76HCFl8/1Slk/vSLdYWpLojS4LIq8u/BmMZo5kLZpQiJzRvUhg+vfYa3PHZyQZ2lOn38FqUdoeTOGfRlxqDkMYhG23Z94f8H0vVAusTpEq0p02I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685027939; 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=wrwSlGeXuLYe7CNgUuz1z3IqwhjIBMelnMglniBSIWg=; b=M25OWAAnPEvctRXehnjYCaFYFCO6I7+6F2UlwepiLzzmdQUj+FFBwmt0Erc20FjhKS3I0jbfzu5dqM/Zw+UMtLXA2Aqxj7gOfT8Xh3zLxiVFvphx+p7lK+leqKdtw0m9ww67jGhh6I7ItHxzcXPSfxT5zxdp4nio1VsNrw9seo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1685027939243298.60256750295787; Thu, 25 May 2023 08:18:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-v3kFKRhTNs-wOpJJVwkHfg-1; Thu, 25 May 2023 11:18:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB34F29DD99C; Thu, 25 May 2023 15:18:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 905FA2166B2B; Thu, 25 May 2023 15:18:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4754019465A4; Thu, 25 May 2023 15:18:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0A3A21946A42 for ; Thu, 25 May 2023 15:14:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 191BB40F6A5; Thu, 25 May 2023 15:13:59 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 968FA482062 for ; Thu, 25 May 2023 15:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685027938; 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=wrwSlGeXuLYe7CNgUuz1z3IqwhjIBMelnMglniBSIWg=; b=XUaeO0uiZFe/8ZsKsDjvsIS6liBAfMvITkmRW/C5cI09IFRcudGVqboOEOO+1728mOUhz5 /6GAynkHq5cDxqQqbb394UbLMLuRVFYTQhBg+SE7X0InhIARZV8dZV5yyXtVrN36zg70ul NbTniDs53Z42Ch3ZpNsG9nQ8PaAOgzw= X-MC-Unique: v3kFKRhTNs-wOpJJVwkHfg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/18] qemu: Refuse setting for 'SD' disks Date: Thu, 25 May 2023 17:13:41 +0200 Message-Id: <96e3a93612c7c7ffcd83c58b5be3585a5c57dbcd.1685027511.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685027940567100001 Content-Type: text/plain; charset="utf-8" Historically this didn't work with any supported qemu version as we don't set the alias of the device, and thus qemu uses a different alias resulting in a failure to startup the VM: internal error: unable to execute QEMU command 'block_set_io_throttle': D= evice 'drive-sd-disk0' not found Refuse setting throttling as this is unlikely to be needed and proper fix requires using -device instead of -drive if=3Dsd. Note that this was broken when I moved the setup of throttling as a command at startup for blockdev integration quite a while ago. Until then throttling was passed as arguments for -drive. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 17 +++++++++-------- src/qemu/qemu_validate.c | 8 ++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 00b58e0424..d3b37486c3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14764,11 +14764,12 @@ typedef enum { static bool -qemuDomainDiskBlockIoTuneIsSupported(virStorageSource *src) +qemuDomainDiskBlockIoTuneIsSupported(virDomainDiskDef *disk) { - if (virStorageSourceGetActualType(src) =3D=3D VIR_STORAGE_TYPE_VHOST_U= SER) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("a block I/O throttling is not supported for vhos= tuser disk")); + if (virStorageSourceGetActualType(disk->src) =3D=3D VIR_STORAGE_TYPE_V= HOST_USER || + disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SD) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("block I/O throttling is not supported for disk '= %1$s'"), disk->dst); return false; } @@ -15107,7 +15108,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, if (!(disk =3D qemuDomainDiskByName(def, path))) goto endjob; - if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src)) + if (!qemuDomainDiskBlockIoTuneIsSupported(disk)) goto endjob; if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { @@ -15193,7 +15194,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, goto endjob; } - if (!qemuDomainDiskBlockIoTuneIsSupported(conf_disk->src)) + if (!qemuDomainDiskBlockIoTuneIsSupported(conf_disk)) goto endjob; conf_cur_info =3D qemuDomainFindGroupBlockIoTune(persistentDef, co= nf_disk, &info); @@ -15284,7 +15285,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, if (!(disk =3D qemuDomainDiskByName(def, path))) goto endjob; - if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src)) + if (!qemuDomainDiskBlockIoTuneIsSupported(disk)) goto endjob; if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { @@ -15309,7 +15310,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, goto endjob; } - if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src)) + if (!qemuDomainDiskBlockIoTuneIsSupported(disk)) goto endjob; reply =3D disk->blkdeviotune; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da4b9a3b35..04d0c9df73 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3094,6 +3094,14 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const vi= rDomainDiskDef *disk, return -1; } + /* setting throttling for the SD card didn't work, refuse it explicitl= y */ + if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SD && + qemuDiskConfigBlkdeviotuneEnabled(disk)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _(" is not supported with bus=3D'sd'")); + return -1; + } + /* checking def here is only for calling from tests */ if (disk->blkdeviotune.group_name) { size_t i; --=20 2.40.1