From nobody Mon May 6 22:55:03 2024 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=1566999785; cv=none; d=zoho.com; s=zohoarc; b=NyyEcLzYL6RVbHLymbNeT/YfVuk/SnZg7ozGXl6SmV6XD+eKV5nAeEHC9c4++2CFvXG3AUJY1/hnrxBG8DH1HL1h/NL9rWLtSW8wRSlOIJoeRIGBF5GboBTxhjc/RHa241gQhMP1/gOcK0oXnoTrrPHY66Klk7ugcswq/f8eObA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566999785; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=t2p2mpeaKjJ37jTk0k7vVOGBe8tD1wq+8SLHoz+e8lg=; b=R9hSr4QcnCNRLmikMj766dJzYp6nn2cPWCsUSKAV4TdqszBx674kyU9jk/XNquC/VbVMd84NNkdoeHLHfbte0x023KU6Eww9B/UJj87X6CN/9rvBfhECwoujzgRRtYGF68nCW3armF78wk/rl4JW/cCqWCBUIwpzrUiDCrxXvB4= 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 1566999785273706.9227536665918; Wed, 28 Aug 2019 06:43:05 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5C74610576E7; Wed, 28 Aug 2019 13:43:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12BB55D712; Wed, 28 Aug 2019 13:43:01 +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 0608F180B536; Wed, 28 Aug 2019 13:42:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7SDgwXH004178 for ; Wed, 28 Aug 2019 09:42:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FC231001B2C; Wed, 28 Aug 2019 13:42:58 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE3871001B0B for ; Wed, 28 Aug 2019 13:42:52 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 28 Aug 2019 15:42:51 +0200 Message-Id: <330f4d3915d5c557f4fb9eb54983b64a4eba3805.1566999763.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [python PATCH] Implement virDomainGetGuestInfo 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-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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Wed, 28 Aug 2019 13:43:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- generator.py | 1 + libvirt-override-api.xml | 7 +++++++ libvirt-override.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/generator.py b/generator.py index 8922f93..0b0a5a7 100755 --- a/generator.py +++ b/generator.py @@ -507,6 +507,7 @@ skip_impl =3D ( 'virNodeGetSEVInfo', 'virNetworkPortGetParameters', 'virNetworkPortSetParameters', + 'virDomainGetGuestInfo', ) =20 lxc_skip_impl =3D ( diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index 9c4d71d..b2a6259 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -789,5 +789,12 @@ + + Get aggregated info from guest agent + + + + + diff --git a/libvirt-override.c b/libvirt-override.c index 42f8198..5567f4a 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -10176,6 +10176,39 @@ libvirt_virNetworkPortGetParameters(PyObject *self= ATTRIBUTE_UNUSED, } #endif /* LIBVIR_CHECK_VERSION(5, 5, 0) */ =20 +#if LIBVIR_CHECK_VERSION(5, 7, 0) +static PyObject * +libvirt_virDomainGetGuestInfo(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args) +{ + PyObject *pyobj_dom =3D NULL; + PyObject *dict =3D NULL; + virDomainPtr dom =3D NULL; + virTypedParameterPtr params =3D NULL; + int nparams =3D 0; + unsigned int types; + unsigned int flags; + int rc; + + if (!PyArg_ParseTuple(args, (char *) "OII:virDomainGetGuestInfo", + &pyobj_dom, &types, &flags)) + return NULL; + dom =3D (virDomainPtr) PyvirDomain_Get(pyobj_dom); + + LIBVIRT_BEGIN_ALLOW_THREADS; + rc =3D virDomainGetGuestInfo(dom, types, ¶ms, &nparams, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (rc < 0) + return VIR_PY_NONE; + + dict =3D getPyVirTypedParameter(params, nparams); + + virTypedParamsFree(params, nparams); + return dict; +} +#endif /* LIBVIR_CHECK_VERSION(5, 7, 0) */ + /************************************************************************ * * * The registration stuff * @@ -10431,6 +10464,9 @@ static PyMethodDef libvirtMethods[] =3D { {(char *) "virNetworkPortSetParameters", libvirt_virNetworkPortSetPara= meters, METH_VARARGS, NULL}, {(char *) "virNetworkPortGetParameters", libvirt_virNetworkPortGetPara= meters, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(5, 5, 0) */ +#if LIBVIR_CHECK_VERSION(5, 7, 0) + {(char *) "virDomainGetGuestInfo", libvirt_virDomainGetGuestInfo, METH= _VARARGS, NULL}, +#endif /* LIBVIR_CHECK_VERSION(5, 7, 0) */ {NULL, NULL, 0, NULL} }; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list