[libvirt] [PATCH 3/13] Add public API
by Stefan Berger
This patch adds extensions to libvirt's public API necessary for
controlling the new functionality from remote for example.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
14 years, 7 months
[libvirt] [LXC] unable to configure networking for LXC
by Avi Weit
Hello,
Sorry for posting this twice (in libvir-list and libvirt-users) - I just
wasn't sure the proper forum should this be posted under.
I would like to set up sshd under an LXC application container and to be
able to connect into it from the host. I was able to achieve that with LXC
tools CLI after setting up a bridge via brctl and creating a proper
lxc.conf file for lxc-execute to use. However, I am unable to do so via
libvirt. I am using libvirt version 0.7.1 installed on fedora 12.
I first verified that the default network is up
[root@enc12 avi]# virsh net-list --all
Name State Autostart
-----------------------------------------
default active yes
and that the bridge exists
[root@enc12 avi]# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
I then went over the explanations under
http://www.libvirt.org/formatdomain.html#elementsNICS and
http://wiki.libvirt.org/page/Networking
and made sure net.ipv4.ip_forward = 1 under file /etc/sysctl.conf on the
host
after that, I created a container with the following xml specification:
<domain type='lxc'>
<name>ssh9</name>
<memory>500000</memory>
<os>
<type>exe</type>
<init>/usr/sbin/sshd</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<interface type='network'>
<source network='default'/>
</interface>
<console type='pty' />
</devices>
</domain>
Below is the command that verifies LXC is running followed by dumpxml:
[root@enc12 avi]# virsh -c lxc:/// list --all
Id Name State
----------------------------------
1551 ssh9 running
<domain type='lxc' id='1551'>
<name>ssh9</name>
<uuid>ead3dc4f-9b3f-eec0-e83a-1d87e0ffb1eb</uuid>
<memory>500000</memory>
<currentMemory>500000</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686'>exe</type>
<init>/usr/sbin/sshd</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<interface type='network'>
<mac address='52:54:00:e8:e3:dd'/>
<source network='default'/>
<target dev='veth0'/>
</interface>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target port='0'/>
</console>
</devices>
</domain>
However, I can not see the IP address of the container so was not able to
connect it. I can also see that the routing table configured on the host -
routes any address destined to network 192.168.122 - into the bridge and I
understood that the container should have constructed with one of the IPs
in the range of 192.168.122.2 to 192.168.122.254 (as defined in dhcp tag
under default network) but it did not happen.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
9.148.28.32 * 255.255.255.240 U 1 0 0
eth0
192.168.122.0 * 255.255.255.0 U 0 0 0
virbr0
default 9.148.28.33 0.0.0.0 UG 0 0 0
eth0
Can someone please help me to understand what am I missing here?
Thanks,
- Avi
14 years, 7 months
[libvirt] pkg-config for libvirt.
by Kumar L Srikanth-B22348
Hi,
I installed libvirt 0.7.6 version on my fedora 12 machine.
When issue the version command in the virsh console, the following are
the results:
Compiled against library: libvir 0.7.6
Using library: libvir 0.7.6
Using API: LXC 0.7.6
Running hypervisor: LXC 2.6.31
But, the following pkg-config command for libvirt is giving following:
Package libvirt was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvirt.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libvirt' found
Can anyone please let me know, how can I configure pkg-config w.r.t
libvirt?
Regards,
Srikanth.
14 years, 7 months
[libvirt] [PATCH] Include sysfs devices lacking a device symlink as node devices
by Ed Swierk
The udev node device driver relies on the "device" symlink in sysfs to
populate the node device's parent property. Loopback, vlan and bridge
network interfaces don't have a real hardware parent but could be useful
to include as node devices anyway (and the hal node device driver does
include them).
This patch allows the udev node device driver to include network
interfaces lacking a "device" symlink as node devices, and sets the
parent property to "computer".
Signed-off-by: Ed Swierk <eswierk(a)aristanetworks.com>
---
Index: libvirt-0.7.6/src/node_device/node_device_udev.c
===================================================================
--- libvirt-0.7.6.orig/src/node_device/node_device_udev.c
+++ libvirt-0.7.6/src/node_device/node_device_udev.c
@@ -1220,14 +1220,13 @@ static int udevSetParent(struct udev_dev
if (parent_device == NULL) {
VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
udev_device_get_syspath(device));
- goto out;
}
parent_sysfs_path = udev_device_get_syspath(parent_device);
if (parent_sysfs_path == NULL) {
VIR_INFO("Could not get syspath for parent of '%s'",
udev_device_get_syspath(device));
- goto out;
+ parent_sysfs_path = "";
}
def->parent_sysfs_path = strdup(parent_sysfs_path);
14 years, 7 months
[libvirt] Libvirt 0.7.7 compile under mingw
by Dev.Atom
Hi,
I'm trying to compile 0.7.7 under XP/mingw and I have this issue :
In file included from util/conf.c:24:
util/util.h:119: error: syntax error before "uid_t"
util/util.h:121: warning: function declaration isn't a prototype
util/util.h:129: error: syntax error before "uid_t"
util/util.h:130: warning: function declaration isn't a prototype
I have configure in this way (msys based path) :
./configure --host=i686-pc-mingw32 --without-sasl --without-avahi --without-polkit --without-python --without-xen --without-qemu --without-lxc --without-openvz --without-libvirtd --without-phyp --without-vbox --prefix=/mingw/
Any help ?
Best reagards
Arnaud Champion
14 years, 7 months
Re: [libvirt] Libvirt 0.7.7 compile under mingw
by Eric Blake
[let's keep the list in the loop]
On 03/10/2010 01:32 PM, Dev.Atom wrote:
> Hi,
>
> and thanks for your help.
>
> with "make V=1" I have this :
>
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib
> -I../gnulib/lib -I../include -I../src/util -I../include
> -I/mingw//include/libxml2 -DLIBDIR=\\\\/mingw/lib\\\\
> -DBINDIR=\\\\/mingw/libexec\\\\ -DSBINDIR=\\\\/mingw/sbin\\\\
> -DSYSCONF_DIR=\\\\/mingw/etc\\\\
> -DLOCALEBASEDIR=\\\\/mingw/share/locale\\\\
> -DPKGDATADIR=\\\\/mingw/share/libvirt\\\\
> -DLOCAL_STATE_DIR=\\\\/mingw/var\\\\ "-DGETTEXT_PACKAGE=\\libvirt\\
> -Wall" -Wformat -Wformat-security -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 -I/mingw/include -g -O2 -MT
> libvirt_util_la-conf.lo -MD -MP -MF .deps/libvirt_util_la-conf.Tpo -c
> util/conf.c -DDLL_EXPORT -DPIC -o .libs/libvirt_util_la-conf.o
> In file included from util/conf.c:24:
> util/util.h:119: error: syntax error before "uid_t"
> util/util.h:121: warning: function declaration isn't a prototype
> util/util.h:129: error: syntax error before "uid_t"
> util/util.h:130: warning: function declaration isn't a prototype
All right, the next thing I asked for was the region of the preprocessed
sources close to the error. Something like:
gcc -E -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/mingw//include/libxml2
-DLIBDIR=\\\\/mingw/lib\\\\ -DBINDIR=\\\\/mingw/libexec\\\\
-DSBINDIR=\\\\/mingw/sbin\\\\ -DSYSCONF_DIR=\\\\/mingw/etc\\\\
-DLOCALEBASEDIR=\\\\/mingw/share/locale\\\\
-DPKGDATADIR=\\\\/mingw/share/libvirt\\\\
-DLOCAL_STATE_DIR=\\\\/mingw/var\\\\ -I/mingw/include -g -O2 util/conf.c
-DDLL_EXPORT -DPIC
>
> Here are the depndencies version (mayabe shoud I use another gnulib
> version, I don't know) :
>
> gnutls-2.8.5
> libgcrypt-1.4.5
> libgpg-error-1.7
> libxml2-2.7.6
> portablexdr-4.9.1
Are you building from a release or from git?
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 7 months