IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
A timeout in the send request part of dump_virtio_metrics()
should prevent the send from looping forever. Also change the
existing 30 second timeout value to a more reasonable value of
5 seconds.
We can't rely on d_type == DT_DIR because on some filesystems
d_type is not supported. A check for domain-ID-NAME/org.github.vhostmd.1
should be sufficient.
The README already states that all correspondence for vhostmd
should take place on the virt-tools-list. Change the bug-report
email in AC_INIT to match.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
At the vhostmd side virtio channels are Unix domain sockets from QEMU
which are created during a VM start and removed when the VM is stopped.
Basically this implementation
- monitors a directory for new virtio channels
- for valid IDs, also known by libvirtd, it connects to the UDS
- buffers VM/HOST metrics and handles request/response on the sockets
It provides the functions
virtio_init()
init function of virtio layer
virtio_run()
the start_routine for the virtio-thread to handle the virtio based
communication
virtio_metrics_update()
called for each VM/HOST metrics update to update the virtio internal
metrics buffer.
virtio_stop()
stop the virtio-thread
Vhostmd uses the update_interval value to sleep() between the metrics updates.
But a long runtime of the metrics updates can result in a noticeable longer
time between the updates and a consumer might read 'old' data after waiting
update_interval seconds.
Fix the delay between updates, that
'runtime of metrics update' + 'sleep time' matches the update_interval value.
buffer_grow uses realloc to extend the buffer, due to the fact that
realloc doesn't guarantee that allocated memory is initialized there
should be a memset.
The use of WITH_XENSTORE in vm-dump-metrics is clumbsy in some
cases and flat out wrong in others. E.g. if WITH_XENSTORE is not
defined then vbd transport is excluded as an option for retrieving
the metrics. Improve use of WITH_XENSTORE and fix the broken logic.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
The formatting in the usage function of vm-dump-metrics used a
lot of spaces for whitespace. Replace some occurrences with tabs
and remove others that were causing ugly formatting of help.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Although the upstream vhostmd config file serves primarily as an
example, it should at least work and not unconditionally call
commands that no longer exist.
While at it, improve the comments describing the <action> element.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
The logic introduced in commit d1276646to check for init script type is
a bit flawed. If the init script type is specified, init_systemv is
always set to 'yes', even when '--with-init-script=systemd'. Split the
logic to only check for init script type when '--with-init-script=check'.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
vhostmd has no signal handler for SIGPIPE and a restart of libvirtd results in
a stopped vhostmd. The root cause seems to be a UDS socket between vhostmd and
libvirtd which is closed by a libvirtd restart.
In addition to the signal handler the connection to libvirtd has to be opened
again otherwise vhostmd can't read any data from libvirtd and doesn't update
the metrics.
The xenstore transport is worth keeping, so update it to
work with "modern" Xen. By modern I mean something like 4.4
or newer.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Old, crufty code that no longer compiles and should be
removed from the sources. libvirt or custom "actions"
should be used to gather metrics.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
The xenctrl interface has changed over the years, causing
the associated code in vhostmd to no longer compile. Instead
of trying to get this low-level xen interface working again,
simply remove it from vhostmd. libvirt or custom "actions"
should be used to gather metrics.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
vhostmd is long overdue for a systemd service file. Add one, and
while at it support specifying the type of init system in the
configure script.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Some of the constructs used in the configure script and Makefiles
are a bit outdated, e.g. use of '$(mkinstalldirs)' instead of
'$(MKDIR_P)'. Change these old constructs to their modern counterparts.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
The default behavior in the configure script was to make with_xenstore
set to 'true', which caused the compilation to break in my case because
I don't have xen libraries, therefore, xs.h
Now the default behavior is set according to its existence or not. Same
thing for xenstat and xenctrl.
Signed-off-by: Eduardo Otubo <eduardo.otubo@gmail.com>
If private function 'get_mdef' returns an error, then the error is not
propagated back to the user because it gets lost in 'get_metric'. Fix
this by initializing 'ret' correctly.
Multiple fixes in this function:
- use 'ret' as intended -- to set the return code
- jump to 'out' label on error paths
- you don't need to test if a variable is not NULL before calling free
- fp == stdout, not stderr, so we don't close stdout(!)
- formatting
Hi all,
The attached patch against v0.4 fixes the build when --enable-xenctrl is used.
If this configure option is used vhostmd does not link against libvirt or
virt-util.o, but a few bits of code were assuming that these were always linked in.
Please could you consider this patch for inclusion in the vhostmd project.
Regards,
Alex Zeffertt
Fix build when "./configure --enable-xenctrl" is used.
This option disables the use of libvirt. Instead libxc gets used to
find out stuff about VMs.
If this option is used then virt-util.c does not get built. This
patch removes the linker dependencies on virt-util.o when
--enable-xenctrl is used.
Signed-off-by: <alex.zeffertt@eu.citrix.com>
This avoid the following error:
test/Makefile.am:17: compiling `main.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
Since this will create scripts like ./compile, ./depcomp etc we
also need to add those to the .gitignore file.
After applying this patch you may need to rerun 'autoreconf -i'.
Running vm-dump-metrics when there is no metrics disk *and*
no Xen / Xenstore, causes a segmentation fault because of an
unchecked call to xs_domain_open.
Reported to Red Hat as:
https://bugzilla.redhat.com/show_bug.cgi?id=529348
Allow CONNECT to be substituted in any <action>s in order to
pass the correct libvirt URI down to actions such as virsh. The
correct way to run virsh is now:
virsh -r CONNECT cmd [...]
which substitutes as either:
virsh -r --connect 'uri' cmd [...]
or:
virsh -r cmd [...]
Note that you should always run virsh readonly (-r option).
Also corrects the documentation: ID should be VMID.
Also this cleans up the string replacement code and ensures that
it doesn't leak memory on failure.