From nobody Mon Feb 9 20:59:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1559730799; cv=none; d=zoho.com; s=zohoarc; b=ZEQGyRfxPoiELrHWw/M7WKmGVoiL8YVIK0Uhajsu47oPBRKyLVH2+Y5fA25m0QzxlibBwKLo8cMwragzCRoj1qfxMgwLS6yjt1LY117ujdrI+Ezc4IH9eTNEOFbvR4L3wn1WvFKRb4fdZl/JM6y2YKxrLz4/82gzr3Zms1yvUtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559730799; 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:ARC-Authentication-Results; bh=FyfymtNoAvbpWdHbI4QWTUgyaFGmjzWbzQ6P6xDIE6g=; b=VT6+bwb1eUgQrtovJLB1I972Qs3F4PDIfCgIrCz9MnkRxwGuVOo2qamcAKUKRaUjWkGkWbKGX/nO0HKERkdUZXrrRHvHXNqKpwnB852JucT07tUWmkchJwxN5tMW+mZSAy3hZYp72AdCDfZj10wbaVQ+UBWBACNE8OHLdWzQ0lE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559730799218119.43561876467231; Wed, 5 Jun 2019 03:33:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99F3010C94; Wed, 5 Jun 2019 10:33:17 +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 758895C22C; Wed, 5 Jun 2019 10:33:17 +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 3CEFD206D3; Wed, 5 Jun 2019 10:33:17 +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 x55AWmXA020394 for ; Wed, 5 Jun 2019 06:32:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4985A5B689; Wed, 5 Jun 2019 10:32:48 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD2575D739; Wed, 5 Jun 2019 10:32:47 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Wed, 5 Jun 2019 12:31:13 +0200 Message-Id: <20190605103117.19047-16-marcandre.lureau@redhat.com> In-Reply-To: <20190605103117.19047-1-marcandre.lureau@redhat.com> References: <20190605103117.19047-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [libvirt] [PATCH 15/19] qemu: prepare domain for vhost-user GPU 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jun 2019 10:33:18 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Call qemuExtVhostUserGPUPrepareDomain() to fill the domain with the location of the vhost-user binary to start. Signed-off-by: Marc-Andr=C3=A9 Lureau --- src/qemu/qemu_extdevice.c | 30 ++++++++++++++++++++++++++++++ src/qemu/qemu_extdevice.h | 5 +++++ src/qemu/qemu_process.c | 4 ++++ 3 files changed, 39 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index a21caefaba..977743d240 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -21,6 +21,7 @@ #include =20 #include "qemu_extdevice.h" +#include "qemu_vhost_user_gpu.h" #include "qemu_domain.h" #include "qemu_tpm.h" =20 @@ -92,6 +93,35 @@ qemuExtDevicesInitPaths(virQEMUDriverPtr driver, } =20 =20 +/* + * qemuExtDevicesPrepareDomain: + * + * @driver: QEMU driver + * @vm: domain + * + * Code that modifies live XML of a domain which is about to start. + */ +int +qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, + virDomainObjPtr vm) +{ + int ret =3D 0; + int i; + + for (i =3D 0; i < vm->def->nvideos; i++) { + virDomainVideoDefPtr video =3D vm->def->videos[i]; + + if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO && video->vhos= tuser) { + if ((ret =3D qemuExtVhostUserGPUPrepareDomain(driver, video) <= 0)) { + break; + } + } + } + + return ret; +} + + /* * qemuExtDevicesPrepareHost: * diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h index af03c045ff..aeb9e94057 100644 --- a/src/qemu/qemu_extdevice.h +++ b/src/qemu/qemu_extdevice.h @@ -30,6 +30,11 @@ int qemuExtDeviceLogCommand(qemuDomainLogContextPtr logC= txt, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; =20 +int qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, + virDomainObjPtr vm) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) + ATTRIBUTE_RETURN_CHECK; + int qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, virDomainDefPtr def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f600c4112a..c46f7d4224 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6177,6 +6177,10 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, if (qemuFirmwareFillDomain(driver, vm, flags) < 0) goto cleanup; =20 + VIR_DEBUG("Preparing external devices"); + if (qemuExtDevicesPrepareDomain(driver, vm) < 0) + goto cleanup; + for (i =3D 0; i < vm->def->nchannels; i++) { if (qemuDomainPrepareChannel(vm->def->channels[i], priv->channelTargetDir) < 0) --=20 2.22.0.rc2.384.g1a9a72ea1d -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list