[libvirt] Storage api problem

2008-05-23 Thread sarveswara rao mygapula
Hi,

I am just trying to use libvirt storage api from python terminal, and i am
getting the following error.

 import libvirt
 con = libvirt.open(my uri using ssh)
 con.numOfDefinedStoragePools()
libvir: Remote error : Broken pipe
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.5/libvirt.py, line 1022, in
numOfDefinedStoragePools
ret = libvirtmod.virConnectNumOfDefinedStoragePools(self._o)
AttributeError: 'module' object has no attribute
'virConnectNumOfDefinedStoragePools'


I have checked in the libvirt.c file and the function
virConnectNumOfDefinedStoragePools(virConnectPtr conn) is implemented.

Thanks,
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] PATCH [2/2]: Deprecate conn, dom, net fields in struct _virError

2008-05-23 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote:
 Index: include/libvirt/libvirt.h.in
 ===
 RCS file: /data/cvs/libvirt/include/libvirt/libvirt.h.in,v
 retrieving revision 1.48
 diff -u -r1.48 libvirt.h.in
 --- include/libvirt/libvirt.h.in  15 May 2008 06:12:32 -  1.48
 +++ include/libvirt/libvirt.h.in  22 May 2008 16:56:58 -
 @@ -21,6 +21,14 @@
  extern C {
  #endif

 +#ifndef VIR_DEPRECATED
 +#ifdef __GNUC__
 +#define VIR_DEPRECATED __attribute__((deprecated))
 +#else
 +#define VIR_DEPRECATED /* nothing */
 +#endif
 +#endif /* VIR_DEPRECATED */

This feature appears to have been introduced in gcc-3.1, so define
away for earlier versions.

Also, it's better for name-space cleanliness to use the __...__ form:

#ifndef VIR_DEPRECATED
  /* The feature is present in gcc-3.1 and newer.  */
# if __GNUC__  3 || (__GNUC__ == 3  __GNUC_MINOR__ = 1)
#  define VIR_DEPRECATED __attribute__((__deprecated__))
# else
#  define VIR_DEPRECATED /* nothing */
# endif
#endif /* VIR_DEPRECATED */

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] PATCH [1/2]: Use internal.h consistently everywhere

2008-05-23 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote:
 One thing to note about this patch is that qemud/internal.h has been
 renamed to qemud/qemud.h.

Nice clean up!
ACK

 Index: HACKING
 ===
...
 \ No newline at end of file

Good to fix, but not big deal.

 Index: qemud/qemud.c
 ===
 -#include ../src/util.h
 -#include ../src/remote_internal.h
 -#include ../src/conf.h
 +#include util.h
 +#include remote_internal.h
 +#include conf.h

Good to see the ../src/ prefix being removed everywhere!

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Storage api problem

2008-05-23 Thread Atsushi SAKAI
Hi,

You should also check python directory in libvirt,
since it should be python binging problem.:-)

sarveswara rao mygapula [EMAIL PROTECTED] wrote:

 I have checked in the libvirt.c file and the function
 virConnectNumOfDefinedStoragePools(virConnectPtr conn) is implemented.

Thanks
Atushi SAKAI




--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] How to solve the runtime error: libvir: Remote error :unknown procedure: 72?

2008-05-23 Thread Atsushi SAKAI
Hi,

It seems libvirtd vs. remote_internal.c(on virsh) incompatibility.
Please check qemud/remote_protocol.x code which is used in libvirtd.
The number 72 corresponds REMOTE_PROC_LIST_STORAGE_POOLS.

Thanks
Atsushi SAKAI


Amudhan Gunasekaran [EMAIL PROTECTED] wrote:

 Hi,
 
 I am getting the above said runtime error (libvir: Remote error : unknown 
 procedure: 72) when I ran a program using the api virConnectListStoragePools. 
 I googled but I could not get any solution. Please help me solve the issue.
 
 Thanks and Regards,
 Amudhan.
 
 
 --
 Libvir-list mailing list
 Libvir-list@redhat.com
 https://www.redhat.com/mailman/listinfo/libvir-list


--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] How to solve the runtime error: libvir: Remote error : unknown procedure: 72?

2008-05-23 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 12:41:52PM -0600, Amudhan Gunasekaran wrote:
 Hi,
 
 I am getting the above said runtime error (libvir: Remote error : 
 unknown procedure: 72) when I ran a program using the api 
 virConnectListStoragePools. I googled but I could not get any
 solution. Please help me solve the issue.

Sounds like you are connecting to a version of the libvirtd daemon
which does not have the storage API support. Check that the server side
is a new enough release

Dan.
-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] PATCH: Fix python binding for listing storage pools/volumes

2008-05-23 Thread Daniel P. Berrange
The python binding for the APIs to list storage pools and volumes has a
hand written C layer, but an auto-generated python layer. The latter was
auto-generating incorrectly, so this patch overrides its API contract
making the generator work correctly.

Dan.

Index: libvirt-python-api.xml
===
RCS file: /data/cvs/libvirt/python/libvirt-python-api.xml,v
retrieving revision 1.12
diff -u -r1.12 libvirt-python-api.xml
--- libvirt-python-api.xml  14 Mar 2008 11:08:03 -  1.12
+++ libvirt-python-api.xml  23 May 2008 15:15:55 -
@@ -110,5 +110,20 @@
   arg name='domain' type='virDomainPtr' info='pointer to domain object'/
   arg name='params' type='virSchedParameterPtr' info='pointer to 
scheduler parameter objects'/
 /function
+function name='virConnectListStoragePools' file='python'
+  infolist the storage pools, stores the pointers to the names in 
@names/info
+  arg name='conn' type='virConnectPtr' info='pointer to the hypervisor 
connection'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
+function name='virConnectListDefinedStoragePools' file='python'
+  infolist the defined storage pool, stores the pointers to the names in 
@names/info
+  arg name='conn' type='virConnectPtr' info='pointer to the hypervisor 
connection'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
+function name='virStoragePoolListVolumes' file='python'
+  infolist the storage volumes, stores the pointers to the names in 
@names/info
+  arg name='pool' type='virStoragePoolPtr' info='pointer to the storage 
pool'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
   /symbols
 /api

-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] PATCH: Fix python binding for listing storage pools/volumes

2008-05-23 Thread Daniel P. Berrange
On Fri, May 23, 2008 at 04:17:26PM +0100, Daniel P. Berrange wrote:
 The python binding for the APIs to list storage pools and volumes has a
 hand written C layer, but an auto-generated python layer. The latter was
 auto-generating incorrectly, so this patch overrides its API contract
 making the generator work correctly.

The getinfo APIs need overriding too...

Index: libvirt-python-api.xml
===
RCS file: /data/cvs/libvirt/python/libvirt-python-api.xml,v
retrieving revision 1.12
diff -u -r1.12 libvirt-python-api.xml
--- libvirt-python-api.xml  14 Mar 2008 11:08:03 -  1.12
+++ libvirt-python-api.xml  23 May 2008 15:29:01 -
@@ -110,5 +110,30 @@
   arg name='domain' type='virDomainPtr' info='pointer to domain object'/
   arg name='params' type='virSchedParameterPtr' info='pointer to 
scheduler parameter objects'/
 /function
+function name='virConnectListStoragePools' file='python'
+  infolist the storage pools, stores the pointers to the names in 
@names/info
+  arg name='conn' type='virConnectPtr' info='pointer to the hypervisor 
connection'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
+function name='virConnectListDefinedStoragePools' file='python'
+  infolist the defined storage pool, stores the pointers to the names in 
@names/info
+  arg name='conn' type='virConnectPtr' info='pointer to the hypervisor 
connection'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
+function name='virStoragePoolListVolumes' file='python'
+  infolist the storage volumes, stores the pointers to the names in 
@names/info
+  arg name='pool' type='virStoragePoolPtr' info='pointer to the storage 
pool'/
+  return type='str *' info='the list of Names of None in case of error'/
+/function
+function name='virStoragePoolGetInfo' file='python'
+  infoExtract information about a storage pool. Note that if the 
connection used to get the domain is limited only a partial set of the 
information can be extracted./info
+  return type='int *' info='the list of information or None in case of 
error'/
+  arg name='pool' type='virStoragePoolPtr' info='a storage pool object'/
+/function
+function name='virStorageVolGetInfo' file='python'
+  infoExtract information about a storage pool. Note that if the 
connection used to get the domain is limited only a partial set of the 
information can be extracted./info
+  return type='int *' info='the list of information or None in case of 
error'/
+  arg name='vol' type='virStorageVolPtr' info='a storage vol object'/
+/function
   /symbols
 /api


-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Switch to using lcov for test coverage reports

2008-05-23 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:
 I got fed up trying to figure out how to fix the coverage reports to merge
 data from multiple runs correctly, so this patch rips out all our test
 coverage support. In its place is a makefile rule which just calls out to
 the lcov program.  It requires lcov = 1.6  since earlier versions were
 too dumb to deal with .libs/ directories properly.  This version has just
 been submitted to Fedora updates repos.
...
 diff -r ddd05d94cc2d Makefile.am
 --- a/Makefile.am Thu May 22 17:13:05 2008 -0400
 +++ b/Makefile.am Thu May 22 17:27:30 2008 -0400
...
 -cov: cov-recursive cov-am
 +cov: clean-cov
 + mkdir $(top_builddir)/coverage
 + $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d 
 $(top_srcdir)/src  -d $(top_srcdir)/qemud -d $(top_srcdir)/tests
 + $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o 
 $(top_builddir)/coverage/libvirt.info *usr*
 + rm $(top_builddir)/coverage/libvirt.info.tmp
 + $(GENHTML) -s -t libvirt -o $(top_builddir)/coverage --legend 
 $(top_builddir)/coverage/libvirt.info

Looks fine, modulo the too-long lines ;-)
It'd be nice to factor out the 5 uses of
`$(top_builddir)/coverage/libvirt.info'.

It's good to declare targets like cov to be PHONY,
so that make -t doesn't create a cov file.

.PHONY: cov

ACK.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Re: [Libvir] ISCSI howto, example, etc?

2008-05-23 Thread Stefan de Konink

Chris Lalancette schreef:

Stefan de Konink wrote:

I think if you can get iscsi_sysfs.c; get_block_dev_from_lun you have the
code already to do this all. So basically get openiscsi into a lib with
helper functions.


OK.  I took a look at this further, and I figured out what is going on here.


I can confirm this works for me.

Stefan

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list