From nobody Mon Feb 9 16:51:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611364518; cv=none; d=zohomail.com; s=zohoarc; b=Jm0jaPZjl5A1MeFr8QrkVmvUq5SVQh3lvYW7YsKn/FXhnu7u1LqDsxBgAIcUqE+QJTSgZwyMP9+QqTzoC6VfipBnpcW0twkuAl57low01nle84lwJ47M6imJ1GL2MkvJ3VUzKcDu7TMcFV1ZRYEag5DfDUM+rdekT3f3kFyVA/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611364518; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=0QQG9+nfypEIo56I08Ch/qcTbgTSsdVAjNU6UBGu0yU=; b=G8dKsrpZq9M+dsskgwZms79jEIwErPcrj7xi0FnuO2mE7dRjLhds3cle+nuUxt9dUQhlYi5wur86lwKiegnz2HGWY2WY1EqaLMzB+yRn43pA/NgdDoO68n5tl9eXYiKoW1f5j2NmA6ZN29Y84KIElod8rzNY8Pja4BQmJtJN5TY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611364518641403.986356483244; Fri, 22 Jan 2021 17:15:18 -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-360-Zp1k6WV6PZmBOF96AOSvEA-1; Fri, 22 Jan 2021 20:15:14 -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 94BB4806664; Sat, 23 Jan 2021 01:15:08 +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 CAC216F139; Sat, 23 Jan 2021 01:15:05 +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 417EF4E58E; Sat, 23 Jan 2021 01:15:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10N1BUo1001127 for ; Fri, 22 Jan 2021 20:11:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id CA259F11D7; Sat, 23 Jan 2021 01:11:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3C92F1005 for ; Sat, 23 Jan 2021 01:11:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D10DF101A53F for ; Sat, 23 Jan 2021 01:11:27 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-583-EQa5uwB5PUijXmlOCBqLJg-1; Fri, 22 Jan 2021 20:11:25 -0500 Received: by mail-qt1-f175.google.com with SMTP id z22so5589299qto.7 for ; Fri, 22 Jan 2021 17:11:25 -0800 (PST) Received: from localhost (209-6-122-159.s2973.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [209.6.122.159]) by smtp.gmail.com with ESMTPSA id z9sm6988683qts.66.2021.01.22.17.11.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 17:11:24 -0800 (PST) X-MC-Unique: Zp1k6WV6PZmBOF96AOSvEA-1 X-MC-Unique: EQa5uwB5PUijXmlOCBqLJg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0QQG9+nfypEIo56I08Ch/qcTbgTSsdVAjNU6UBGu0yU=; b=XcqN5hK5eOe4tF2sHV67oICH74cYStT+/aIUzz7eMDu2rSTpkzF48HfCJ4rJzlYqfD +Zy9u+qpchrTbcSlOyPY0XIuahB6hnquPL8zTpwAWI3nhUwfwilMTsyi237csYT7haqd 6ngTdH2vGVLZgXgMrBpb5Dpe6hZBdD0gfzYnED/qZRtpZ0yTfSeJICBsBVNy0Md3D/Ql yeBACBttVnWK507dT523vv2jos4R+FH0PqjPmWGbHUHJC1B+Q/CBOe+JTEc+3KKf2qx6 cE0VERnk7XfFtRBqa9E8x/ob/xxrrz9JqSge3GBvbK3jO/NHvoBU2oDfGMHV9Cl0QPB8 w9RA== X-Gm-Message-State: AOAM533J5fS1fzsEq6TkA4EfTZjtZvtqKSS+u3O0bnQZB8PazMjgAkj0 5IDUWSZTTT5R8ZhunA8UbzHnR8bDJw== X-Google-Smtp-Source: ABdhPJzK0gvYG3gTyPDEoZD+NEYfY7pWl69ZEG1QvqrnmjqE44g6bz7W1x/HgWdG2ORLVbTy0Q9RCw== X-Received: by 2002:aed:231d:: with SMTP id h29mr6862488qtc.238.1611364285074; Fri, 22 Jan 2021 17:11:25 -0800 (PST) From: Masayoshi Mizuma To: libvir-list@redhat.com Subject: [RFC PATCH 1/7] qemu_hotplug: Add asynJob argument to qemuDomainAttachDiskGeneric Date: Fri, 22 Jan 2021 20:11:00 -0500 Message-Id: <20210123011106.11126-2-msys.mizuma@gmail.com> In-Reply-To: <20210123011106.11126-1-msys.mizuma@gmail.com> References: <20210123011106.11126-1-msys.mizuma@gmail.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Masayoshi Mizuma , Masayoshi Mizuma 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Masayoshi Mizuma Add asynJob argument to qemuDomainAttachDiskGeneric() so that it can be used before CPUs start. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_hotplug.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 882e5d2384..609e9d1a8a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -693,7 +693,8 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, static int qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, virDomainObjPtr vm, - virDomainDiskDefPtr disk) + virDomainDiskDefPtr disk, + qemuDomainAsyncJob asyncJob) { g_autoptr(qemuBlockStorageSourceChainData) data =3D NULL; int ret =3D -1; @@ -740,7 +741,8 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, if (qemuHotplugAttachManagedPR(driver, vm, disk->src, QEMU_ASYNC_JOB_N= ONE) < 0) goto cleanup; =20 - qemuDomainObjEnterMonitor(driver, vm); + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + goto cleanup; =20 if (qemuBlockStorageSourceChainAttach(priv->mon, data) < 0) goto exit_monitor; @@ -820,7 +822,7 @@ qemuDomainAttachVirtioDiskDevice(virQEMUDriverPtr drive= r, if (qemuDomainEnsureVirtioAddress(&releaseaddr, vm, &dev, disk->dst) <= 0) return -1; =20 - if ((rv =3D qemuDomainAttachDiskGeneric(driver, vm, disk)) < 0) { + if ((rv =3D qemuDomainAttachDiskGeneric(driver, vm, disk, QEMU_ASYNC_J= OB_NONE)) < 0) { if (rv =3D=3D -1 && releaseaddr) qemuDomainReleaseDeviceAddress(vm, &disk->info); =20 @@ -999,7 +1001,7 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver, return -1; } =20 - if (qemuDomainAttachDiskGeneric(driver, vm, disk) < 0) + if (qemuDomainAttachDiskGeneric(driver, vm, disk, QEMU_ASYNC_JOB_NONE)= < 0) return -1; =20 return 0; @@ -1016,7 +1018,7 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr= driver, if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0) return -1; =20 - if (qemuDomainAttachDiskGeneric(driver, vm, disk) < 0) { + if (qemuDomainAttachDiskGeneric(driver, vm, disk, QEMU_ASYNC_JOB_NONE)= < 0) { virDomainUSBAddressRelease(priv->usbaddrs, &disk->info); return -1; } --=20 2.27.0