From nobody Fri Dec 19 17:39:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1588766958; cv=none; d=zohomail.com; s=zohoarc; b=UFjMSRZfxKjQrLxMv/L76qqAse7CvJjcuvwgcvK5w1UX0WCONkeM5tgEWyF+Ch38pi1lOd6l2UKRM/j+R5rTl2UVETc0cDHhUvsbTeTXk1PmLlyuXjfWLOoGNJ0wevJih4hxdAbb3V+69eW8EEdnwqoZK5aMrlYv5VIPGn5a/Ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588766958; 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=ScYc2FuhnhukSS38GYyyalHB0sJMJkYj9CyO+U50q1Q=; b=RI2Q2UYaTyQthTuFERXygLZYhykoZMh71whNrpq1tg0Nre/tr70l8AsHbIklH02Q8vDv0D7WOp4XY/LbfNM3pYhthhzvrml70he3YuVLGrXcYcNQOksGf7rNWK048o7CieZ2teQQdWU8QwRQf4uFihn/i5GqSPASrbUkJTUfdFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1588766958329553.4389397825671; Wed, 6 May 2020 05:09:18 -0700 (PDT) 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-109-FItVeM8cPgynlb2k9ijE7A-1; Wed, 06 May 2020 08:09:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A50A88014D9; Wed, 6 May 2020 12:09:09 +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 782F31001B07; Wed, 6 May 2020 12:09:09 +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 29AC6180954D; Wed, 6 May 2020 12:09:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 046C94jC029784 for ; Wed, 6 May 2020 08:09:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 96AA95C1D4; Wed, 6 May 2020 12:09:04 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 081465C1BD for ; Wed, 6 May 2020 12:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588766957; 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=ScYc2FuhnhukSS38GYyyalHB0sJMJkYj9CyO+U50q1Q=; b=gwZgTLMGxyyR07kHUqmRqvd/Nc5SV679irrCFligCIiU8LDtGU2Y3lnOz4E8H9rdAV7/GT RHYJ+75BDmGy1mNrYq8STFL7MUnKSeehiQDTule9aryXl/jlZnJaE6lFiRYTSdEwrXzbq0 el92bgdGgzA0zkAsFKA7BzDH+f5o3oE= X-MC-Unique: FItVeM8cPgynlb2k9ijE7A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/20] qemu: process: Don't clear QEMU_CAPS_BLOCKDEV when SD card is present Date: Wed, 6 May 2020 14:08:35 +0200 Message-Id: <186291011d1a42c5abb5a328248234996d5fd677.1588766791.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@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.84 on 10.5.11.22 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" Help QEMU in deprecation of -drive if=3Dnone without the need to refactor all old boards. Stop masking out -blockdev support when -drive if=3Dsd needs to be used. We achieve this by forbidding blockjobs and special-casing all other code paths. Blockjobs are sacrificed in this case as SD cards are a corner case for some ARM boards and are thus not used commonly. https://bugzilla.redhat.com/show_bug.cgi?id=3D1821692 Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 9 --------- .../disk-arm-virtio-sd.aarch64-latest.args | 7 +++++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b1751d4b52..dee3f3fb63 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5488,7 +5488,6 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, unsigned int processStartFlags) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - size_t i; virObjectUnref(priv->qemuCaps); if (!(priv->qemuCaps =3D virQEMUCapsCacheLookupCopy(qemuCapsCache, @@ -5497,14 +5496,6 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, vm->def->os.machine)= )) return -1; - /* clear the 'blockdev' capability for VMs which have disks that need = -drive */ - for (i =3D 0; i < vm->def->ndisks; i++) { - if (qemuDiskBusIsSD(vm->def->disks[i]->bus)) { - virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - break; - } - } - if (processStartFlags & VIR_QEMU_PROCESS_START_STANDALONE) virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS); diff --git a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args = b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args index 7147dfee76..f17dd2157a 100644 --- a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args +++ b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args @@ -33,8 +33,11 @@ file=3D/tmp/lib/domain--1-armtest/master-key.aes \ -dtb /arm.dtb \ -usb \ -drive file=3D/arm-sd.qcow2,format=3Dqcow2,if=3Dsd,index=3D0 \ --drive file=3D/arm-virtio.qcow2,format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio= -disk0 \ --device virtio-blk-device,scsi=3Doff,drive=3Ddrive-virtio-disk0,id=3Dvirti= o-disk0 \ +-blockdev '{"driver":"file","filename":"/arm-virtio.qcow2",\ +"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-device,scsi=3Doff,drive=3Dlibvirt-1-format,id=3Dvirtio-= disk0 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don --=20 2.26.2