vhostmd:vhostmd.git
10 years agoSecurity: Set supplemental groups correctly when dropping privileges.
Richard W.M. Jones [Mon, 5 Mar 2012 14:48:08 +0000 (14:48 +0000)]
Security: Set supplemental groups correctly when dropping privileges.

https://bugzilla.redhat.com/show_bug.cgi?id=741289

(Thanks to Steve Grubb for finding the bug and suggesting a fix)

10 years agoVersion 0.5. 0.5
Richard W.M. Jones [Mon, 16 Jan 2012 14:30:21 +0000 (14:30 +0000)]
Version 0.5.

10 years agoFix signed/unsigned comparison problems.
Richard W.M. Jones [Mon, 16 Jan 2012 12:15:16 +0000 (12:15 +0000)]
Fix signed/unsigned comparison problems.

10 years agodump_xenstore_metrics: Refactor this function.
Richard W.M. Jones [Mon, 16 Jan 2012 12:10:37 +0000 (12:10 +0000)]
dump_xenstore_metrics: Refactor this function.

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

10 years agoMark unused parameters with ATTRIBUTE_UNUSED.
Richard W.M. Jones [Mon, 16 Jan 2012 12:09:21 +0000 (12:09 +0000)]
Mark unused parameters with ATTRIBUTE_UNUSED.

This macro is defined for gcc so that unused parameters don't
provoke warnings.

10 years agoconfigure: If using --enable-debug, enable -Wextra (extra warnings).
Richard W.M. Jones [Mon, 16 Jan 2012 12:08:18 +0000 (12:08 +0000)]
configure: If using --enable-debug, enable -Wextra (extra warnings).

10 years agotests: Link with -dl.
Richard W.M. Jones [Mon, 16 Jan 2012 12:07:48 +0000 (12:07 +0000)]
tests: Link with -dl.

The tests use dl* functions, so this library is required.

12 years agoFix build when './configure --enable-xenctrl' is used
Alex Zeffertt [Thu, 7 Jan 2010 14:34:19 +0000 (14:34 +0000)]
Fix build when './configure --enable-xenctrl' is used

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>
12 years agoVersion 0.4. 0.4
Richard Jones [Thu, 15 Oct 2009 13:03:59 +0000 (14:03 +0100)]
Version 0.4.

12 years agoconfigure.ac: Fix C compiler detection to be compatible with automake.
Richard Jones [Wed, 9 Dec 2009 14:37:53 +0000 (14:37 +0000)]
configure.ac: Fix C compiler detection to be compatible with automake.

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'.

12 years agochdir ("/") when daemonizing self.
Richard Jones [Wed, 9 Dec 2009 14:29:49 +0000 (14:29 +0000)]
chdir ("/") when daemonizing self.

12 years agovm-dump-metrics: On error, exit with status code 1.
Richard Jones [Fri, 16 Oct 2009 12:55:02 +0000 (13:55 +0100)]
vm-dump-metrics: On error, exit with status code 1.

Make vm-dump-metrics exit with an error status code of 1 if
it fails, so that we can detect this failure from scripts etc.

12 years agovm-dump-metrics: Fix segmentation fault if Xenstore does not exist.
Richard Jones [Fri, 16 Oct 2009 12:53:08 +0000 (13:53 +0100)]
vm-dump-metrics: Fix segmentation fault if Xenstore does not exist.

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

12 years agoAdd CONNECT substitution <action>s.
Richard Jones [Thu, 15 Oct 2009 12:10:18 +0000 (13:10 +0100)]
Add CONNECT substitution <action>s.

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.

12 years agoAdd '-c uri' command line option to specify libvirt connection URI.
Richard Jones [Thu, 15 Oct 2009 11:27:52 +0000 (12:27 +0100)]
Add '-c uri' command line option to specify libvirt connection URI.

12 years agoAdd '-u user' command line option to drop root privs.
Richard Jones [Thu, 15 Oct 2009 11:10:15 +0000 (12:10 +0100)]
Add '-u user' command line option to drop root privs.

If vhostmd is run as root, you can now use the '-u user'
command line option to drop root privs and run as 'user'
instead.

12 years agoAlways connect to libvirt read-only.
Richard Jones [Thu, 15 Oct 2009 11:30:34 +0000 (12:30 +0100)]
Always connect to libvirt read-only.

We should never be modifying domains, so there should never
be a need to make a writable connection to libvirt.

This also tidies up the connection code into a single function.

12 years agoClean up VM metrics error message.
Richard Jones [Thu, 15 Oct 2009 12:09:17 +0000 (13:09 +0100)]
Clean up VM metrics error message.

Don't print "Failed to collect vm metrics during update" unless
there was an actual error collecting VM metrics.  There being
no running domains is not an error.

12 years agoAllow gcc to check calls to vu_log* printf-like functions.
Richard Jones [Thu, 15 Oct 2009 11:18:34 +0000 (12:18 +0100)]
Allow gcc to check calls to vu_log* printf-like functions.

12 years agoautotools: Use AC_GNU_SOURCE and config.h
Richard Jones [Thu, 15 Oct 2009 10:05:28 +0000 (11:05 +0100)]
autotools: Use AC_GNU_SOURCE and config.h

Use AC_GNU_SOURCE instead of coding -D_GNU_SOURCE directly.

All C files should include <config.h> as the first line (before
any other includes or defines).

12 years agoFurther changes to avoid using xenstore.
Richard Jones [Tue, 13 Oct 2009 10:18:49 +0000 (11:18 +0100)]
Further changes to avoid using xenstore.

We missed two more places where libxenstore is used.  This commit
changes the Makefiles to not link to xenstore when --without-xenstore
is given.

12 years agoAllow xenstore dependency to be removed using ./configure --without-xenstore.
Richard Jones [Mon, 12 Oct 2009 16:27:01 +0000 (17:27 +0100)]
Allow xenstore dependency to be removed using ./configure --without-xenstore.

If ./configure --without-xenstore, then the dependency on
xenstore is removed.  Attempts to use xenstore will result
in a runtime error.

The default is still that xenstore is enabled.

12 years agoconfigure: Fix '--with{,out}-xenstore' option.
Richard Jones [Mon, 12 Oct 2009 16:14:57 +0000 (17:14 +0100)]
configure: Fix '--with{,out}-xenstore' option.

12 years agoVersion 0.3
Richard Jones [Thu, 8 Oct 2009 15:05:31 +0000 (16:05 +0100)]
Version 0.3

12 years agoAdd me to AUTHORS file.
Richard Jones [Wed, 7 Oct 2009 11:15:33 +0000 (12:15 +0100)]
Add me to AUTHORS file.

12 years agoOpen metrics disk with O_DIRECT.
Richard Jones [Wed, 7 Oct 2009 10:03:23 +0000 (11:03 +0100)]
Open metrics disk with O_DIRECT.

Opening with O_DIRECT avoids having the guest kernel cache old
copies of the metrics data.

12 years agoDocument how to configure a domain with 'virsh edit'
Richard Jones [Wed, 7 Oct 2009 09:51:26 +0000 (10:51 +0100)]
Document how to configure a domain with 'virsh edit'

12 years agoMake the default disk be /dev/shm/vhostmd0.
Richard Jones [Wed, 7 Oct 2009 09:49:02 +0000 (10:49 +0100)]
Make the default disk be /dev/shm/vhostmd0.

Previously we used a subdirectory (/dev/shm/vhostmd/).  However
the permissions on the subdirectory had to be set by hand by the
system administrator, and if the sysadmin didn't set them, then
libvirt would fail to start the guest.

However by just putting the metrics disk into /dev/shm directly,
the permissions can be controlled by vhostmd when it creates the
device.

Not having the subdirectory is also simpler.

12 years agoAdd .gitignore file to ignore generated files.
Richard Jones [Fri, 14 Aug 2009 08:38:33 +0000 (09:38 +0100)]
Add .gitignore file to ignore generated files.

12 years agoInitial import of vhostmd project
Jim Fehlig [Thu, 13 Aug 2009 16:58:45 +0000 (10:58 -0600)]
Initial import of vhostmd project