From nobody Tue Feb 10 04:15:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1602775554; cv=none; d=zohomail.com; s=zohoarc; b=KxNo7RPJAYYDjIrX5rxIqr184hXbJqvfLsn5bErpYRrk9e6Ng6xtPlkQj2Ip5t1+HXX/vxtKJIjLelYh9H2u8pFNTQMEAqc2OsqdOTovATBoC+CnW7kboKS1gH0fmfTbnVzFORjIFZus7HFF2P7QrQzlt6wKp5OOVTX3i5Ac3fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602775554; 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=oy8WYsuJCAWyzJHLZ2p9lzbH0fhEG9cox+UQOS7NtHI=; b=GBOSLVawgB9hDyd8qnzsyCvL41C4H6iSBvKNxXnAvppnzTjAimAVLRzYBZYxjzGm2Nt/dp71mBswNwo0SEnfHBM+yLB95k+fSQcjZ1b435q+8bOUP0t8vDC0ajMsTwlKNmL41XCT4wdmMBjbJnYDteR1R5raR6WFsH7/NcyJBR0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602775554175531.0520345874385; Thu, 15 Oct 2020 08:25:54 -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-427-GFEkHTjJPGCp-dg_wXWPSQ-1; Thu, 15 Oct 2020 11:25:50 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAB8E18C89C9; Thu, 15 Oct 2020 15:25:44 +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 789C176663; Thu, 15 Oct 2020 15:25:44 +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 3EB8358112; Thu, 15 Oct 2020 15:25:44 +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 09FFPM8r015622 for ; Thu, 15 Oct 2020 11:25:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id D330175131; Thu, 15 Oct 2020 15:25:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED97975135; Thu, 15 Oct 2020 15:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602775553; 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=oy8WYsuJCAWyzJHLZ2p9lzbH0fhEG9cox+UQOS7NtHI=; b=KAWeLXEJcVxkQzhGnmM0rfVbf1ADtoqccUH2hx1p5vMCBj+D6XRjigskkv672JrmbKaFEE okDy1C//dAz9aVNnc0GvSrMfM5PeMt5ugsm573e94kxC4Lvc5ivmw0tND5fNBQ8cga1ga6 ycAKV9N4Ayyhp+DakhgVgNDI7Y7dX28= X-MC-Unique: GFEkHTjJPGCp-dg_wXWPSQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/6] qemu: hostdev: Prepare definition bits in qemuDomainPrepareHostdev Date: Thu, 15 Oct 2020 17:25:10 +0200 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: daggs 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.11 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" qemuBuildHostdevSCSIAttachPrepare is supposed to prepare the data structure used for attaching the hostdev not preparing the hostdev definition itself. Move the corresponding bits to qemuDomainPrepareHostdev Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 2 -- src/qemu/qemu_domain.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 697a2db62b..5e7454a6e8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5134,7 +5134,6 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= Ptr hostdev, src =3D scsisrc->u.host.src; - src->type =3D VIR_STORAGE_TYPE_BLOCK; src->path =3D g_strdup_printf("/dev/%s", devstr); break; @@ -5149,7 +5148,6 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= Ptr hostdev, return NULL; } - src->readonly =3D hostdev->readonly; ret->storageNodeName =3D src->nodestorage; *backendAlias =3D src->nodestorage; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 5e603284be..ddfdac657a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10408,6 +10408,9 @@ qemuDomainPrepareHostdev(virDomainHostdevDefPtr hos= tdev, virObjectUnref(scsisrc->u.host.src); scsisrc->u.host.src =3D virStorageSourceNew(); src =3D scsisrc->u.host.src; + + src->type =3D VIR_STORAGE_TYPE_BLOCK; + break; case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI: @@ -10423,6 +10426,8 @@ qemuDomainPrepareHostdev(virDomainHostdevDefPtr hos= tdev, if (src) { const char *backendalias =3D hostdev->info->alias; + src->readonly =3D hostdev->readonly; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_= SCSI)) { src->id =3D qemuDomainStorageIdNew(priv); src->nodestorage =3D g_strdup_printf("libvirt-%d-backend",= src->id); --=20 2.26.2