[Libvir] read-only git mirror of libvirt CVS repository
by Jim Meyering
I've set up an automatically-sync'd git mirror of the libvirt.org's
libvirt CVS repository. The mirror is updated approximately every
30 minutes. You can view the change-set summary via this URL:
http://git.et.redhat.com/?p=libvirt.git
You can get a copy of the repository with the following command:
(this uses the efficient "git://" protocol, and is sort of analogous
to CVS pserver, in that you get anonymous, read-only access)
git clone git://et.redhat.com/libvirt
That command creates a libvirt/ directory.
It's not big, just 4.2MB for the .git/ repository (containing
the entire history) and the usual 10MB of code, docs and .po files.
Note, if you're new to "git", you typically run "git clone" only
once, initially, and from then on, you "cd" into the directory and
download/merge the latest sources via "git pull". But note that
if you do development or otherwise modify a version-controlled
file, your next "git pull" won't work if the pull would have
to merge changes to one of the modified files.
17 years, 1 month
[Libvir] Build error without Xen
by Jim Paris
Hi,
The recent changes to src/xml.c breaks the build without xen:
$ ./autogen.sh \
--prefix=/usr \
--mandir=\${prefix}/share/man \
--infodir=\${prefix}/share/info \
--sysconfdir=/etc \
--localstatedir=/var \
--without-xen
$ make
...
gcc -g -O2 -o .libs/virsh -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables virsh-virsh.o virsh-console.o -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables ./.libs/libvirt.so -lcurses -lreadline
./.libs/libvirt.so: undefined reference to `xenNbCpus'
collect2: ld returned 1 exit status
make[2]: *** [virsh] Error 1
make[2]: Leaving directory `/usr/local/src/libvirt/libvirt/src'
-jim
17 years, 1 month
[Libvir] problems using libvirt to mange "defined" domains.
by Evan Bigall
I'm having a problem using libvirt to manage "defined" domains (ie:
domains for which it has XML, but are not running.)
I have tried several debugging scenarios, but the simplest one is this.
In a libvirt C program I define the following XML:
char domxml[]="<domain type='xen' id='99'>"
"<name>rhel5vm</name>"
"<uuid>f948d7f4f36c4bfae8053bca535183b3</uuid>"
"<os>"
"<type>linux</type>"
"<kernel>/var/lib/xen/boot/rhel5vm/vmlinuz-2.6.18-8.el5xen</kernel>"
"<initrd>/var/lib/xen/boot/rhel5vm/initrd-2.6.18-8.el5xen.img</initrd>"
"<root>/dev/xvda1</root>"
"</os>"
"<memory>512000</memory>"
"<vcpu>1</vcpu>"
"<on_poweroff>destroy</on_poweroff>"
"<on_reboot>restart</on_reboot>"
"<on_crash>restart</on_crash>"
"<devices>"
"<interface type='bridge'>"
"<source bridge='xenbr0'/>"
"<mac address='00:16:3e:09:ef:b0'/>"
"<script path='vif-bridge'/>"
"</interface>"
"<disk type='block' device='disk'>"
"<driver name='phy'/>"
"<source dev='/dev/sda3'/>"
"<target dev='xvda'/>"
"</disk>"
"<console tty='/dev/pts/2'/>"
"</devices>"
"</domain>";
(I've played with several values for the domain id).
What I find is that when I use virDomainDefineXML() to define the domain,
for some reason it drops, the "root" element from the "os" specification.
Because of this the domain then crashes when I try to start it.
I've also tried, using virsh to create the domain from an XML file,
capture the XML with virDomainGetXMLDesc(), pause the C program, and then
try to redefine the domain with the domain with the exact XML
virDomainGetXMLDesc() gave me (after destroying the original of course),
and I get the same behavior, it strips the root element from the OS
specification.
Here is the version information:
[root@rhel5-xen tmp]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
[root@rhel5-xen tmp]# uname -a
Linux rhel5-xen 2.6.18-8.1.8.el5xen #1 SMP Mon Jun 25 17:19:38 EDT 2007
x86_64 x86_64 x86_64 GNU/Linux
[root@rhel5-xen tmp]# virsh version
Compiled against library: libvir 0.3.1
Using library: libvir 0.3.1
Using API: Xen 3.0.1
Running hypervisor: Xen 3.0.0
I am using rhel5 "out of the box" with libvirt upgraded to:
libvirt-0.3.1-1.x86_64.rpm
libvirt-devel-0.3.1-1.x86_64.rpm
libvirt-python-0.3.1-1.x86_64.rpm
I tried using libvirt-0.3.2-1, but sample code segv'd in
virConnectClose().
All I'm really trying to do is build a primitive interface to list domains
(both running, and non-running), and start and stop them. I'm open to
suggestions as to whether I have this misconfigured or if there would be a
better version with which to do this.
Thanks,
Evan
17 years, 1 month
Re: [Libvir] Creating a Domain
by Richard W.M. Jones
chetan saundankar wrote:
> "the API should not be targetted to a single virtualization environment
> though Xen is the current default...."
> Does this mean that other virtualization environments say VMWare ESX
> server management can also be done with future releases of Libvirt? If
> yes then when do you expect to roll out that feature?
That's certainly an aspiration. However there is no firm date for
VMWare support at this time.
Currently we have support for Xen, QEMU, KVM and OpenVZ.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 1 month
[Libvir] Creating a Domain
by chetan saundankar
Hi all,
I am new to Libvirt. I have few questions on how to create a guest domain
using libvirt,
1. I want to create a guest and say install FC6 in it. Can it be done using
"virDomainCreate" or "virDomainCreateLinux" calls? and specifying iso image
in Domain description XML e.g.
<disk type='file' device='cdrom'>
<source file='/root/chelsea/fc6-x86.iso'/>
<target dev='hdc'/>
<readonly/>
</disk>
2. In the Domain Description XML for Fully virtualized guests there is
<uuid> tag so if the above mentioned method is used to create guests then is
it the callers responsibility to provide a unique uuid?
Thanks
Chetan
<http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate>
17 years, 1 month
[Libvir] Bash completions for virsh
by David Lutterkort
The attached file provides tab completion for virsh. To use them, just
source the file in bash; after that, typing 'virsh <TAB>' should do
something sensible (if you are on KVM, you also need to have
VIRSH_DEFAULT_CONNECT_URI set, otherwise virsh will complain when trying
to gather various info during completion.
Could this be added to the libvirt CVS in some appropriate place ? The
RPM should probably install it in /etc/bash_completion.d/
David
17 years, 1 month
[Libvir] detect overflow in string-to-int conversion
by Jim Meyering
Hi,
Not a big deal, but it's better not to accept a bogus
"4294967297" and silently map it to "1".
Don't accept an arbitrarily-long string of digits.
* src/xml.c (parseNumber): Detect overflow.
diff --git a/src/xml.c b/src/xml.c
index 3e92040..5011dc2 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1,7 +1,7 @@
/*
* xml.c: XML based interfaces for the libvir library
*
- * Copyright (C) 2005 Red Hat, Inc.
+ * Copyright (C) 2005, 2007 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
@@ -77,7 +77,7 @@ skipSpaces(const char **str) {
*
* Parse a number
*
- * Returns the CPU number or -1 in case of error. @str will be
+ * Returns the unsigned number or -1 in case of error. @str will be
* updated to skip the number.
*/
static int
@@ -89,8 +89,11 @@ parseNumber(const char **str) {
return(-1);
while ((*cur >= '0') && (*cur <= '9')) {
- ret = ret * 10 + (*cur - '0');
- cur++;
+ unsigned int c = *cur - '0';
+ if (ret > INT_MAX / 10 || (ret == INT_MAX / 10 && c > INT_MAX % 10))
+ return(-1);
+ ret = ret * 10 + c;
+ cur++;
}
*str = cur;
return(ret);
17 years, 1 month
[Libvir] virt-install : *** glibc detected *** /usr/bin/python: free(): invalid pointer *** ***
by suyash jape
Hi all
I am getting the following output when i try to use virt-install
[root@localhost]# virt-install
*** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x08bea0a0
***
======= Backtrace: =========
/lib/i686/nosegneg/libc.so.6[0x2f89b1]
/lib/i686/nosegneg/libc.so.6(cfree+0x90)[0x2fc060]
/usr/lib/libvirt.so.0[0xb2885e]
/usr/lib/libvirt.so.0[0xb2a07b]
/usr/lib/libvirt.so.0[0xb019d3]
/usr/lib/python2.5/site-packages/libvirtmod.so(libvirt_virConnectOpen+0x66)[0xf09ce6]
.
.
.
.
b7d25000-b7f25000 r--p 00000000 fd:00 312403
/usr/lib/locale/locale-archive
b7f25000-b7fa9000 rw-p b7f25000 00:00 0
b7fb4000-b7fb5000 rw-p b7fb4000 00:00 0
bff2a000-bff4a000 rw-p bff2a000 00:00 0 [stack]
Aborted
My package versions :
[root@localhost ~]# rpm -qa|grep libvirt
libvirt-0.3.3-1.fc7
libvirt-python-0.3.3-1.fc7
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.20-2936.fc7xen #1 SMP Fri Sep 21 12:07:35
EDT 2007 i686 i686 i386 GNU/Linux
[root@localhost ~]# rpm -qa|grep xen
xen-libs-3.1.0-6.fc7
xen-devel-3.1.0-6.fc7
xen-3.1.0-6.fc7
kernel-xen-2.6.20-2936.fc7
kernel-xen-devel-2.6.20-2936.fc7
I have attached the full back trace if anyone is interested
Any suggestions ?
Thanks
Suyash
17 years, 1 month
[Libvir] virt-install virt-install virt-install : *** glibc detected *** /usr/bin/python: free(): invalid pointer *** *** glibc detected *** /usr/bin/python: free(): invalid pointer: ******
by suyash jape
Hi
I am getting the following output when i try to use virt-install
[root@localhost]# virt-install
*** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x08bea0a0
***
======= Backtrace: =========
/lib/i686/nosegneg/libc.so.6[0x2f89b1]
/lib/i686/nosegneg/libc.so.6(cfree+0x90)[0x2fc060]
/usr/lib/libvirt.so.0[0xb2885e]
/usr/lib/libvirt.so.0[0xb2a07b]
/usr/lib/libvirt.so.0[0xb019d3]
/usr/lib/python2.5/site-packages/libvirtmod.so(libvirt_virConnectOpen+0x66)[0xf09ce6]
.
.
.
.
b7d25000-b7f25000 r--p 00000000 fd:00 312403
/usr/lib/locale/locale-archive
b7f25000-b7fa9000 rw-p b7f25000 00:00 0
b7fb4000-b7fb5000 rw-p b7fb4000 00:00 0
bff2a000-bff4a000 rw-p bff2a000 00:00 0 [stack]
Aborted
My package versions :
[root@localhost ~]# rpm -qa|grep libvirt
libvirt-0.3.3-1.fc7
libvirt-python-0.3.3-1.fc7
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.20-2936.fc7xen #1 SMP Fri Sep 21 12:07:35
EDT 2007 i686 i686 i386 GNU/Linux
[root@localhost ~]# rpm -qa|grep xen
xen-libs-3.1.0-6.fc7
xen-devel-3.1.0-6.fc7
xen-3.1.0-6.fc7
kernel-xen-2.6.20-2936.fc7
kernel-xen-devel-2.6.20-2936.fc7
I have attached the full back trace if anyone is interested
Any suggestions ?
Thanks
Suyash
17 years, 1 month
[Libvir] Re: Should we settle on one SSL implementation?
by Richard W.M. Jones
Bernardo Innocenti wrote:
> I remember this topic being discussed some time ago,
> but software is fluid and maybe it's time to respin
> the topic.
>
> It would seem a worthwhile goal to unify SSL/TLS
> implementations like we did for spell checkers.
> Or, if it turns out to be too hard, at least it would
> be nice to their pki files.
I've asked whether we have a standard layout for /etc/pki before, but no
one seems to know.
> We're now shipping no less than 4 different implementations
> of SSL:
>
> - openssl (OpenBSD's implementation)
> - nss (Netscape's implementation)
> - gnutls (LGPL implementation)
> - puretls (Java implementation)
Make that at least five - ocaml-ocamlnet has a pure-OCaml SSL impl. I'm
sure Perl & Python probably have their own too.
> But which one should replace the others?
When we implemented encryption in libvirt, we chose gnutls because it
has excellent examples which allow you to actually write code to use it
in a short period of time. The others have (or we perceived them to
have) hideous, confusing or undocumented APIs.
For a short while I documented the certificate management code in terms
of the OpenSSL command line tools. But after I found out about
'certtool' (part of GnuTLS), I was able to rewrite that documentation
and make it considerably simpler[1]. 'certtool' is a lot more sane than
the OpenSSL stuff.
Nevertheless, I don't think you're going to get rid of the competing SSL
libraries. Rewriting code to use a different API is a lot of make-work
that no one wants to do, and doesn't contribute much benefit to anyone.
Rich.
[1] http://libvirt.org/remote.html#Remote_certificates
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 1 month