From nobody Sun Feb 8 19:35:41 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=1682332921; cv=none; d=zohomail.com; s=zohoarc; b=PgXMhW+h/XFr7x3s1O6cNzKExL4uwe9xzegQ1iny8NJxsFCNDv5aezQ6EHE88oMAzIzG1RuleBOMAuQplu/gAjH1mANJkO7OHRld2KeTM/Dyo5v1jPbDsSJJmcQS9vbPNOrBOeCKKlAWLEHV77GzvOADgAx8+7nCVhLK5GGrCws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682332921; 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=2MbA2uXp+ZFRmMd034AmDrthuFbCgnzCE4YKkisNWlo=; b=QhcQAXIowk/emuHe7NuGmaVd7990Vv2lvuNCpdCm7DNtjS+HJJQS+ISHZMCB0CpKyReWKoKhmEghUuUkA8G4xulykitmHIS0zBFC4ry0mzY8Wuja9ceNfzoITXzeTU6ReaVGZHkaYqwEEfgfUGoLqc+LhwmC0UhkXVPNKoNswts= 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 1682332921531934.8555744536752; Mon, 24 Apr 2023 03:42:01 -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-456-_M0wttTqM36MaD2ae9V67g-1; Mon, 24 Apr 2023 06:41:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22D3E10146E2; Mon, 24 Apr 2023 10:41:53 +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 A1BF540C201F; Mon, 24 Apr 2023 10:41:51 +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 7D1EA194658D; Mon, 24 Apr 2023 10:41:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7D4651946A4A for ; Mon, 24 Apr 2023 10:41:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6317D1121319; Mon, 24 Apr 2023 10:41:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A9AC1121318 for ; Mon, 24 Apr 2023 10:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682332920; 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=2MbA2uXp+ZFRmMd034AmDrthuFbCgnzCE4YKkisNWlo=; b=DgcqSzEtsAUr8/FQg/pgwtxG/GURKcoLanQ0OvH8NL69vFRfvIUNLx6Pepeqrd2oYxWTrY 5169n6mv2jLptqVhufsWFWwCC0l0l/z91s2zi94uinKkyt3A6guslA27rnoEXIGkMXocy8 AlMTUlt01L/hcAmmoVkyl/rdDvOhPbc= X-MC-Unique: _M0wttTqM36MaD2ae9V67g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 1/9] qemuDomainAttachHostDevice: Prepare device early and for all types Date: Mon, 24 Apr 2023 12:41:40 +0200 Message-Id: <0836fac6c1062a07ec591113ae7749ea51e90afe.1682332714.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 3.1 on 10.11.54.1 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: 1682332923581100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When attaching a hostdev of a SCSI subsys, qemuDomainPrepareHostdev() is called. This makes sense because the function prepares just SCSI hostdevs ignoring others. But this will soon change. Thefore, move the function call out of qemuDomainAttachHostSCSIDevice() and into qemuDomainAttachHostDevice(). Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 53a0874556..64c62ea114 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2485,9 +2485,6 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriver *driver, =20 qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1); =20 - if (qemuDomainPrepareHostdev(hostdev, priv) < 0) - goto cleanup; - if (qemuProcessPrepareHostHostdev(hostdev) < 0) goto cleanup; =20 @@ -2769,6 +2766,9 @@ qemuDomainAttachHostDevice(virQEMUDriver *driver, return -1; } =20 + if (qemuDomainPrepareHostdev(hostdev, vm->privateData) < 0) + return -1; + switch (hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: if (qemuDomainAttachHostPCIDevice(driver, vm, --=20 2.39.2