[Libvir] IP address and MAC info in XMLDesc
by Diwaker Gupta
Are there plans to include IP address and MAC info in XMLDesc?
I'm interested because I would like to move to libvirt for VM
management, but currently my scripts use a lot of options in 'xm
create' that are not yet supported by libvirt.
Diwaker
--
Web/Blog/Gallery: http://floatingsun.net/blog
18 years, 9 months
[Libvir] Report UUID in XMLDesc
by Diwaker Gupta
Since we have a lookupByUUID() method, I thought it would be nice to
report UUID in XMLDesc as well. It could be ignored while creating a
VM, just like the 'id' attribute is currently ignored.
What do people think about this?
Diwaker
--
Web/Blog/Gallery: http://floatingsun.net/blog
18 years, 9 months
[Libvir] xmldump doesn't work
by Diwaker Gupta
Hi,
I'm running libvirt from CVS. I'm unable to get xmldump to work:
o virsh dumpxml <domain-id> doesn't work. Neither does <domain-name>
instead of domain-id. (Aside: the documentation at
http://libvirt.org/format.html needs fixing -- virsh reports a dumpxml
command, but no xmldump command)
o I can't get an XML dump from the Python bindings either.
Looking at the code, it seems the XML description is built using the
sexpr output from xend. On my machine, "xm list -l <domain-id>" prints
out the correct sexpr, so it seems Xend is working fine.
Am I missing something?
Thanks,
Diwaker
--
Web/Blog/Gallery: http://floatingsun.net/blog
18 years, 9 months
[Libvir] devhelp missing
by Diwaker Gupta
After the latest pull tonight, I'm getting errors regarding a missing
docs/devhelp/Makefile.
Just FYI
Diwaker
PS: since the website has moved to libvirt.org, and the library is
being called libvirt, perhaps its a better idea to rename the mailing
list as well to libvirt-list?
--
Web/Blog/Gallery: http://floatingsun.net/blog
18 years, 9 months
[Libvir] libver-python fix & test script
by Angus Thomas
Against the current CVS version, the python method libvir.open() is
failing because it requires "name" as a parameter, but in src/libvir.c,
virConnectOpen returns NULL if name is set. Very simple patch attached.
Also attached is a simple script to test reporting of domain state via
the python bindings. Hopefully useful as a test of the python
bindings/simple example of how to use them. It generates output like this:
[root@chaka ~]# ./libver-python-test
Attached to a hypervisor of type - Xen
There are currently 2 domains running
Domain ID 0 is named Domain-0
State is Running
maxMem is -4
memory is 262224
nrVirtCpu is 1
cpuTime is 2294771524162
Domain ID 2 is named guest1
State is Blocked
maxMem is 131072
memory is 131052
nrVirtCpu is 1
cpuTime is 34682760385
--- libvir-pristine/src/libvir.c 2006-01-27 08:59:42.000000000 +0000
+++ libvir-0.0.2/src/libvir.c 2006-02-07 12:59:17.000000000 +0000
@@ -89,8 +89,8 @@
struct xs_handle *xshandle = NULL;
/* we can only talk to the local Xen supervisor ATM */
- if (name != NULL)
- return(NULL);
+/* if (name != NULL)
+ return(NULL); */
handle = xenHypervisorOpen();
if (handle == -1)
#!/usr/bin/env python
#
# Simple script to test libver-python reporting
#
# Copyright 2005-2006 Red Hat, Inc.
# Angus Thomas <athomas(a)redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
domain_states="No State", "Running", "Blocked", "Paused", "Shutdown", "Shutoff", "Crashed"
import libvir
virt=libvir.open("Xen");
print ("Attached to a hypervisor of type - %s" % (virt.getType()));
print ("There are currently %s domains running" % (virt.numOfDomains()));
id_list=virt.listDomainsID();
for dom_id in id_list:
dom=virt.lookupByID(dom_id);
print ("\nDomain ID %s is named %s" % (dom_id, dom.name()));
dom_info=dom.info();
# print ("\tState is %s" % (dom_info[0]));
print ("\tState is %s" % (domain_states[dom_info[0]]));
print ("\tmaxMem is %s" % (dom_info[1]));
print ("\tmemory is %s" % (dom_info[2]));
print ("\tnrVirtCpu is %s" % (dom_info[3]));
print ("\tcpuTime is %s" % (dom_info[4]));
18 years, 9 months
[Libvir] Release of libvirt-0.0.4
by Daniel Veillard
Change of name, it's now libvirt due to negative feedback on the shorter
name, but I don't intend to change the mailing-list name at this point.
There was an intermediary libvirt-0.0.3 release but it was too broken I
needed to rerelease.
Except the change of names, it mostly consists of a couple of bug fixes
and completion of the python bindings.
Available at ftp://libvirt.org/libvirt/
The CVS checkouts should still be working, the update is just a bit
intrusive, and I fixed the hourly snapshot from CVS generation which broke
in december. Sorry for the mess !
Daniel
--
Daniel Veillard | Red Hat http://redhat.com/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
18 years, 9 months
Re: [Libvir] Errors while running make
by dasari dakshina
Hello,
I have tried writing a simple program.
I have compiled it with
cc xmlist.c -L /usr/src/redhat/BUILD/libvir-0.0.1/src/.libs -lvir -o xmlist
But am getting an error on trying after the virConnectOpen call .
Any help would be appreciated .
Rgds,
Dakshina
Here is the code :xmlist.c
#include <stdio.h>
#include <libvir.h>
main(){
virConnectPtr conn;
int *domids ;
int maxids = 20;
int numDoms=-1;
conn=virConnectOpen("");
if(conn == NULL){
printf("Error : Could not open a connection \n");
return(-1);
}
numDoms=virConnectListDomains(conn,domids,maxids);
printf("The number of domains %d\n",numDoms);
printf("The number of domains %d\n", virConnectNumOfDomains(conn));
}
cc xmlist.c -L /usr/src/redhat/BUILD/libvir-0.0.1/src/.libs -lvir -o xmlist
Daniel Veillard <veillard(a)redhat.com> wrote: On Tue, Jan 24, 2006 at 08:46:07PM -0800, dasari dakshina wrote:
> Hello Daniel,
> Thanks so much for the info .I downloaded the Xen
> 3 source and was able to compile without any issues.
> Is there any link where I can look at simple examples
> of the API usage ?
not yet, check http://libvir.org/html/libvir-libvir.html
Please keep discussion on the list,
thanks,
Daniel
--
Daniel Veillard | Red Hat http://redhat.com/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
18 years, 9 months