From nobody Sun Feb 8 15:01:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574686465; cv=none; d=zohomail.com; s=zohoarc; b=cfHeZXKebDtx8C6XKO5d3T6ZnLNTA8GhRQO+MckSpOu3ORgKH/NkQk3ULFhDxmU3xU952GSYdxUxKLiNYYh0OnX26fvuSCAvaT2lSVgpBxZyRYlrJaTFKXKrbhi4xaEPh4cwnDJmfD+7UJE0VuM5kyKt1o8irkt19u4CYIuQ/Ok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574686465; 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=fkRMyb+iYlhqE9pnf+VUqLXpoCdILsMclhzOj9MFRYc=; b=BQEsp4qow6w3lQvyh8IgEUljQ/1Derk4uzwxnwPTO6D+AmuWSNx7NnNUrCfDAETXk+VuzV/AYDDG8dZS8pEOlMFNM/s8K8HJ89jkkdq0FgA98n5Pkps4QL0hXUuYsIctRfcVwW6EqZBNDwFwiDlsr49FsS+wzEoF7F6L4iCH7P0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574686465065245.3432866036461; Mon, 25 Nov 2019 04:54:25 -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-150-e8bzTmc6P0OKHjYarMy5Sg-1; Mon, 25 Nov 2019 07:54:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79CB8803034; Mon, 25 Nov 2019 12:54:16 +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 4DC0D608BB; Mon, 25 Nov 2019 12:54:16 +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 07F524E56E; Mon, 25 Nov 2019 12:54:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAPCs1cX016649 for ; Mon, 25 Nov 2019 07:54:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2AC79600CA; Mon, 25 Nov 2019 12:54:01 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6AC5600C8 for ; Mon, 25 Nov 2019 12:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574686463; 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=fkRMyb+iYlhqE9pnf+VUqLXpoCdILsMclhzOj9MFRYc=; b=GDxOpDwQ6WMdQ9poEPq8ed89/8yGFRq6iKKxshO/IOb2ebidhMNGLXEqEN2M7AzXehO7M/ JbamMW3jcW+vQ+ycDUR5nvZRfZZaW0xJIUzlR7QpzJrErK5dl5qU3NGo9MGn7ikh1QxFYt pZYmGfsABfBRSkDGO9We7ITTITYOU9c= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 13:53:49 +0100 Message-Id: <7e09e860b70e55c007de1ea49925ccb1da406d72.1574686331.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/9] qemu: process: Move clearing of the BLOCKDEV capability to qemuProcessPrepareQEMUCaps 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.13 X-MC-Unique: e8bzTmc6P0OKHjYarMy5Sg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Start aggregating all capability post-processing code in one place. The comment was modified while moving it as it was mentioning floppies which are no longer clearing the blockdev capability. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ad3129c7bd..f05c1d637f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5502,6 +5502,7 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, virFileCachePtr qemuCapsCache) { qemuDomainObjPrivatePtr priv =3D vm->privateData; + size_t i; virObjectUnref(priv->qemuCaps); if (!(priv->qemuCaps =3D virQEMUCapsCacheLookupCopy(qemuCapsCache, @@ -5510,6 +5511,14 @@ 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 (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) { + virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); + break; + } + } + return 0; } @@ -6273,14 +6282,6 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, qemuProcessPrepareAllowReboot(vm); - /* clear the 'blockdev' capability for VMs which have disks that need - * -drive or which have floppies where we can't reliably get the QOM p= ath */ - for (i =3D 0; i < vm->def->ndisks; i++) { - if (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) { - virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - break; - } - } /* * Normally PCI addresses are assigned in the virDomainCreate --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list