From nobody Thu Apr 25 21:50:16 2024 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=1610011410; cv=none; d=zohomail.com; s=zohoarc; b=lqV/0LQ0E+0jysYqx9tKRgUAIMPIwfwrDHMwrha9LWUN9xCu/wla0G81lTNnbpYp6LYnFZrsqvr/jtiQS/2jl3DaCDEP49qLoqc8frYNG8AQIyVwsWev2oXL72YzUAR1/rwKkq/dStiONN2P3WpyFEnaYRDgrum4An88LNex6Xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610011410; 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=fCd7q7XAEKwWqn9CO2HlY/isFxTOwX0FGz5ufGMcR14=; b=JBcMqWxv8zGIt8XZ2M517CssJ82x2XCazMzb28tj9dOA1TU/2Hj6HTEpJOIGTxTEnp6pCTcnKzfk53hBRp+UlFVH5ldCwvjmgOwQftHI8Sl1s/mnnx/0MJYV6zR0L35BDaLx1rnS9qN9ENvo5q9p4AoxR4i332FkcZnGEbT7ovY= 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 1610011410557735.1675251289489; Thu, 7 Jan 2021 01:23:30 -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-448-kiu-PycMOz67mto8BljgTg-1; Thu, 07 Jan 2021 04:23:27 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A1D0801FDA; Thu, 7 Jan 2021 09:23:22 +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 D91EC66A05; Thu, 7 Jan 2021 09:23:21 +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 9D26B4E58F; Thu, 7 Jan 2021 09:23:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1079N0rq029769 for ; Thu, 7 Jan 2021 04:23:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5775D62691; Thu, 7 Jan 2021 09:23:00 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71BE2669FC; Thu, 7 Jan 2021 09:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610011409; 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=fCd7q7XAEKwWqn9CO2HlY/isFxTOwX0FGz5ufGMcR14=; b=XJ41i/O4Ua6719vbJpTNLdTqlPuXZpNXoXouutnLfXbhXC8hN7zky+l/HcCi8yvI3ExUR3 UudzRpZpwkRwflgIgk4SQf58QoTTsYbRFllTETm1XLOr+x6LHSmaQmFLJHIhTbGcMpn1iw OaLIWWbEnmWe1Q61+Tr9AVUXpViBCqc= X-MC-Unique: kiu-PycMOz67mto8BljgTg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuDomainSetBlockIoTune: Remove old uninformative comment Date: Thu, 7 Jan 2021 10:22:53 +0100 Message-Id: <9639f69079122689d4c27373c545a90b5b19b31a.1610011253.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.15 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" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 26c6e9b2e1..1283e61785 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16301,9 +16301,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, #undef CHECK_MAX - /* NB: Let's let QEMU decide how to handle issues with _length - * via the JSON error code from the block_set_io_throttle call */ - qemuDomainObjEnterMonitor(driver, vm); ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, qdevi= d, &info, supportMaxOptions, --=20 2.29.2 From nobody Thu Apr 25 21:50:16 2024 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=1610011396; cv=none; d=zohomail.com; s=zohoarc; b=KLJpuGfdgtNBw9FLaSqMzVkBNO3Cmf1CMHfxKq9tyut1ajvspKjLqGfek6FBWk3S8zq9+ZSu0ERZRlQt/MM2Rx7gElKoPnrybFUt1JoziSbsPE84y5G5A6v7QX+zdgOmEmZYXg0+Wul0GYTQ/lC4HhYN06ROgYlS0xFOPUttmK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610011396; 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=kUn0pd7QWj/Y76AoETEN6gKijCoAmiTXoF70vJ6jsLI=; b=OBJjdTBvYsGx7Ce4Qyb731y7hGzOC95S+LnWN1EWsN7qOCIvNF/H+IFj011CCydD67Ab72bmlz/LDOzOqqEvnRmzooVCQwDA2SrGjkPSQc81wQsWEKjeUNYbG9tsAJbHsBIcl8s+IrkrS+7oAopFSnp/TkzYMqqgm2ep9XyYgP8= 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 1610011396140598.7278679419557; Thu, 7 Jan 2021 01:23:16 -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-156-3Q12992rNuWCJSvU9BZN2w-1; Thu, 07 Jan 2021 04:23:12 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CF719CDA2; Thu, 7 Jan 2021 09:23:07 +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 003A760BF1; Thu, 7 Jan 2021 09:23:06 +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 10BB7180954D; Thu, 7 Jan 2021 09:23:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1079N1jf029781 for ; Thu, 7 Jan 2021 04:23:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id E81435B6A2; Thu, 7 Jan 2021 09:23:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF350669FC; Thu, 7 Jan 2021 09:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610011395; 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=kUn0pd7QWj/Y76AoETEN6gKijCoAmiTXoF70vJ6jsLI=; b=BkZKs1g1M6tlLcHOcnGTcZf7BVPkATlhrUKW1NI7IVvowfzNjOiTHCHOz5KP+ud2MB8x+m cXt7uKw6m5jK16mkNQxljVZKl87otnN8bCYsxmI5gw/9rg+nb/tXzObuhPpW1gSxyUoR56 l0krkF0E5DSWwplMD6z8NLNLZcRPpfI= X-MC-Unique: 3Q12992rNuWCJSvU9BZN2w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemuDomainSetBlockIoTune: Skip monitor call for empty cdrom Date: Thu, 7 Jan 2021 10:22:54 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Han Han 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.12 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" Similarly to startup of the VM qemu doesn't like setting throttling for an empty drive. Just skip it since we do the correct thing once new media is inserted. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/117 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko Tested-by: Han Han --- CC: Han Han Please test this commit since you have the environment prepared. src/qemu/qemu_driver.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1283e61785..027617deef 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16301,16 +16301,23 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, #undef CHECK_MAX - qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, qdevi= d, - &info, supportMaxOptions, - set_fields & QEMU_BLOCK_IOTUNE= _SET_GROUP_NAME, - supportMaxLengthOptions); - if (qemuDomainObjExitMonitor(driver, vm) < 0) + /* blockdev-based qemu doesn't want to set the throttling when a c= drom + * is empty. Skip the monitor call here since we will set the thro= ttling + * once new media is inserted */ + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) || + !virStorageSourceIsEmpty(disk->src)) { + + qemuDomainObjEnterMonitor(driver, vm); + ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, q= devid, + &info, supportMaxOptions, + set_fields & QEMU_BLOCK_IO= TUNE_SET_GROUP_NAME, + supportMaxLengthOptions); + if (qemuDomainObjExitMonitor(driver, vm) < 0) + ret =3D -1; + if (ret < 0) + goto endjob; ret =3D -1; - if (ret < 0) - goto endjob; - ret =3D -1; + } virDomainDiskSetBlockIOTune(disk, &info); --=20 2.29.2