From nobody Mon Feb 9 02:56:14 2026 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=1658846309; cv=none; d=zohomail.com; s=zohoarc; b=KpHu7Y/YvWi/Q/SwmRlqn/7syDDGCCGTzCqMQ2RmN9R8JDg3YM0S0n/JK9bKCSfdMQ1LDoz5mqSPWxrHrNSIfl5Ve8sqD7xLyWWP004zhjw47WpJj3hTvuYNMNwoHXwUgrYvMcENgcStkyoi18e2M8lGMY1Ysd/PkL/9h4l2OlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846309; 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=umNGtgRsH/f5CuP+7hKiGE6S3piFvbiXRcN20T7MaY4=; b=ljNpBD/Ns6bcL+nO3YyX1/OojolLryit73/M7wgGyV++sbt6IdZbVserkD65klcueUh0SMcpR1Y3gNFHIn0KBZEqSVQwPPuQWzLXha7iWsrBjWqVAv0x7Snc7pq1DQfK9MDugQGQz+lH/ku35wFMj5U45wn6lia6bxxhPc1ZCiM= 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 16588463093694.620099098794185; Tue, 26 Jul 2022 07:38:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-5zritfZWNV6QK54lMw7mbQ-1; Tue, 26 Jul 2022 10:38:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6BF390EC48; Tue, 26 Jul 2022 14:38:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B21902026D07; Tue, 26 Jul 2022 14:38:14 +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 CF05C1945DA7; Tue, 26 Jul 2022 14:38:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3E2291945DA2 for ; Tue, 26 Jul 2022 14:38:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 24DDA40CFD0A; Tue, 26 Jul 2022 14:38:12 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8E12400DFD7 for ; Tue, 26 Jul 2022 14:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846308; 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=umNGtgRsH/f5CuP+7hKiGE6S3piFvbiXRcN20T7MaY4=; b=HksoDH6UP8jGE+8gkVo/jzHZqvfEVvut0R6cU8c8nsxw7DdOUk+i9HlMeDQW0MaHIEsx65 iuq8TIvxPCaUWOjCM70mnxahPSt5S3Tg440pISZ3Ywtgiz3RE+TTorjjaaHlrN71SZ+msX dYjPCXJjUQoaSy0TtYzZvRX4I2tL13k= X-MC-Unique: 5zritfZWNV6QK54lMw7mbQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/80] qemu: capabilities: Unconditionally set QEMU_CAPS_BLOCKDEV/QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI Date: Tue, 26 Jul 2022 16:36:51 +0200 Message-Id: <2283db08421c27ff6392fc8729cdad4df8d01d54.1658843187.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 2.78 on 10.11.54.4 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) X-ZM-MESSAGEID: 1658846310068100011 Content-Type: text/plain; charset="utf-8" The cleanup of the code to always assume support for QEMU_CAPS_BLOCKDEV will not be simple, so for now we hardcode the support and the code will be cleaned up gradually. We also disallow users to clear the flags via the namespace property or qemu.conf configuration. The change to the PPC64 test data originatest from the fact that the capability dump is not from the release version but is lacking one of the necessary flags to enable -blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko Reviewed-by: Pavel Hrdina --- src/qemu/qemu_capabilities.c | 18 +++++------------- src/qemu/qemu_process.c | 12 ++++++++++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 3 +++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e8b7d91062..9cffb07b9d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5228,6 +5228,11 @@ virQEMUCapsInitQMPBasicArch(virQEMUCaps *qemuCaps) static void virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) { + /* While the removal of pre-blockdev code is in progress we always har= d-code + * the support for QEMU_CAPS_BLOCKDEV */ + virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI); + /* -enable-fips is deprecated in QEMU 5.2.0, and QEMU * should be built with gcrypt to achieve FIPS compliance * automatically / implicitly @@ -5247,17 +5252,11 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) void virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) - virQEMUCapsClear(qemuCaps, QEMU_CAPS_BLOCKDEV_BACKUP); - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_BACKUP) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MA= PPING)) virQEMUCapsSet(qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP); - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI); - /* The -compat qemu command line argument is implemented using a newer * method which doesn't show up in query-command-line-options. As we'l= l use * it only for development and testing purposes we can base the capabi= lity @@ -5302,13 +5301,6 @@ virQEMUCapsInitProcessCaps(virQEMUCaps *qemuCaps) if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_UNAVAILABLE_FEATURES)) virQEMUCapsSet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES); - /* To avoid guest ABI regression, blockdev shall be enabled only when - * we are able to pass the custom 'device_id' for SCSI disks and cdrom= s. */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMI= C) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_DEVICE_ID) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_SAVEVM_MONITOR_NODES)) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV); - /* We can't probe "esp" as a type via virQEMUCapsObjectTypes * array as it is only usable when builtin to the machine type */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d42333195a..438c903578 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5644,6 +5644,12 @@ qemuProcessStartUpdateCustomCaps(virDomainObj *vm) return -1; } + /* The code is being cleaned up to always assume the support f= or + * -blockdev thus we must no longer allow users to clear it */ + if (tmp =3D=3D QEMU_CAPS_BLOCKDEV || + tmp =3D=3D QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI) + continue; + virQEMUCapsClear(priv->qemuCaps, tmp); } } @@ -5668,6 +5674,12 @@ qemuProcessStartUpdateCustomCaps(virDomainObj *vm) return -1; } + /* The code is being cleaned up to always assume the support f= or + * -blockdev thus we must no longer allow users to clear it */ + if (tmp =3D=3D QEMU_CAPS_BLOCKDEV || + tmp =3D=3D QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI) + continue; + virQEMUCapsClear(priv->qemuCaps, tmp); } } diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsda= ta/qemu_4.2.0.ppc64.xml index 4c3a2c6d98..7d3dd3c917 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -138,7 +138,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.ppc64.xml index cbdc1dd09a..702f6551a4 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -112,6 +112,7 @@ + @@ -140,11 +141,13 @@ + + --=20 2.36.1