[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v4 7/7] python: add bindings for virConnectGetCPUModelNames



On 09/23/2013 03:46 AM, Giuseppe Scrivano wrote:
> Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>
> ---
>  python/generator.py             |  2 +-
>  python/libvirt-override-api.xml |  7 ++++++
>  python/libvirt-override.c       | 52 +++++++++++++++++++++++++++++++++++++++++
>  python/libvirt-override.py      | 11 +++++++++
>  4 files changed, 71 insertions(+), 1 deletion(-)
> 

>  
> +PyObject *
> +libvirt_virConnectGetCPUModelNames(PyObject *self ATTRIBUTE_UNUSED,
> +                                   PyObject *args)
> +{

So close - you forgot to list this function in the exports.  With this
squashed in:

diff --git i/python/libvirt-override.c w/python/libvirt-override.c
index 5e4acc3..e659bae 100644
--- i/python/libvirt-override.c
+++ w/python/libvirt-override.c
@@ -7223,6 +7223,7 @@ static PyMethodDef libvirtMethods[] = {
 #include "libvirt-export.c"
     {(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
     {(char *) "virConnectGetVersion", libvirt_virConnectGetVersion,
METH_VARARGS, NULL},
+    {(char *) "virConnectGetCPUModelNames",
libvirt_virConnectGetCPUModelNames, METH_VARARGS, NULL},
     {(char *) "virConnectGetLibVersion",
libvirt_virConnectGetLibVersion, METH_VARARGS, NULL},
     {(char *) "virConnectOpenAuth", libvirt_virConnectOpenAuth,
METH_VARARGS, NULL},
     {(char *) "virConnectListDomainsID",
libvirt_virConnectListDomainsID, METH_VARARGS, NULL},

I was able to do a smoke test:

$ ./run python
Python 2.7.5 (default, Aug 22 2013, 09:31:58)
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open()
>>> conn.getCPUModelNames("x86_64")
['486', 'pentium', 'pentium2', 'pentium3', 'pentiumpro', 'coreduo',
'n270', 'core2duo', 'qemu32', 'kvm32', 'cpu64-rhel5', 'cpu64-rhel6',
'kvm64', 'qemu64', 'Conroe', 'Penryn', 'Nehalem', 'Westmere',
'SandyBridge', 'Haswell', 'athlon', 'phenom', 'Opteron_G1',
'Opteron_G2', 'Opteron_G3', 'Opteron_G4', 'Opteron_G5']
>>>

ACK and series pushed with my two minor fixes in 1 and 7.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]