From nobody Sun Feb 8 05:30:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1574686562; cv=none; d=zohomail.com; s=zohoarc; b=RUT2pEoWAv4UqmGy9D+unPn7JHc285NZogBJGTZG/HBn9ahFEQNEIVMUjU0xxtGHoyeqX/xwz/TR4OqedJfYNwZ936TDK6ubK5BVHLzH5f1y1nindjndrdT0/eRT7Be5LVuRD347fxaBQEQOGtGfVZ3Gp0eGWeanbWvu1MUtcLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574686562; 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=40zgMitYBN3B55j4AM+ZzENpKGIswdmetG5SiYmkJ3w=; b=g1ljkZPOe7viN9OEhkmnKSbpl8NCztmAvtrWPMPDv+UIZNBcMYIxUhaXx85K7IthurKiZCOJCTqbvzuMZAsaurOnO80t5Yy1p2hIGrtdbL3ejGP43W2EGF2DdCTA7CiMppfxxlLQt/GBwMwc2Az9XUOd1gtXGYOcDh08f23haoY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574686562846824.615310754244; Mon, 25 Nov 2019 04:56:02 -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-198-KqHNOVZ9M6yV4ToPP7ht9g-1; Mon, 25 Nov 2019 07:56:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E16A10CE7B8; Mon, 25 Nov 2019 12:55:55 +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 27F6E5D6BE; Mon, 25 Nov 2019 12:55:55 +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 DEA814BB65; Mon, 25 Nov 2019 12:55:54 +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 xAPCs0Dd016641 for ; Mon, 25 Nov 2019 07:54:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5977A600CA; Mon, 25 Nov 2019 12:54:00 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4F57600C8 for ; Mon, 25 Nov 2019 12:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574686561; 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=40zgMitYBN3B55j4AM+ZzENpKGIswdmetG5SiYmkJ3w=; b=bKyIEjfWc4nrOPuI8EaNljI2xa3PpRD+wlPcIy0ff4wE4M/T6pltR9qWRIGEq3DRA4ywIA fbpbxGuS7OcT6DIf4L4Ep43T67ymNODn7YM7mLMWJPVi5JTntvLY0qX+xUB9RLM03aKDmP tDA8A9aFdAYNmfc5XcuTj+eAvvLSBjk= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Nov 2019 13:53:48 +0100 Message-Id: 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 3/9] qemu: Move and rename qemuDomainUpdateQEMUCaps 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.15 X-MC-Unique: KqHNOVZ9M6yV4ToPP7ht9g-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" The function is now used only in qemu_process.c so move it there and name it 'qemuProcessPrepareQEMUCaps' which is more appropriate to what it's doing. The reworded comment now mentions that it will also post-process the caps for VM startup. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 26 -------------------------- src/qemu/qemu_domain.h | 4 ---- src/qemu/qemu_process.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 168e7464a9..abe1396e3a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -15022,32 +15022,6 @@ qemuDomainFixupCPUs(virDomainObjPtr vm, } -/** - * qemuDomainUpdateQEMUCaps: - * @vm: domain object - * @qemuCapsCache: cache of QEMU capabilities - * - * This function updates the used QEMU capabilities of @vm by querying - * the QEMU capabilities cache. - * - * Returns 0 on success, -1 on error. - */ -int -qemuDomainUpdateQEMUCaps(virDomainObjPtr vm, - virFileCachePtr qemuCapsCache) -{ - qemuDomainObjPrivatePtr priv =3D vm->privateData; - - virObjectUnref(priv->qemuCaps); - if (!(priv->qemuCaps =3D virQEMUCapsCacheLookupCopy(qemuCapsCache, - vm->def->virtType, - vm->def->emulator, - vm->def->os.machine)= )) - return -1; - return 0; -} - - char * qemuDomainGetMachineName(virDomainObjPtr vm) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index db45a932dc..f626d3a54c 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1155,10 +1155,6 @@ int qemuDomainFixupCPUs(virDomainObjPtr vm, virCPUDefPtr *origCPU); -int -qemuDomainUpdateQEMUCaps(virDomainObjPtr vm, - virFileCachePtr qemuCapsCache); - char * qemuDomainGetMachineName(virDomainObjPtr vm); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a76a8da841..ad3129c7bd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5486,6 +5486,34 @@ qemuProcessStartUpdateCustomCaps(virDomainObjPtr vm) } +/** + * qemuProcessPrepareQEMUCaps: + * @vm: domain object + * @qemuCapsCache: cache of QEMU capabilities + * + * Prepare the capabilities of a QEMU process for startup. This includes + * copying the caps to a static cache and potential post-processing depend= ing + * on the configuration of the VM and startup process. + * + * Returns 0 on success, -1 on error. + */ +static int +qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, + virFileCachePtr qemuCapsCache) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + + virObjectUnref(priv->qemuCaps); + if (!(priv->qemuCaps =3D virQEMUCapsCacheLookupCopy(qemuCapsCache, + vm->def->virtType, + vm->def->emulator, + vm->def->os.machine)= )) + return -1; + + return 0; +} + + /** * qemuProcessInit: * @@ -5537,7 +5565,7 @@ qemuProcessInit(virQEMUDriverPtr driver, } VIR_DEBUG("Determining emulator version"); - if (qemuDomainUpdateQEMUCaps(vm, driver->qemuCapsCache) < 0) + if (qemuProcessPrepareQEMUCaps(vm, driver->qemuCapsCache) < 0) goto cleanup; if (flags & VIR_QEMU_PROCESS_START_STANDALONE) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list