[libvirt] storage_conf.c: In function 'virStorageSize'

2008-07-04 Thread Jaime Traver
Hi, I am having problem with compilation of libvirt, i has saw one post
about this in the maillist, but it don't resolved the problem. The detail of
erros is:

storage_conf.c: In function 'virStorageSize':
storage_conf.c:627: error: 'ULLONG_MAX' undeclared (first use in this
function)
storage_conf.c:627: error: (Each undeclared identifier is reported only once
storage_conf.c:627: error: for each function it appears in.)
make[2]: *** [libvirt_la-storage_conf.lo] Error 1
make[2]: se sale del directorio `/home/revartj/libvirt/libvirt-0.4.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/home/revartj/libvirt/libvirt-0.4.4'
make: *** [all] Error 2


Any information about SO:

EREBO:/home/revartj/libvirt/libvirt-0.4.4# *uname -a*
Linux EREBO 2.6.18-6-xen-686 #1 SMP Sat May 24 14:16:03 UTC 2008 i686
GNU/Linux

EREBO:/home/revartj/libvirt/libvirt-0.4.4# *gcc -v*
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Someboy know how i can resolved this error.

Thank everybody by advance.

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


Re: [libvirt] storage_conf.c: In function 'virStorageSize'

2008-07-04 Thread Atsushi SAKAI
Hi,

ULLONG_MAX should be defined on limits.h.
and its limits.h is includes on src/internal.h.
Please check these files.

By the way, you are using i486?.


Thanks
Atsushi SAKAI


Jaime Traver [EMAIL PROTECTED] wrote:

 Hi, I am having problem with compilation of libvirt, i has saw one post
 about this in the maillist, but it don't resolved the problem. The detail of
 erros is:
 
 storage_conf.c: In function 'virStorageSize':
 storage_conf.c:627: error: 'ULLONG_MAX' undeclared (first use in this
 function)
 storage_conf.c:627: error: (Each undeclared identifier is reported only once
 storage_conf.c:627: error: for each function it appears in.)
 make[2]: *** [libvirt_la-storage_conf.lo] Error 1
 make[2]: se sale del directorio `/home/revartj/libvirt/libvirt-0.4.4/src'
 make[1]: *** [all-recursive] Error 1
 make[1]: se sale del directorio `/home/revartj/libvirt/libvirt-0.4.4'
 make: *** [all] Error 2
 
 
 Any information about SO:
 
 EREBO:/home/revartj/libvirt/libvirt-0.4.4# *uname -a*
 Linux EREBO 2.6.18-6-xen-686 #1 SMP Sat May 24 14:16:03 UTC 2008 i686
 GNU/Linux
 
 EREBO:/home/revartj/libvirt/libvirt-0.4.4# *gcc -v*
 Using built-in specs.
 Target: i486-linux-gnu
 Configured with: ../src/configure -v
 --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
 --enable-shared --with-system-zlib --libexecdir=/usr/lib
 --without-included-gettext --enable-threads=posix --enable-nls
 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
 --enable-libstdcxx-debug --enable-mpfr --with-tune=i686
 --enable-checking=release i486-linux-gnu
 Thread model: posix
 gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
 
 Someboy know how i can resolved this error.
 
 Thank everybody by advance.
 
 revartj


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


[libvirt] Re: Libvir-list Digest, Vol 32, Issue 7

2008-07-04 Thread Tóth István

I took at a look at that code.

The JNI code is basically unchanged from the 0.1 version.

The interesting part is the code is for handling the XML structures used 
by libvirt.


You can see how Daniel Schweger's added functionality is meant to be 
used in the srtc/testclient/org/libvirt/TestXen.java file.



The way I imagined the java-libvirt architecture is that there is a 
lower 'core' level, which is basically a function-for function 
equivalent of the C libvirt functionality, with the bare minimum of 
object-orientedness thrown in to pass for a proper java library (the 
current libvirt in CVS)


Plus, there should/can be anotherl API, that exposes the XML files as 
java objects with get/set functions, etc. (It's in the  
org.libvirt.schema package in Daniel Schweger's code)


Optionally, there could be higher level API that uses the core and XML 
api, and provides a really clean java-style object model, but IO haven't 
given it much thought yet.


I think these two or three layers should be clearly demarcated, maybe 
even shipped as separate packages, becuse anything that layers on more 
functionaity that what the current cvs provides represents  design 
decisions that are not inherent to libvirt.
One may not want to use the XML technology/object model/whatever that 
libvirt-java ships, but rather add their own XML handling stuff/ higher 
level abstractions on top of the core libvirt bindings.  (for example, 
Daniel Schweger's code uses XMLBeans, my original idea was to use JAXB 
for the same purpose).


BTW I am working on adding the core bindings for the storage stuff, but 
don't expect anything soon, as my day job is currently eating all my time.


regards
István

[EMAIL PROTECTED] wrote:

Send Libvir-list mailing list submissions to
libvir-list@redhat.com

To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/libvir-list
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of Libvir-list digest...


Today's Topics:

   1. Re: AW: beta libvirt-java port uploaded (Daniel Veillard)
   2. AW: [libvirt] AW: beta libvirt-java port uploaded
  (Daniel Schwager)
   3. storage_conf.c: In function 'virStorageSize' (Jaime Traver)
   4. Re: storage_conf.c: In function 'virStorageSize' (Atsushi SAKAI)


--

Message: 1
Date: Thu, 3 Jul 2008 12:29:04 -0400
From: Daniel Veillard [EMAIL PROTECTED]
Subject: Re: [libvirt] AW: beta libvirt-java port uploaded
To: Daniel Schwager [EMAIL PROTECTED]
Cc: libvir-list@redhat.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii

On Thu, Jul 03, 2008 at 12:10:40PM +0200, Daniel Schwager wrote:
  

Cool - there's an official port...
http://comments.gmane.org/gmane.comp.emulators.libvirt/7118

sorry for my last port, i didn't watch this list in the last time ..



  BTW there is a new one 0.1.2 with better portability and JPackage
compatibility.
  I must admit i'm a bit lost by all the code in your tarball, 
there are changes to libvirt-java, even in code already included in
0.1.0 , and a lot of subtrees which seems only loosely coupled to 
libvirt.
  What are the diffs which should be applied to the cirrent 0.1.2 
code base ? and what specifically should be added in libvirt-java

CVS. The Beans support seems one of them (but i have no idea how
it's supposed to be used).
  A bit of explanations would go a long way ;-)

Daniel

  


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


Re: [libvirt] PATCH: 2/2: port Test driver to new domain APIs

2008-07-04 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:
 This patch ports the Test driver over to the domain XML apis.
...
  docs/testdomfc4.xml |2
  src/test.c  | 1020 
 ++--
  tests/read-non-seekable |3
  tests/testutils.c   |3
  tests/virshtest.c   |4
  5 files changed, 391 insertions(+), 641 deletions(-)
...

Hi Dan,

Nice work.  This will make testing a lot easier.

I've made a few suggestions, spotted some new bugs
and a couple in moved code.

 +static virCapsPtr
 +testBuildCapabilities(virConnectPtr conn) {
 +virCapsPtr caps;
 +virCapsGuestPtr guest;
 +const char *guest_types[] = { hvm, xen };

you can sneak one more const in there:

   const char *const guest_types[] = { hvm, xen };

 +int i;
 +GET_CONNECTION(conn);
 +
 +if ((caps = virCapabilitiesNew(TEST_MODEL, 0, 0)) == NULL)
 +goto no_memory;
 +
 +if (virCapabilitiesAddHostFeature(caps, pae)  0)
 +goto no_memory;
 +if (virCapabilitiesAddHostFeature(caps ,nonpae)  0)
 +goto no_memory;
 +
 +for (i = 0; i  privconn-numCells; ++i) {
 +if (virCapabilitiesAddHostNUMACell(caps, i, 
 privconn-cells[i].numCpus,
 +   privconn-cells[i].cpus)  0)
 +goto no_memory;
 +}
 +
 +for (i = 0; i  (sizeof(guest_types)/sizeof(guest_types[0])); ++i) {

With ARRAY_CARDINALITY it's more readable:

   for (i = 0; i  ARRAY_CARDINALITY(guest_types); ++i) {

 +if ((guest = virCapabilitiesAddGuest(caps,
 + guest_types[i],
 + TEST_MODEL,
 + TEST_MODEL_WORDSIZE,
 + TEST_EMULATOR,
 + NULL,
 + 0,
 + NULL)) == NULL)
 +goto no_memory;
...
 @@ -538,11 +372,17 @@
  xmlNodePtr *domains, *networks = NULL;
  xmlXPathContextPtr ctxt = NULL;
  virNodeInfoPtr nodeInfo;
 +virDomainObjPtr dom;
 +virNetworkObjPtr net;
  testConnPtr privconn;
  if (VIR_ALLOC(privconn)  0) {
  testError(NULL, NULL, NULL, VIR_ERR_NO_MEMORY, testConn);
  return VIR_DRV_OPEN_ERROR;
  }
 +conn-privateData = privconn;
 +
 +if (!(privconn-caps = testBuildCapabilities(conn)))
 +goto error;

  if ((fd = open(file, O_RDONLY))  0) {
  testError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _(loading host 
 definition file));
 @@ -570,10 +410,7 @@
  goto error;
  }

 -
 -conn-privateData = privconn;
  privconn-nextDomID = 1;
 -privconn-numDomains = 0;
  privconn-numCells = 0;
  strncpy(privconn-path, file, PATH_MAX-1);
  privconn-path[PATH_MAX-1] = '\0';
 @@ -645,39 +482,35 @@
  goto error;
  }

 +
  ret = virXPathNodeSet(/node/domain, ctxt, domains);
 -if (ret  0) {
 -testError(NULL, NULL, NULL, VIR_ERR_XML_ERROR, _(node domain 
 list));
 -goto error;
 +if (ret  0) {
 +for (i = 0 ; i  ret ; i++) {
 +xmlChar *netFile = xmlGetProp(domains[i], BAD_CAST file);

This needs to handle xmlGetProp failure.
[the bug was present before this change: just indented]

 +char *absFile = testBuildFilename(file, (const char *)netFile);
 +VIR_FREE(netFile);
 +if (!absFile) {
 +testError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, 
 _(resolving domain filename));
 +goto error;
...
 -for (i = 0 ; i  ret ; i++) {
 -xmlChar *domFile = xmlGetProp(domains[i], BAD_CAST file);
 -char *absFile = testBuildFilename(file, (const char *)domFile);
 -int domid = privconn-nextDomID++, handle;
 -VIR_FREE(domFile);
 -if (!absFile) {
 -testError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _(resolving 
 domain filename));
 -goto error;
...
  static virDomainPtr
 -testDomainCreateLinux(virConnectPtr conn, const char *xmlDesc,
 +testDomainCreateLinux(virConnectPtr conn, const char *xml,
unsigned int flags ATTRIBUTE_UNUSED)
  {
...

 -dom = virGetDomain(conn, privconn-domains[handle].name, 
 privconn-domains[handle].uuid);
 -if (dom == NULL) return NULL;
 -privconn-numDomains++;
 -return (dom);
 +ret = virGetDomain(conn, def-name, def-uuid);

Handle virGetDomain failure.

 +ret-id = def-id;
 +return ret;
  }

  static virDomainPtr testLookupDomainByID(virConnectPtr conn,
   int id)
  {
...
 +ret = virGetDomain(conn, dom-def-name, dom-def-uuid);

Likewise.  Handle virGetDomain failure.

 +ret-id = dom-def-id;
 +return ret;
  }

  static virDomainPtr testLookupDomainByUUID(virConnectPtr conn,