[libvirt] The last two remaining "out of the box" build failures for OS X
by Justin Clift
Hi all,
On the home straight getting libvirt to work "out of the box" on MacOS
X. (ideal scenario: it's "good enough" today. :>)
With the very latest git snapshot, to get a working compile requires
these options to be used:
./configure --without-network --without-storage-fs
Leaving either of the network or storage-fs options not explicitly
disabled, causes failure during compilation.
Wondering if these two or fundamentally Linux specific things, so we
should update our configure.ac to not attempt them on non-Linux, or do
they indicate actual problem(s)?
***********************************************************************
***********************************************************************
The remainder of this email is kind of lengthy, giving info on the
specific errors caused by each of the above options. Feel free to
ignore this if it's of no interest. :)
+ Leaving off --without-network gives
***********************************************************************
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/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 -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-bridge.lo -MD -MP -MF
.deps/libvirt_util_la-bridge.Tpo -c util/bridge.c -fno-common -DPIC -o
.libs/libvirt_util_la-bridge.o
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/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 -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo
-c util/buf.c -fno-common -DPIC -o .libs/libvirt_util_la-buf.o
In file included from util/bridge.h:29,
from util/bridge.c:26:
/usr/include/net/if.h:264: error: field 'ifru_addr' has incomplete type
/usr/include/net/if.h:265: error: field 'ifru_dstaddr' has incomplete type
/usr/include/net/if.h:266: error: field 'ifru_broadaddr' has incomplete type
/usr/include/net/if.h:305: error: field 'ifra_addr' has incomplete type
/usr/include/net/if.h:306: error: field 'ifra_broadaddr' has incomplete type
/usr/include/net/if.h:307: error: field 'ifra_mask' has incomplete type
/usr/include/net/if.h:379: error: field 'addr' has incomplete type
/usr/include/net/if.h:380: error: field 'dstaddr' has incomplete type
util/bridge.c:41:55: error: linux/param.h: No such file or directory
util/bridge.c:42:55: error: linux/sockios.h: No such file or directory
util/bridge.c:43:55: error: linux/if_bridge.h: No such file or directory
util/bridge.c:44:55: error: linux/if_tun.h: No such file or directory
util/bridge.c: In function 'ifSetInterfaceMac':
util/bridge.c:311: error: 'SIOCGIFHWADDR' undeclared (first use in this
function)
util/bridge.c:311: error: (Each undeclared identifier is reported only once
util/bridge.c:311: error: for each function it appears in.)
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:314: error: 'struct ifreq' has no member named 'ifr_hwaddr'
util/bridge.c:316: error: 'SIOCSIFHWADDR' undeclared (first use in this
function)
util/bridge.c: In function 'brAddTap':
util/bridge.c:498: error: 'IFF_TAP' undeclared (first use in this function)
util/bridge.c:498: error: 'IFF_NO_PI' undeclared (first use in this
function)
util/bridge.c:512: error: 'TUNSETIFF' undeclared (first use in this
function)
util/bridge.c:534: error: 'TUNSETPERSIST' undeclared (first use in this
function)
util/bridge.c: In function 'brDeleteTap':
util/bridge.c:564: error: 'IFF_TAP' undeclared (first use in this function)
util/bridge.c:564: error: 'IFF_NO_PI' undeclared (first use in this
function)
util/bridge.c:571: error: 'TUNSETIFF' undeclared (first use in this
function)
util/bridge.c:572: error: 'TUNSETPERSIST' undeclared (first use in this
function)
make[3]: *** [libvirt_util_la-bridge.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/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 -fdiagnostics-show-option -DIN_LIBVIRT -g
-O2 -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo
-c util/buf.c -o libvirt_util_la-buf.o >/dev/null 2>&1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
***********************************************************************
+ Leaving off --without-storage-fs gives
***********************************************************************
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../src/util -I../include -I/usr/include/libxml2
-DLIBDIR=\"/opt/libvirt/lib\" -DBINDIR=\"/opt/libvirt/libexec\"
-DSBINDIR=\"/opt/libvirt/sbin\" -DSYSCONF_DIR=\"/opt/libvirt/etc\"
-DLOCALEBASEDIR=\"/opt/libvirt/share/locale\"
-DPKGDATADIR=\"/opt/libvirt/share/libvirt\"
-DLOCAL_STATE_DIR=\"/opt/libvirt/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 -fdiagnostics-show-option -DIN_LIBVIRT
-I../src/conf -g -O2 -MT libvirt_driver_storage_la-storage_backend_fs.lo
-MD -MP -MF .deps/libvirt_driver_storage_la-storage_backend_fs.Tpo -c
storage/storage_backend_fs.c -fno-common -DPIC -o
.libs/libvirt_driver_storage_la-storage_backend_fs.o
storage/storage_backend_fs.c:145:21: error: mntent.h: No such file or
directory
storage/storage_backend_fs.c: In function
'virStorageBackendFileSystemIsMounted':
storage/storage_backend_fs.c:274: error: storage size of 'ent' isn't known
storage/storage_backend_fs.c:277: error: '_PATH_MOUNTED' undeclared
(first use in this function)
storage/storage_backend_fs.c:277: error: (Each undeclared identifier is
reported only once
storage/storage_backend_fs.c:277: error: for each function it appears in.)
storage/storage_backend_fs.c:284: warning: implicit declaration of
function 'getmntent_r'
storage/storage_backend_fs.c:284: warning: nested extern declaration of
'getmntent_r' [-Wnested-externs]
storage/storage_backend_fs.c:284: warning: comparison between pointer
and integer
storage/storage_backend_fs.c:274: warning: unused variable 'ent'
[-Wunused-variable]
make[3]: *** [libvirt_driver_storage_la-storage_backend_fs.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
This one kind of looked like it almost got through the compile stage. ;)
***********************************************************************
14 years, 1 month
[libvirt] [PATCH] Add the device alias element to the domain.rng schema
by Matthias Bolte
Every device element that can contain an address element
can also contain an alias element, but the domain.rng didn't
reflect this. Therefore, running virt-xml-validate on the
virsh dumpxml output of an active domain failed. It doesn't
fail for inactive domains, because in that case dumpxml
doesn't include the alias elements.
Add the device alias element to the domain.rng schema and
add a new test case to cover this.
Indirectly reported by Jon Stanley.
---
docs/schemas/domain.rng | 42 +++++++++++++++
tests/domainschemadata/device-aliases.xml | 79 +++++++++++++++++++++++++++++
2 files changed, 121 insertions(+), 0 deletions(-)
create mode 100644 tests/domainschemadata/device-aliases.xml
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 2e0457b..8fdf864 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -503,6 +503,9 @@
<ref name="encryption"/>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</define>
@@ -697,6 +700,9 @@
</attribute>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -762,6 +768,9 @@
</group>
</choice>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -924,6 +933,9 @@
</element>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
<optional>
@@ -1157,6 +1169,9 @@
</element>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1240,6 +1255,9 @@
<ref name="qemucdevTgtDef"/>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</interleave>
@@ -1345,6 +1363,9 @@
</choice>
</attribute>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1369,6 +1390,9 @@
</attribute>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1383,6 +1407,9 @@
</choice>
</attribute>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1426,6 +1453,9 @@
<ref name="virtioTarget"/>
</choice>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</interleave>
@@ -1449,6 +1479,9 @@
</attribute>
</optional>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1492,6 +1525,9 @@
</element>
</group>
<optional>
+ <ref name="alias"/>
+ </optional>
+ <optional>
<ref name="address"/>
</optional>
</element>
@@ -1728,6 +1764,12 @@
</element>
</define>
+ <define name="alias">
+ <element name="alias">
+ <attribute name="name"/>
+ </element>
+ </define>
+
<define name="filterref-node-attributes">
<attribute name="filter">
<data type="NCName"/>
diff --git a/tests/domainschemadata/device-aliases.xml b/tests/domainschemadata/device-aliases.xml
new file mode 100644
index 0000000..6b0299e
--- /dev/null
+++ b/tests/domainschemadata/device-aliases.xml
@@ -0,0 +1,79 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-0.12'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source file='/var/lib/libvirt/images/QEMUGuest1.img'/>
+ <target dev='hda' bus='ide'/>
+ <alias name='ide0-0-0'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source file='/var/lib/libvirt/images/foobar.iso'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <alias name='ide0-1-0'/>
+ <address type='drive' controller='0' bus='1' unit='0'/>
+ </disk>
+ <filesystem type='file'>
+ <source file='/var/lib/libvirt/images/foobar.iso'/>
+ <target dir='/var/lib/libvirt/images'/>
+ <alias name='filesystem0'/>
+ </filesystem>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:b5:36:36'/>
+ <alias name='net0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <source path='/dev/pts/15'/>
+ <target port='0'/>
+ <alias name='serial0'/>
+ </serial>
+ <console type='pty' tty='/dev/pts/15'>
+ <source path='/dev/pts/15'/>
+ <target type='serial' port='0'/>
+ <alias name='serial0'/>
+ </console>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'/>
+ <video>
+ <model type='cirrus' vram='9216' heads='1'/>
+ <alias name='video0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </video>
+ <watchdog model='ib700' action='poweroff'>
+ <alias name='watchdog0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
+ </watchdog>
+ <memballoon model='virtio'>
+ <alias name='balloon0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
--
1.7.0.4
14 years, 1 month
[libvirt] OSX 10.6 build failures
by Justin Clift
Hi us,
Going through the process of getting libvirt to compile on OSX, making
notes of the failures on the way through (from a clean system) to be fixed.
a) libtool -> glibtool
libtoolize -> glibtoolize
It turns out that autogen.sh is hard coded to use "libtool", and
wants the GNU version.
OSX supplies has it's own version, without a --version option, so
autogen.sh fails.
Installing GNU libtool through MacPorts, makes it available as
glibtool, with libtoolize being glibtoolize.
Adjusting autogen.sh to detect that, then set LIBTOOL and LIBTOOLIZE
appropriately was fairly trivial.
Will submit a patch to fix that in a bit.
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR
not being a defined macro.
Googling with some persistence showed this is caused by pkg-config
not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version"
based, copying the approach used for the other autogen.sh checks.
c) This is a compilation failure, one I don't readily know how to fix:
...
Making all in src
make all-am
CC libvirt_util_la-network.lo
util/network.c: In function 'getIPv6Addr':
util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16'
util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16'
util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16'
util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16'
make[3]: *** [libvirt_util_la-network.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
They're the only problems so far, though most things have been disabled
on the ./configure line so it's only the client libraries being built.
Anyone know how to address that third one?
Regards and best wishes,
Justin Clift
14 years, 1 month
[libvirt] [PATCH] configure: disable network and storage-fs drivers on mac os x
by Justin Clift
Disabling these two drivers on MacOS X, where they are known to
not work, allows libvirt (including the daemon) to compile without
any further changes.
---
Whooo, we now run on MacOS X too.
Anyone with a BSD around, that wants to check there, in case we get lucky? :)
configure.ac | 39 ++++++++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6c4e828..2dbfc72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,12 +182,24 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
sysconfdir='/etc'
fi
-dnl lxc and qemu drivers require linux headers
+dnl Make some notes about which OS we're compiling for, as the lxc and qemu
+dnl drivers require linux headers, while storage_mpath and nwfilter are also
+dnl linux specific. The "network" and "storage_fs" drivers are known to not
+dnl work on MacOS X presently, so we also make a note if compiling for that
+
+with_linux=no
+with_osx=no
case "$host" in
*-*-linux*)
# match linux here so the *) case will match anything non-linux
+ with_linux=yes
;;
*)
+ case "$host" in
+ *-*-darwin*)
+ with_osx=yes
+ ;;
+ esac
if test "x$with_lxc" != "xyes"
then
with_lxc=no
@@ -198,6 +210,7 @@ case "$host" in
fi
;;
esac
+AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
AC_ARG_WITH([xen],
@@ -1306,12 +1319,18 @@ fi
AC_SUBST([READLINE_CFLAGS])
AC_SUBST([VIRSH_LIBS])
+dnl check if the network driver should be compiled
AC_ARG_WITH([network],
AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes])
-if test "$with_libvirtd" = "no" ; then
+
+dnl theres no use compiling the network driver without the libvirt
+dnl daemon, nor compiling it for MacOS X, where it breaks the compile
+
+if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then
with_network=no
fi
+
if test "$with_network" = "yes" ; then
AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled])
fi
@@ -1389,6 +1408,11 @@ if test "$with_storage_dir" = "yes" ; then
fi
AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"])
+dnl storage-fs does not work on MacOS X
+
+if test "$with_osx" = "yes"; then
+ with_storage_fs=no
+fi
if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then
AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin])
@@ -1503,14 +1527,6 @@ if test "$with_storage_scsi" = "check"; then
fi
AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"])
-with_linux=no
-case "$host" in
- *-*-linux*)
- with_linux=yes
- ;;
-esac
-AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
-
if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then
with_storage_mpath=yes
@@ -2030,6 +2046,8 @@ then
fi
AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
+dnl nwfilter should only be compiled for linux, and only if the
+dnl libvirt daemon is also being compiled
with_nwfilter=yes
if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then
@@ -2040,7 +2058,6 @@ if test "$with_nwfilter" = "yes" ; then
fi
AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"])
-
AC_ARG_WITH([qemu-user],
AC_HELP_STRING([--with-qemu-user], [username to run QEMU system instance as @<:@default=root@:>@]),
[QEMU_USER=${withval}],
--
1.7.3
14 years, 1 month
Re: [libvirt] Here they
by Jaromír Červenka
Hi there,
Arnaud, where did you get latest source of my C# binding? Because my svn
server doesn't work a couple of months, so maybe you used old one. I
attached latest one in this mail.
I am so sorry that I discontinued work of my bindings for libivirt, but I
discovered Ruby language and I felt love in it and I ported my web interface
for libvirt - now is built on Chris's ruby-libvirt.
Arnaud I noticed that you didn't used my classes which "envelops" bare
libvirt functions, am I right? Good work anyway, I'm glad that part of my
job wont be lose :)
Regards,
Jaromír Červenka
Official openSUSE community member
Web: http://www.cervajz.com/
Jabber: cervajz(a)cervajz.com
MSN: jara.cervenka(a)seznam.cz
Tel.: +420 607 592 687
Alt. e-mails:
jaromir.cervenka(a)opensuse.org,
jaromir.cervenka(a)speel.cz
Dne 24. září 2010 17:47 <arnaud.champion(a)devatom.fr> napsal(a):
> I'm very away from a licence expert :) but I think that should be similar
> to libvirt, so LGPL 2 or later seems good for me.
>
> A lot of code comes from Jaromír, I have changed these things :
> - improve pinning and marshaling of struct, methods for using with C# and
> windows libvirt binaries
> - Add delegate to handle callbacks, this include pinnings and marshaling
> also (I have to work little on the pinning/marshaling of the delegate
> virConnectAuthCallback, because it seems that I have some trouble around
> packing structure virConnectCredential)
>
> I have also added some XML auto documentation descriptors.
>
>
>
> --------------------------------------------------
> From: "Daniel Veillard" <veillard(a)redhat.com>
> Sent: Friday, September 24, 2010 2:15 PM
> To: <arnaud.champion(a)devatom.fr>
> Cc: "Jaromír Červenka" <cervajz(a)cervajz.com>
> Subject: Re: Here they
>
>
> On Fri, Sep 24, 2010 at 11:29:51AM +0200, arnaud.champion(a)devatom.frwrote:
>>
>>> Hi,
>>>
>>
>> Bonjour,
>>
>> As I have said, here are the libvirt C# bindings that I have modified.
>>> For info, I use them in a project (DAVIM) and they work find, I will make a
>>> doc to explain what is covered and what is not...
>>>
>>> Let me know if you have any question.
>>>
>>
>> yes at least two:
>>
>> - what is the Licence for the code in that ZIP ? I would assume
>> LGPL version 2 or later, to be similar to libvirt itself
>> - how much of that code is coming from Jaromír ?
>>
>> thanks !
>>
>> PS : Sorry for my poor english. FYI, DAVIM, is a tool to create / manage
>>> Libvirt/KVM it is free to download at www.Devatom.fr the tol is in
>>> english or french but the website is in french only. Let me know if you want
>>> I send you the tool if you want to test it.
>>>
>>
>> Pas de probleme !
>> A priori je n'ai pas de C# ni de machine Windows donc pas tres utile
>> pour moi, mais merci ...
>>
>> Daniel
>>
>> --
>> Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
>> daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
>> http://veillard.com/ | virtualization library http://libvirt.org/
>>
>>
>
14 years, 1 month
[libvirt] virt-install feature request
by Stanley, Jon [Tech]
So virt-install is a really nice piece of software, but it's a bit too complicated for our use case :).
We would want some mode of it to simply generate XML and go home :). The use case is that we have a script which carries out a number of other actions in addition to creating a guest, and creating a guest and putting an OS on it are two separate steps.
It would also be nice to have some command line interface to modify a guest's boot selection, for example, changing from PXE to local disk. Even nicer would be a concept of boot order - we have a setup where the first normal boot order is PXE, and if that fails (which it should a majority of the time) then go to local disk.
14 years, 1 month
[libvirt] [PATCH] nwfilter: fix memory leaks
by Stefan Berger
Fixing memory leak shown by valgrind and freeing buffer in two more
places.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -1508,7 +1508,11 @@ _iptablesCreateRuleInstance(int directio
}
if (virBufferUse(&prefix)) {
- virBufferVSprintf(&prefix, "%s", virBufferContentAndReset(&buf));
+ char *s = virBufferContentAndReset(&buf);
+
+ virBufferVSprintf(&prefix, "%s", s);
+
+ VIR_FREE(s);
final = &prefix;
@@ -1531,11 +1535,13 @@ _iptablesCreateRuleInstance(int directio
err_exit:
virBufferFreeAndReset(&buf);
+ virBufferFreeAndReset(&prefix);
return -1;
exit_no_error:
virBufferFreeAndReset(&buf);
+ virBufferFreeAndReset(&prefix);
return 0;
}
14 years, 1 month
[libvirt] [PATCH] esx: Add support for virtual serial device network backing
by Matthias Bolte
Since version 4.1 ESX(i) can expose virtual serial devices over TCP.
Add support in the VMX handling code for this, add test cases to cover
it and add links to some documentation.
ESX supports two additional protocols: TELNETS and TLS. Add them to
the list of serial-over-TCP protocols.
---
docs/formatdomain.html.in | 4 +-
src/conf/domain_conf.c | 18 ++-
src/conf/domain_conf.h | 3 +
src/esx/README | 23 ++-
src/esx/esx_vmx.c | 163 ++++++++++++++++++--
.../vmx2xmldata/vmx2xml-serial-network-client.vmx | 6 +
.../vmx2xmldata/vmx2xml-serial-network-client.xml | 25 +++
.../vmx2xmldata/vmx2xml-serial-network-server.vmx | 6 +
.../vmx2xmldata/vmx2xml-serial-network-server.xml | 25 +++
tests/vmx2xmltest.c | 2 +
.../xml2vmxdata/xml2vmx-serial-network-client.vmx | 14 ++
.../xml2vmxdata/xml2vmx-serial-network-client.xml | 15 ++
.../xml2vmxdata/xml2vmx-serial-network-server.vmx | 14 ++
.../xml2vmxdata/xml2vmx-serial-network-server.xml | 15 ++
tests/xml2vmxtest.c | 2 +
15 files changed, 304 insertions(+), 31 deletions(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-serial-network-client.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-serial-network-client.xml
create mode 100644 tests/vmx2xmldata/vmx2xml-serial-network-server.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-serial-network-server.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-serial-network-client.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-serial-network-client.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-serial-network-server.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-serial-network-server.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5e56dae..2f64f8d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1461,7 +1461,9 @@ qemu-kvm -net nic,model=? /dev/null
...</pre>
<p>
- Alternatively you can use telnet instead of raw TCP.
+ Alternatively you can use <code>telnet</code> instead of <code>raw</code> TCP.
+ <span class="since">Since 0.8.5</span> you can also use <code>telnets</code>
+ (secure telnet) and <code>tls</code>.
<p>
<pre>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e05d5d7..92aa3d1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -203,6 +203,12 @@ VIR_ENUM_IMPL(virDomainChr, VIR_DOMAIN_CHR_TYPE_LAST,
"tcp",
"unix")
+VIR_ENUM_IMPL(virDomainChrTcpProtocol, VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST,
+ "raw",
+ "telnet",
+ "telnets",
+ "tls")
+
VIR_ENUM_IMPL(virDomainSoundModel, VIR_DOMAIN_SOUND_MODEL_LAST,
"sb16",
"es1370",
@@ -2748,12 +2754,10 @@ virDomainChrDefParseXML(virCapsPtr caps,
def->data.tcp.listen = 1;
}
- if (protocol == NULL ||
- STREQ(protocol, "raw"))
+ if (protocol == NULL)
def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW;
- else if (STREQ(protocol, "telnet"))
- def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
- else {
+ else if ((def->data.tcp.protocol =
+ virDomainChrTcpProtocolTypeFromString(protocol)) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown protocol '%s'"), protocol);
goto error;
@@ -5848,9 +5852,7 @@ virDomainChrDefFormat(virBufferPtr buf,
def->data.tcp.host,
def->data.tcp.service);
virBufferVSprintf(buf, " <protocol type='%s'/>\n",
- def->data.tcp.protocol ==
- VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET
- ? "telnet" : "raw");
+ virDomainChrTcpProtocolTypeToString(def->data.tcp.protocol));
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 7195c04..9bf13d8 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -357,6 +357,8 @@ enum virDomainChrType {
enum virDomainChrTcpProtocol {
VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW,
VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET,
+ VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNETS, /* secure telnet */
+ VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS,
VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST,
};
@@ -1172,6 +1174,7 @@ VIR_ENUM_DECL(virDomainChrDevice)
VIR_ENUM_DECL(virDomainChrChannelTarget)
VIR_ENUM_DECL(virDomainChrConsoleTarget)
VIR_ENUM_DECL(virDomainChr)
+VIR_ENUM_DECL(virDomainChrTcpProtocol)
VIR_ENUM_DECL(virDomainSoundModel)
VIR_ENUM_DECL(virDomainMemballoonModel)
VIR_ENUM_DECL(virDomainWatchdogModel)
diff --git a/src/esx/README b/src/esx/README
index 7254332..9ae93b1 100644
--- a/src/esx/README
+++ b/src/esx/README
@@ -3,13 +3,24 @@ Some links to relevant documentation
====================================
-VI/vSphere API: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/
- http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/
-VMX config: http://www.sanbarrow.com/vmx.html
-CPUID: http://www.sandpile.org/ia32/cpuid.htm
-Memory model: http://www.vmware.com/pdf/esx3_memory.pdf
- http://www.vmware.com/pdf/usenix_resource_mgmt.pdf
+VI/vSphere API:
+ http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/
+ http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/
+ http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/
+VMX config:
+ http://www.sanbarrow.com/vmx.html
+
+CPUID:
+ http://www.sandpile.org/ia32/cpuid.htm
+
+Memory model:
+ http://www.vmware.com/pdf/esx3_memory.pdf
+ http://www.vmware.com/pdf/usenix_resource_mgmt.pdf
+
+Virtual serial port (network backed):
+ http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/v...
+ http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/vsp41_usingpro...
diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c
index 59eb3b2..bfebc4a 100644
--- a/src/esx/esx_vmx.c
+++ b/src/esx/esx_vmx.c
@@ -379,6 +379,36 @@ def->serials[0]...
??? <=> serial0.yieldOnMsrRead = "true" # defaults to "false", FIXME: not representable
+## serials: network, server (since vSphere 4.1) ################################
+
+->type = _CHR_TYPE_TCP <=> serial0.fileType = "network"
+
+->data.tcp.host = <host> <=> serial0.fileName = "<protocol>://<host>:<service>"
+->data.tcp.service = <service> # e.g. "telnet://0.0.0.0:42001"
+->data.tcp.protocol = <protocol>
+
+->data.tcp.listen = 1 <=> serial0.network.endPoint = "server" # defaults to "server"
+
+??? <=> serial0.vspc = "foobar" # defaults to <not present>, FIXME: not representable
+??? <=> serial0.tryNoRxLoss = "false" # defaults to "false", FIXME: not representable
+??? <=> serial0.yieldOnMsrRead = "true" # defaults to "false", FIXME: not representable
+
+
+## serials: network, client (since vSphere 4.1) ################################
+
+->type = _CHR_TYPE_TCP <=> serial0.fileType = "network"
+
+->data.tcp.host = <host> <=> serial0.fileName = "<protocol>://<host>:<service>"
+->data.tcp.service = <service> # e.g. "telnet://192.168.0.17:42001"
+->data.tcp.protocol = <protocol>
+
+->data.tcp.listen = 0 <=> serial0.network.endPoint = "client" # defaults to "server"
+
+??? <=> serial0.vspc = "foobar" # defaults to <not present>, FIXME: not representable
+??? <=> serial0.tryNoRxLoss = "false" # defaults to "false", FIXME: not representable
+??? <=> serial0.yieldOnMsrRead = "true" # defaults to "false", FIXME: not representable
+
+
################################################################################
## parallels ###################################################################
@@ -424,8 +454,11 @@ def->parallels[0]...
#define VIR_FROM_THIS VIR_FROM_ESX
+#define ESX_BUILD_VMX_NAME_EXTRA(_suffix, _extra) \
+ snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."_extra, prefix);
+
#define ESX_BUILD_VMX_NAME(_suffix) \
- snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."#_suffix, prefix);
+ ESX_BUILD_VMX_NAME_EXTRA(_suffix, #_suffix)
/* directly map the virDomainControllerModel to esxVMX_SCSIControllerModel,
* this is good enough for now because all virDomainControllerModel values
@@ -2113,6 +2146,11 @@ esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
char fileName_name[48] = "";
char *fileName = NULL;
+ char network_endPoint_name[48] = "";
+ char *network_endPoint = NULL;
+
+ xmlURIPtr parsedUri = NULL;
+
if (def == NULL || *def != NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
@@ -2137,6 +2175,7 @@ esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
ESX_BUILD_VMX_NAME(startConnected);
ESX_BUILD_VMX_NAME(fileType);
ESX_BUILD_VMX_NAME(fileName);
+ ESX_BUILD_VMX_NAME_EXTRA(network_endPoint, "network.endPoint");
/* vmx:present */
if (esxUtil_GetConfigBoolean(conf, present_name, &present, false,
@@ -2165,6 +2204,12 @@ esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
goto cleanup;
}
+ /* vmx:network.endPoint -> def:data.tcp.listen */
+ if (esxUtil_GetConfigString(conf, network_endPoint_name, &network_endPoint,
+ true) < 0) {
+ goto cleanup;
+ }
+
/* Setup virDomainChrDef */
if (STRCASEEQ(fileType, "device")) {
(*def)->target.port = port;
@@ -2190,10 +2235,72 @@ esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
(*def)->data.file.path = fileName;
fileName = NULL;
+ } else if (STRCASEEQ(fileType, "network")) {
+ (*def)->target.port = port;
+ (*def)->type = VIR_DOMAIN_CHR_TYPE_TCP;
+
+ parsedUri = xmlParseURI(fileName);
+
+ if (parsedUri == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (parsedUri->port == 0) {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("VMX entry '%s' doesn't contain a port part"),
+ fileName_name);
+ goto cleanup;
+ }
+
+ (*def)->data.tcp.host = strdup(parsedUri->server);
+
+ if ((*def)->data.tcp.host == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (virAsprintf(&(*def)->data.tcp.service, "%d", parsedUri->port) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ /* See vSphere API documentation about VirtualSerialPortURIBackingInfo */
+ if (parsedUri->scheme == NULL ||
+ STRCASEEQ(parsedUri->scheme, "tcp") ||
+ STRCASEEQ(parsedUri->scheme, "tcp4") ||
+ STRCASEEQ(parsedUri->scheme, "tcp6")) {
+ (*def)->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW;
+ } else if (STRCASEEQ(parsedUri->scheme, "telnet")) {
+ (*def)->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
+ } else if (STRCASEEQ(parsedUri->scheme, "telnets")) {
+ (*def)->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNETS;
+ } else if (STRCASEEQ(parsedUri->scheme, "ssl") ||
+ STRCASEEQ(parsedUri->scheme, "tcp+ssl") ||
+ STRCASEEQ(parsedUri->scheme, "tcp4+ssl") ||
+ STRCASEEQ(parsedUri->scheme, "tcp6+ssl")) {
+ (*def)->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS;
+ } else {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("VMX entry '%s' contains unsupported scheme '%s'"),
+ fileName_name, parsedUri->scheme);
+ goto cleanup;
+ }
+
+ if (network_endPoint == NULL || STRCASEEQ(network_endPoint, "server")) {
+ (*def)->data.tcp.listen = 1;
+ } else if (STRCASEEQ(network_endPoint, "client")) {
+ (*def)->data.tcp.listen = 0;
+ } else {
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'server' or 'client' "
+ "but found '%s'"), network_endPoint_name, network_endPoint);
+ goto cleanup;
+ }
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting VMX entry '%s' to be 'device', 'file' or 'pipe' "
- "but found '%s'"), fileType_name, fileType);
+ "or 'network' but found '%s'"), fileType_name, fileType);
goto cleanup;
}
@@ -2207,6 +2314,8 @@ esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
VIR_FREE(fileType);
VIR_FREE(fileName);
+ VIR_FREE(network_endPoint);
+ xmlFreeURI(parsedUri);
return result;
@@ -3069,6 +3178,7 @@ esxVMX_FormatSerial(esxVMX_Context *ctx, virDomainChrDefPtr def,
virBufferPtr buffer)
{
char *fileName = NULL;
+ const char *protocol;
if (def->target.port < 0 || def->target.port > 3) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
@@ -3077,13 +3187,6 @@ esxVMX_FormatSerial(esxVMX_Context *ctx, virDomainChrDefPtr def,
return -1;
}
- if (def->data.file.path == NULL) {
- ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting domain XML attribute 'path' of entry "
- "'devices/serial/source' to be present"));
- return -1;
- }
-
virBufferVSprintf(buffer, "serial%d.present = \"true\"\n", def->target.port);
/* def:type -> vmx:fileType and def:data.file.path -> vmx:fileName */
@@ -3124,6 +3227,41 @@ esxVMX_FormatSerial(esxVMX_Context *ctx, virDomainChrDefPtr def,
def->target.port, def->data.file.path);
break;
+ case VIR_DOMAIN_CHR_TYPE_TCP:
+ switch (def->data.tcp.protocol) {
+ case VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW:
+ protocol = "tcp";
+ break;
+
+ case VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET:
+ protocol = "telnet";
+ break;
+
+ case VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNETS:
+ protocol = "telnets";
+ break;
+
+ case VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS:
+ protocol = "ssl";
+ break;
+
+ default:
+ ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Unsupported character device TCP protocol '%s'"),
+ virDomainChrTcpProtocolTypeToString(def->data.tcp.protocol));
+ return -1;
+ }
+
+ virBufferVSprintf(buffer, "serial%d.fileType = \"network\"\n",
+ def->target.port);
+ virBufferVSprintf(buffer, "serial%d.fileName = \"%s://%s:%s\"\n",
+ def->target.port, protocol, def->data.tcp.host,
+ def->data.tcp.service);
+ virBufferVSprintf(buffer, "serial%d.network.endPoint = \"%s\"\n",
+ def->target.port,
+ def->data.tcp.listen ? "server" : "client");
+ break;
+
default:
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Unsupported character device type '%s'"),
@@ -3154,13 +3292,6 @@ esxVMX_FormatParallel(esxVMX_Context *ctx, virDomainChrDefPtr def,
return -1;
}
- if (def->data.file.path == NULL) {
- ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting domain XML attribute 'path' of entry "
- "'devices/parallel/source' to be present"));
- return -1;
- }
-
virBufferVSprintf(buffer, "parallel%d.present = \"true\"\n",
def->target.port);
diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx b/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx
new file mode 100644
index 0000000..18cfc57
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx
@@ -0,0 +1,6 @@
+config.version = "8"
+virtualHW.version = "4"
+serial0.present = "true"
+serial0.fileType = "network"
+serial0.fileName = "tcp://192.168.0.17:42001"
+serial0.network.endPoint = "client"
diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-client.xml b/tests/vmx2xmldata/vmx2xml-serial-network-client.xml
new file mode 100644
index 0000000..b0c0715
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-serial-network-client.xml
@@ -0,0 +1,25 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <serial type='tcp'>
+ <source mode='connect' host='192.168.0.17' service='42001'/>
+ <protocol type='raw'/>
+ <target port='0'/>
+ </serial>
+ <console type='tcp'>
+ <source mode='connect' host='192.168.0.17' service='42001'/>
+ <protocol type='raw'/>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx b/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx
new file mode 100644
index 0000000..d4a9c41
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx
@@ -0,0 +1,6 @@
+config.version = "8"
+virtualHW.version = "4"
+serial0.present = "true"
+serial0.fileType = "network"
+serial0.fileName = "telnets://0.0.0.0:42001"
+serial0.network.endPoint = "server"
diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-server.xml b/tests/vmx2xmldata/vmx2xml-serial-network-server.xml
new file mode 100644
index 0000000..e151017
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-serial-network-server.xml
@@ -0,0 +1,25 @@
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <serial type='tcp'>
+ <source mode='bind' host='0.0.0.0' service='42001'/>
+ <protocol type='telnets'/>
+ <target port='0'/>
+ </serial>
+ <console type='tcp'>
+ <source mode='bind' host='0.0.0.0' service='42001'/>
+ <protocol type='telnets'/>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index c71f536..2d59297 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -266,6 +266,8 @@ mymain(int argc, char **argv)
DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35);
DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-network-server", "serial-network-server", esxVI_ProductVersion_ESX41);
+ DO_TEST("serial-network-client", "serial-network-client", esxVI_ProductVersion_ESX41);
DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35);
DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35);
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-client.vmx b/tests/xml2vmxdata/xml2vmx-serial-network-client.vmx
new file mode 100644
index 0000000..d10f403
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-client.vmx
@@ -0,0 +1,14 @@
+config.version = "8"
+virtualHW.version = "7"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "serial-network"
+memsize = "4"
+numvcpus = "1"
+floppy0.present = "false"
+floppy1.present = "false"
+serial0.present = "true"
+serial0.fileType = "network"
+serial0.fileName = "tcp://192.168.0.17:42001"
+serial0.network.endPoint = "client"
+serial0.yieldOnMsrRead = "true"
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-client.xml b/tests/xml2vmxdata/xml2vmx-serial-network-client.xml
new file mode 100644
index 0000000..e2a5afe
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-client.xml
@@ -0,0 +1,15 @@
+<domain type='vmware'>
+ <name>serial-network</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <serial type='tcp'>
+ <source mode="connect" host="192.168.0.17" service="42001"/>
+ <protocol type="raw"/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-server.vmx b/tests/xml2vmxdata/xml2vmx-serial-network-server.vmx
new file mode 100644
index 0000000..b5d77f4
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-server.vmx
@@ -0,0 +1,14 @@
+config.version = "8"
+virtualHW.version = "7"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "serial-network"
+memsize = "4"
+numvcpus = "1"
+floppy0.present = "false"
+floppy1.present = "false"
+serial0.present = "true"
+serial0.fileType = "network"
+serial0.fileName = "ssl://0.0.0.0:42001"
+serial0.network.endPoint = "server"
+serial0.yieldOnMsrRead = "true"
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-server.xml b/tests/xml2vmxdata/xml2vmx-serial-network-server.xml
new file mode 100644
index 0000000..a17e2fe
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-server.xml
@@ -0,0 +1,15 @@
+<domain type='vmware'>
+ <name>serial-network</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <serial type='tcp'>
+ <source mode="bind" host="0.0.0.0" service="42001"/>
+ <protocol type="tls"/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index 2a457b4..0881ae9 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -259,6 +259,8 @@ mymain(int argc, char **argv)
DO_TEST("serial-file", "serial-file", esxVI_ProductVersion_ESX35);
DO_TEST("serial-device", "serial-device", esxVI_ProductVersion_ESX35);
DO_TEST("serial-pipe", "serial-pipe", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-network-server", "serial-network-server", esxVI_ProductVersion_ESX41);
+ DO_TEST("serial-network-client", "serial-network-client", esxVI_ProductVersion_ESX41);
DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35);
DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35);
--
1.7.0.4
14 years, 1 month
[libvirt] cpulimit and kvm process
by Mihamina Rakotomandimby
Manao ahoana, Hello, Bonjour,
I would like to launch several KVM guests on a multicore CPU.
The number of the KVM process is over the number of physical cores.
I would like to limit each KVM process to say... 10% of CPU
I first use "cpulimit "
Would you know some better way to limit them? it's in order to avoid 4
VM to hog all the 4 hardware cores.
I also use all the livbirt tools, if there si any sol
Misaotra, Thanks, Merci.
--
Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche & Developpement
+261 34 56 000 19
14 years, 1 month
[libvirt] Ejecting ISO from cdrom
by Jaromír Červenka
Hello,
how can I remove ISO image from cdrom in running domain, please? I tried
procedure which is described on your wiki (
http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#eject_DEV) but it doesn't
work for me:
divinus:/kvm/iso # virsh attach-disk --type cdrom --mode readonly
leon.i-tux.cz "" hdc
error: command 'attach-disk' requires <target> option
divinus:/kvm/iso # virsh attach-disk --type cdrom --mode readonly
leon.i-tux.cz "" --target hdc
error: command 'attach-disk' requires <source> option
divinus:/kvm/iso # virsh attach-disk --type cdrom --mode readonly
leon.i-tux.cz --source "" --target hdc
error: expected syntax: --source <string>
Thank you,
Jaromír Červenka
14 years, 1 month