[Libvir] [PATCH] Block device and network stats (version 2)
by Richard W.M. Jones
This patch adds block device and network stats. The main changes over
the previous version are:
* Remote support.
* Change Xen network interface names to have the form "vif<domid>.<n>"[1].
Discussions about the previous version may be found starting here:
https://www.redhat.com/archives/libvir-list/2007-August/thread.html#00064
I have left use of stdint.h / int64_t, since it wasn't clear to me what
conclusion people had arrived at.
I left the explicit structure size parameter to allow for future
extensibility.
Also attached is the output of:
virsh -c xen+tls://amd/ domifstat fc6_1 vif2.0
Rich.
[1] There is currently no way to get the interface name except to just
know it -- that is the subject of a separate patch.
--
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
libvirt: virConnectOpen (name=xen+tls://amd/)
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: do_open: proceeding with name=xen+tls://amd/
libvirt: do_open: trying driver 0 (Test) ...
libvirt: do_open: driver 0 Test returned DECLINED
libvirt: do_open: trying driver 1 (QEMU) ...
libvirt: do_open: driver 1 QEMU returned DECLINED
libvirt: do_open: trying driver 2 (Xen) ...
libvirt: do_open: driver 2 Xen returned DECLINED
libvirt: do_open: trying driver 3 (remote) ...
libvirt: do_open: driver 3 remote returned SUCCESS
libvirt: do_open: network driver 0 Test returned DECLINED
libvirt: do_open: network driver 1 QEMU returned DECLINED
libvirt: do_open: network driver 2 remote returned SUCCESS
libvirt: virDomainLookupByName (conn=0x130ee020, name=fc6_1)
libvirt: virDomainInterfaceStats (domain=0x13129bd0, path=vif2.0, stats=0x7fff688e6e20, size=64)
libvirt: virDomainFree (domain=0x13129bd0)
libvirt: virConnectClose (conn=0x130ee020)
vif2.0 rx_bytes 18591
vif2.0 rx_packets 113
vif2.0 rx_errs 0
vif2.0 rx_drop 0
vif2.0 tx_bytes 125319
vif2.0 tx_packets 962
vif2.0 tx_errs 0
vif2.0 tx_drop 0
17 years, 3 months
[Libvir] [PATCH] Fix return value of virsh vncdisplay
by Masayuki Sunou
Hi
Virsh vncdisplay always returns 1,
because return value is not set in the case of normal end.
------------------------------------
# virsh vncdisplay test
:0
# echo $?
1
------------------------------------
This patch fixes it.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
----------------------------------------------------------------------
Index: libvirt/src/virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.100
diff -u -p -r1.100 virsh.c
--- libvirt/src/virsh.c 21 Aug 2007 11:53:52 -0000 1.100
+++ libvirt/src/virsh.c 28 Aug 2007 06:33:03 -0000
@@ -2919,6 +2919,7 @@ cmdVNCDisplay(vshControl * ctl, vshCmd *
}
xmlXPathFreeObject(obj);
obj = NULL;
+ ret = TRUE;
cleanup:
if (obj)
----------------------------------------------------------------------
17 years, 3 months
[Libvir] [PATCH] Delete a harmful variable in xend_parse_sexp_desc()
by Masayuki Sunou
Hi
Xend_parse_sexp_desc() of xend_internal.c declares a variable named
"ret" to buffer SXP.
However, it actually uses "buf.content" not "ret" and allocates memory
to "buf" when size of "ret" became insufficient.
--> virBufferAdd(&buf, ...);, virBufferVSprintf(&buf, ...)
So freeing "ret" fails, because "ret" refers to an address unlike "buf.contents"
As a result, a segmentation fault occurs.
This patch fixes so that xend_parse_sexp_desc() uses "buf.contents" not "ret".
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
--------------------------------------------------------------------------------
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.135
diff -u -p -r1.135 xend_internal.c
--- src/xend_internal.c 21 Aug 2007 09:31:12 -0000 1.135
+++ src/xend_internal.c 27 Aug 2007 07:47:03 -0000
@@ -1346,7 +1346,6 @@ xend_parse_sexp_desc_os(virConnectPtr xe
static char *
xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersion)
{
- char *ret;
struct sexpr *cur, *node;
const char *tmp;
char *tty;
@@ -1362,10 +1361,9 @@ xend_parse_sexp_desc(virConnectPtr conn,
/* ERROR */
return (NULL);
}
- ret = malloc(4000);
- if (ret == NULL)
+ buf.content = malloc(4000);
+ if (buf.content == NULL)
return (NULL);
- buf.content = ret;
buf.size = 4000;
buf.use = 0;
@@ -1762,11 +1760,11 @@ xend_parse_sexp_desc(virConnectPtr conn,
virBufferAdd(&buf, "</domain>\n", 10);
buf.content[buf.use] = 0;
- return (ret);
+ return (buf.content);
error:
- if (ret != NULL)
- free(ret);
+ if (buf.content != NULL)
+ free(buf.content);
return (NULL);
}
--------------------------------------------------------------------------------
17 years, 3 months
[Libvir] OpenVZ driver enhancements
by Shuveb Hussain
Hi,
I'm glad to make available patches for the OpenVZ driver that provide
the following features:
* virDomainDefineXML - Defines an OpenVZ domain and does not start it.
Takes XML description of the domain as input.
* virDomainCreateLinux - Starts a domain based on the provided XML
description. There is no way to start a domain in OpenVZ without
defining it. So, it is defined anyway, as of now. :-( There may be a way
to get around this. We are looking into it. As of now, treat this as
define + start.
* virDomainUndefine - removes domain from OpenVZ management. Since
OpenVZ manages the domain's root file system, it is also lost. This
behaviour is different from Xen.
The XML Format for OpenVZ:
--------------------------
<domain type='openvz'>
<name>108</name>
<uuid>8dea22b31d52d8f32516782e98ab8fa0</uuid>
<container>
<filesystem>
<template>fedora-core-3-i386-minimal</template>
<quota level = 'first'>123</quota>
<quota level = 'second' uid = '500'>534</quota>
</filesystem>
<network>
<ipaddress>192.168.1.108</ipaddress>
<hostname>fedora-minimal</hostname>
<gateway>192.168.1.1</gateway>
<nameserver>192.168.1.1</nameserver>
<netmask>255.255.255.0</netmask>
</network>
<profile>vps.basic</profile>
</container>
</domain>
The name is the VPS "ID". The VPS ID is not temporary in OpenVZ as in
Xen. The "<template>" tag in the "<filesystem>" section tells libvirt
which OS template cache to use to create the VPS file system. Quota is
not implemented as yet. First and second level quotas are intended to be
supported. The "<profile>" tag must be a valid profile name from which
VPS parameter are inherited. Other things, I guess are self explanatory.
Other issues:
-------------
* Moved some static declarations from the header to the .c files.
* Fixed a small bug that cause libvirtd to crash on remote client exit.
Patches are against CVS head.
Regards,
--
Shuveb Hussain
Unix is very user friendly. It is just a
little choosy about who its friends are
http://www.binarykarma.com
17 years, 3 months
[Libvir] Libvirt with Gentoo and Udev
by Stefan Bottelier
Hello,
I have the follow problem with libvirt and Gentoo.
I will be use virt-manager for my xen server on my Gentoo machine, zo i
have libvirt afcors to use.
virt-manager are in the portage of Gentoo.
When i start libvirt i get the follow message.
libvir: QEMU error : failed to set bridge STP to on
Failed to autostart network 'default': failed to set bridge STP to on
So i watch in my /var/log/messages for the error.
I see the follow
Aug 20 17:51:04 localhost udev-net.sh: /etc/init.d/net.vnet0: does not
exist or is not executable
So i create the vnet0 bridge interface in gentoo.
Then i will restart libvirt.
I see in /var/log/messages the follow error
rc-scripts: We only hotplug for ethernet interfaces
if its possibale to run udev and gentoo with libvirt? Or is zombie the
can help me with this problem of if this working on Gentoo ?
Thanks ,
Stefan
P.s the option of /etc/init.d/net.vnet0 start --verbose will not be
working,
http://forums.gentoo.org/viewtopic-t-577325.html
17 years, 3 months
[Libvir] Release of libvirt-0.3.2
by Daniel Veillard
No releases for nearly a month, it was time to push a new one, so
0.3.2 is available from :
ftp://libvirt.org/libvirt/
There is more changes that I initially though. I will probably make
a new release within a week to update things which were left out from
0.3.2,
* New features:
- KVM migration and save/restore (Jim Paris)
- added API for migration (Richard Jones)
- added APIs for block device and interface statistic (Richard Jones).
* Documentation:
- examples for XML network APIs
- fix typo and schedinfo synopsis in man page (Atsushi SAKAI)
- hypervisor support page update (Richard Jones).
* Bug fixes:
- remove a couple of leaks in QEmu/KVM backend(Daniel berrange)
- fix GnuTLS 1.0 compatibility (Richard Jones)
- --config/-f option mistake for libvirtd (Richard Jones)
- remove leak in QEmu backend (Jim Paris)
- fix some QEmu communication bugs (Jim Paris)
- UUID lookup though proxy fix
- setvcpus checking bugs (with Atsushi SAKAI)
- int checking in virsh parameters (with Masayuki Sunou)
- deny devices attach/detach for < Xen 3.0.4 (Masayuki Sunou)
- XenStore query memory leak (Masayuki Sunou)
- virsh schedinfo cleanup (Saori Fukuta).
* Improvement:
- virsh new ttyconsole command
- networking API implementation for test driver (Daniel berrange)
- qemu/kvm feature reporting of ACPI/APIC (David Lutterkort)
- checking of QEmu architectures (Daniel berrange)
- improve devices XML errors reporting (Masayuki Sunou)
- speedup of domain queries on Xen (Daniel berrange)
- augment XML dumps with interface devices names (Richard Jones)
- internal API to query drivers for features (Richard Jones).
* Cleanups:
- Improve virNodeGetInfo implementation (Daniel berrange)
- general UUID code cleanup (Daniel berrange)
- fix API generator file selection.
thanks to everybody who helped contribute to this new release with
ideas, reports or patches !
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
17 years, 3 months
[Libvir] [PATCH] Show Xen vif<domid>.<n> device name in domain XML
by Richard W.M. Jones
This patch changes the Xen domain XML so that it shows the target device
(ie. vif<domid>.<n>), which you can then use to collect interface stats.
For example:
# virsh dumpxml fc6_1
...
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif2.0'/>
<mac address='00:16:3e:1a:2f:8c'/>
<script path='vif-bridge'/>
</interface>
Note that this patch only adds to the XML, it doesn't change any XML
that was being returned before.
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, 3 months
[Libvir] [PATCH] Cleanup xs_internal.c
by Masayuki Sunou
Hi
Blanks and Tabs coexist in xs_internal.c.
This patch replaces a tab by blanks in xs_internal.c.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
17 years, 3 months
[Libvir] [PATCH] Update hvsupport page
by Richard W.M. Jones
The three independent patches attached update the hvsupport page:
(1) Document that KVM now supports save & restore. [Q: This is just
kvm, or any qemu?]
(2) Document the introduction of virDomainMigrate call.
(3) Document the introduction of virDomainBlockStats and
virDomainInterfaceStats calls.
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, 3 months