[Libvir] Java bindings
by Tóth István
Hello!
A development version of the java bindings I've been working on are
available at :
http://tiger.3ginformatika.hu/java-libvirt.tgz
I'd appreciate your feedback on it.
Building:
Have java/gcc set up correctly through alternatives ( I use jpackage sun
java 1.5.0 on Fedora 7 x86_64)
Fix the include path in jni/Makefile
run build.sh
You should have the .so and .jar files built, and see the output from
the basic test program.
Using: See the test in build.sh
Note:
It's meant to be a thin translation layer on top of libvirt.
The object model is similar to the python one.
All error handling is done exclusively through exceptions.
No documentation yet, but It's pretty self-explanatory.
The build system is very primitive, I just hacked together something to
build it outside my eclipse devel environment.
The bindings are pretty complete, but minimally tested.
License is LGPL.
Best regards
István
17 years, 2 months
[Libvir] [PATCH] add no_tty flag for ssh
by Richard W.M. Jones
This patch adds an extra no_tty=1 flag to the connection URI. This
stops ssh from asking for a password if it can't log in automatically.
Typical use-case for this is in graphical programs where if ssh asks for
a password it would cause the GUI program to hang.
Example:
$ virsh -c xen+ssh://xxx/ list
rjones@xxx's password:
Permission denied, please try again.
rjones@xxx's password:
Permission denied, please try again.
rjones@xxx's password:
Permission denied (publickey,gssapi-with-mic,password).
libvir: Remote error : Connection reset by peer
error: failed to connect to the hypervisor
error: no valid connection
$ virsh -c xen+ssh://xxx/?no_tty=1 list
Permission denied (publickey,gssapi-with-mic,password).
libvir: Remote error : Connection reset by peer
error: failed to connect to the hypervisor
error: no valid connection
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, 2 months
[Libvir] [PATCH] detect path of dnsmasq, brctl
by Richard W.M. Jones
I have found 3 bugs in libvirtd in the way that it runs the external
programs dnsmasq and brctl.
Bug (1) is that it searches the $PATH to find dnsmasq. This is normally
OK when libvirtd is launched from start-up scripts, but it's not very
helpful if you run libvirtd by hand because likely-as-not your path
won't contain /usr/sbin (the normal location of dnsmasq).
Bug (2) is that if libvirtd can't execvp dnsmasq, then it doesn't fail
in any obvious way.
Bug (3) is that the path to brctl is hard-coded.
This patch fixes bugs (1) & (3), but does not fix bug (2).
Firstly configure has been changed so that it searches for dnsmasq and
brctl programs in the usual places. If it find them then it generates a
config.h file which looks like this:
--------------------
/* Location or name of the brctl program (see bridge-utils) */
#define BRCTL "/usr/sbin/brctl"
/* Location or name of the dnsmasq program */
#define DNSMASQ "/usr/sbin/dnsmasq"
--------------------
If it doesn't find them then it just includes the program names, not
full paths:
--------------------
/* Location or name of the brctl program (see bridge-utils) */
#define BRCTL "brctl"
/* Location or name of the dnsmasq program */
#define DNSMASQ "dnsmasq"
--------------------
The code continues to use execvp to actually run the programs, so if the
program names contain '/' then the absolute paths are used directly,
otherwise execvp will do a shell-like search for the program along $PATH.
Please nota bene the change to the spec file.
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, 2 months
Re: [Libvir] PATCH: Explicit detection of KVM version
by Daniel P. Berrange
On Thu, Sep 20, 2007 at 10:45:03AM +0200, Gerd Hoffmann wrote:
> Daniel P. Berrange wrote:
> > Before starting any guest, the QEMU driver needs to figure out what version
> > of QEMU is in use & thus determine whether it supports particular command
> > line flags. We currently do that just by calling /usr/bin/qemu, since all
> > the various qemu-system-XXX binaries share the same syntax. The only problem
> > is that qemu-kvm does not neccessarily match the version of qemu installed.
> > So we detect QEMU version 0.8.2, but KVM is 0.9.0 based. The result is that
> > we pass the wrong style VNC argument to KVM & it fails to start. The second
> > problem is that even if you only ever want to run KVM guests, you still have
> > to have KVM itself installed.
>
> We have the same problem if the domain.xml has
> "<emulator>/path/to/qemu-foo</emulator>" specified, which I think isn't
> addressed by this patch ...
Nope it is not addressed. I think maybe instead of detecting once for QEMU
and KVM for the QEMU driver as whole, I'll move the flags into the per-VM
data structure. This will have extra overhead, since for each distinct VM
we'll have todo a test launch of QEMU, but VM creation is not a performance
bottleneck so I don't think its an issue.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 2 months
[Libvir] PATCH: Remove Xen Proxy driver
by Daniel P. Berrange
Since the previous patch allows the remote daemon to serve all the functions
of the current Xen Proxy driver, this patch simply removes the Xen proxy
and its driver.
$ diffstat .hg/patches/remote-proxy
Makefile.am | 2
a/proxy/.cvsignore | 5
a/proxy/Makefile.am | 19
a/proxy/libvirt_proxy.c | 852 ------------------------------------
a/src/proxy_internal.c | 1124 ------------------------------------------------
a/src/proxy_internal.h | 116 ----
src/Makefile.am | 1
src/xen_unified.c | 51 --
src/xen_unified.h | 9
9 files changed, 15 insertions(+), 2164 deletions(-)
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 2 months
[Libvir] [PATCH] Add support for virConnectGetHostname and virConnectGetURI for qemu
by Richard W.M. Jones
Specifically this just adds support for virConnectGetHostname on
qemu:/// URIs.
Because of the way that the qemu driver now works, calls to
virConnectGetURI are answered by the remote driver before the qemu
driver ever sees them, so they have worked all along.
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, 2 months
[Libvir] PATCH: Explicit detection of KVM version
by Daniel P. Berrange
Before starting any guest, the QEMU driver needs to figure out what version
of QEMU is in use & thus determine whether it supports particular command
line flags. We currently do that just by calling /usr/bin/qemu, since all
the various qemu-system-XXX binaries share the same syntax. The only problem
is that qemu-kvm does not neccessarily match the version of qemu installed.
So we detect QEMU version 0.8.2, but KVM is 0.9.0 based. The result is that
we pass the wrong style VNC argument to KVM & it fails to start. The second
problem is that even if you only ever want to run KVM guests, you still have
to have KVM itself installed.
This patch tweaks the feature/version detection so we do separate detection
just for KVM. With this applied I can successfully start KVM guests if the
QEMU version is different, or even if QEMU is not installed.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 2 months
[Libvir] PATCH: Cleanup conditionals from proxy driver in Xen code
by Daniel P. Berrange
The various xen drivers have alot of their code conditionally compiled using
#ifdef PROXY to avoid functions when built into the proxy. Without the proxy
this is no longer needed. There are a couple of functions that were only
used by the proxy & so can go completely.
$ diffstat .hg/patches/proxy-cpp-cleanup
xen_internal.c | 24 +------------------
xend_internal.c | 70 +++-----------------------------------------------------
xml.c | 2 -
xs_internal.c | 59 +----------------------------------------------
4 files changed, 8 insertions(+), 147 deletions(-)
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 2 months