]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 years agovirsh: improve help text where integers are expected
Eric Blake [Tue, 19 Oct 2010 16:27:02 +0000 (10:27 -0600)]
virsh: improve help text where integers are expected

* tools/virsh.c (opts_freecell, opts_memtune, opts_vcpupin)
(opts_setvcpus, opts_setmaxmem, opts_setmem)
(opts_migrate_setmaxdowntime): Use VSH_OT_INT when only an integer
is expected.
(vshCmddefHelp, vshCmddefGetData): Allow mandatory VSH_OT_INT
arguments.

14 years agoqemu: work around dash 0.5.5 bug in managed save
Eric Blake [Fri, 22 Oct 2010 23:26:08 +0000 (17:26 -0600)]
qemu: work around dash 0.5.5 bug in managed save

Older dash mistakenly truncates regular files when using <> redirection;
this kills our use of double dd to reduce storage overhead when
saving qemu images.  But qemu insists on running a command through
/bin/sh, so we work around it by having qemu run $sh -c 'real command'
when we have a replacement $sh in mind.

* configure.ac (VIR_WRAPPER_SHELL): Define to a replacement shell,
if /bin/sh is broken on <> redirection.
* src/qemu/qemu_monitor.h (VIR_WRAPPER_SHELL_PREFIX)
(VIR_WRAPPER_SHELL_SUFFIX): New macros.
* src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
them.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
Likewise.

14 years agodocs: make the location of the xml catalog file a configure option
Justin Clift [Tue, 26 Oct 2010 15:07:00 +0000 (02:07 +1100)]
docs: make the location of the xml catalog file a configure option

The default location for the XML catalog file, /etc/xml/catalog,
used when validating the generated html docs, isn't correct for
MacOS X.

This commit adds an option to the configure script, allowing the
default to be overridden:

  --with-xml-catalog-file=/path/to/xml/catalog/file

14 years agoAvoid squashing errors during network startup cleanup path
Daniel P. Berrange [Tue, 26 Oct 2010 10:17:25 +0000 (11:17 +0100)]
Avoid squashing errors during network startup cleanup path

When failing to start a virtual network, we have to cleanup,
tearing down any iptables rules. If the iptables rules were
not present yet though, this raises an error, which squashes
the original error we were handling.

* src/network/bridge_driver.c: When failing to start a virtual
  network, don't squash the original error in cleanup

14 years agodocs: install the generated html files when make install is run
Justin Clift [Tue, 26 Oct 2010 14:34:33 +0000 (01:34 +1100)]
docs: install the generated html files when make install is run

Previously, only the API docs were installed, rather than the
complete documentation set.  This commit ensures the complete
documentation set is installed.

14 years agoFix build for SystemTap 1.0
Matthias Bolte [Fri, 22 Oct 2010 21:36:42 +0000 (23:36 +0200)]
Fix build for SystemTap 1.0

With SystemTap 1.0 a part of the generated macros in probes.h
expands to:

volatile __typeof__(((name))) arg2 = (name);

GCC reports an 'invalid initialize' error when name has type
char[]. Therfore, add casts to char* to avoid this.

14 years agoxen: Fix domain dump
Jiri Denemark [Tue, 26 Oct 2010 09:54:38 +0000 (11:54 +0200)]
xen: Fix domain dump

Remove redundant 'live' parameter which caused an error from xend:

    "xend.err 'Too many values for live'"

14 years agoFix formatting of network address in iptables helpers
Daniel P. Berrange [Mon, 25 Oct 2010 14:10:33 +0000 (15:10 +0100)]
Fix formatting of network address in iptables helpers

The network address was being set to 192.168.122.0 instead
of 192.168.122.0/24. Fix this by removing the unneccessary
'network' field from virNetworkDef and just pass the
network address and netmask into the iptables APIs directly.

* src/conf/network_conf.h, src/conf/network_conf.c: Remove
  the 'network' field from virNEtworkDef.
* src/network/bridge_driver.c: Update for iptables API changes
* src/util/iptables.c, src/util/iptables.h: Require the
  network address + netmask pair to be passed in

14 years agovirsh: Add option 'model' for attach-interface
Osier Yang [Tue, 26 Oct 2010 08:34:31 +0000 (10:34 +0200)]
virsh: Add option 'model' for attach-interface

* tools/virsh.c: add missing option from the CLI to allows setting
  up the NIC model type when attaching an interface
* tools/virsh.pod: extend documentation
* AUTHORS: add Osier Yang to the list

14 years agoqemu: Fix detection of drive readonly option
Jiri Denemark [Fri, 22 Oct 2010 16:02:31 +0000 (18:02 +0200)]
qemu: Fix detection of drive readonly option

So far, readonly=on option is used when qemu supports -device. However,
there are qemu versions which support readonly option with -drive
although they don't have support for -device.

14 years agoFix documentation for virEventAddTimeout()
Philipp Hahn [Tue, 26 Oct 2010 08:23:03 +0000 (10:23 +0200)]
Fix documentation for virEventAddTimeout()

* src/util/event.h: Fix copy&paste error from virEventAddHandle()

14 years agomaint: ignore new test executable
Eric Blake [Fri, 22 Oct 2010 17:26:25 +0000 (11:26 -0600)]
maint: ignore new test executable

* tests/.gitignore: Sort, and add sockettest.

14 years agodaemon: updates previous 1 line patch for correctness
Justin Clift [Fri, 22 Oct 2010 22:19:15 +0000 (09:19 +1100)]
daemon: updates previous 1 line patch for correctness

The previous commit, 880da47a05b9fb8381e79b03ead5dd2d8a6a937a,
worked on my system, but wasn't actually correct.  This follow
up patch corrects it properly.

14 years agodaemon: exclude requirement for probes.h on systems without systemtap
Justin Clift [Fri, 22 Oct 2010 20:52:18 +0000 (07:52 +1100)]
daemon: exclude requirement for probes.h on systems without systemtap

This 1-liner was actually written by Eric Blake, over IRC. It
addresses a compilation failure in make dist and make rpm for
systems without the dtrace/systemtap development libraries
installed.

14 years agoesx: Add documentation about certificates and connection problems
Matthias Bolte [Fri, 22 Oct 2010 13:01:21 +0000 (15:01 +0200)]
esx: Add documentation about certificates and connection problems

14 years agotests: Silence qemuxml2argv test
Jiri Denemark [Fri, 22 Oct 2010 16:50:34 +0000 (18:50 +0200)]
tests: Silence qemuxml2argv test

14 years agodnsmasq: avoid potential crash
Eric Blake [Fri, 22 Oct 2010 16:22:20 +0000 (10:22 -0600)]
dnsmasq: avoid potential crash

* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized
memory on allocation failure.

14 years agodocs: added a table of contents to the new c sharp bindings page
Justin Clift [Fri, 22 Oct 2010 06:24:02 +0000 (17:24 +1100)]
docs: added a table of contents to the new c sharp bindings page

14 years agodocs: removed old changelog file, as it is no longer relevant
Justin Clift [Fri, 22 Oct 2010 05:50:27 +0000 (16:50 +1100)]
docs: removed old changelog file, as it is no longer relevant

We instead point to the live git log URL for the few links still
needing to point to something.

14 years agovbox: Fix compile errors due to the virSocketAddr series
Matthias Bolte [Fri, 22 Oct 2010 12:21:31 +0000 (14:21 +0200)]
vbox: Fix compile errors due to the virSocketAddr series

14 years agoDon't try to parse a NULL ip address for boot server
Daniel P. Berrange [Fri, 22 Oct 2010 12:28:04 +0000 (13:28 +0100)]
Don't try to parse a NULL ip address for boot server

The boot server IP address is optional, so it needs to be
checked before attempting to parse it.

* src/conf/network_conf.c: Don't parse NULL ip address for
  boot server

14 years agoConvert virNetwork to use virSocketAddr everywhere
Daniel P. Berrange [Thu, 21 Oct 2010 12:14:33 +0000 (13:14 +0100)]
Convert virNetwork to use virSocketAddr everywhere

Instead of storing the IP address string in virNetwork related
structs, store the parsed virSocketAddr. This will make it
easier to add IPv6 support in the future, by letting driver
code directly check what address family is present

* src/conf/network_conf.c, src/conf/network_conf.h,
  src/network/bridge_driver.c: Convert to use virSocketAddr
  in virNetwork, instead of char *.
* src/util/bridge.c, src/util/bridge.h,
  src/util/dnsmasq.c, src/util/dnsmasq.h,
  src/util/iptables.c, src/util/iptables.h: Convert to
  take a virSocketAddr instead of char * for any IP
  address parameters
* src/util/network.h: Add macros to determine if an address
  is set, and what address family is set.

14 years agoInclude socket address in client probe data
Daniel P. Berrange [Thu, 21 Oct 2010 14:45:12 +0000 (15:45 +0100)]
Include socket address in client probe data

It is useful to know where the client is connecting from,
so include the socket address in probe data.

* daemon/libvirtd.h: Use virSocketAddr for storing client
  address and keep printable address handy for logging
* daemon/libvirtd.c: Include socket address in client
  connect/disconnect probes
* daemon/probes.d: Add socket address to probes
* examples/systemtap/client.stp: Print socket address
* src/util/network.h: Add sockaddr_un to virSocketAddr union

14 years agoAdd dtrace static probes in libvirtd
Daniel P. Berrange [Tue, 14 Sep 2010 16:30:32 +0000 (17:30 +0100)]
Add dtrace static probes in libvirtd

Adds initial support for dtrace static probes in libvirtd
daemon, assuming use of systemtap dtrace compat shim on
Linux. The probes are inserted for network client connect,
disconnect, TLS handshake states and authentication protocol
states.

This can be tested by running the xample program and then
attempting to connect with any libvirt client (virsh,
virt-manager, etc).

 # stap examples/systemtap/client.stp
  Client fd=44 connected readonly=0
  Client fd=44 auth polkit deny pid:24997,uid:500
  Client fd=44 disconnected
  Client fd=46 connected readonly=1
  Client fd=46 auth sasl allow test
  Client fd=46 disconnected

The libvirtd.stp file should also really not be required,
since it is duplicated info that is already available in
the main probes.d definition file. A script to autogenerate
the .stp file is needed, either in libvirtd tree, or better
as part of systemtap itself.

* Makefile.am: Add examples/systemtap subdir
* autobuild.sh: Disable dtrace for mingw32
* configure.ac: Add check for dtrace
* daemon/.gitignore: Ignore generated dtrace probe file
* daemon/Makefile.am: Build dtrace probe header & object
  files
* daemon/libvirtd.stp: SystemTAP convenience probeset
* daemon/libvirtd.c: Add connect/disconnect & TLS probes
* daemon/remote.c: Add SASL and PolicyKit auth probes
* daemon/probes.d: Master probe definition
* daemon/libvirtd.h: Add convenience macro for probes
  so that compilation is a no-op when dtrace is not available
* examples/systemtap/Makefile.am, examples/systemtap/client.stp
  Example systemtap script using dtrace probe markers
* libvirt.spec.in: Enable dtrace on F13/RHEL6
* mingw32-libvirt.spec.in: Force disable dtrace

14 years agoAdd test suite for virSocket APIs
Daniel P. Berrange [Thu, 21 Oct 2010 18:11:50 +0000 (19:11 +0100)]
Add test suite for virSocket APIs

Add a test suite for check parsing, formatting, range calculation
and netmask checking APIs in virSocketAddr.

* tests/sockettest.c, tests/Makefile.am: Add new test case

14 years agoBan use of all inet_* functions
Daniel P. Berrange [Thu, 21 Oct 2010 10:15:16 +0000 (11:15 +0100)]
Ban use of all inet_* functions

All the inet_* functions can be replaced with calls to the
virSocket APIs. Since many of the inet_* funtions are unsafe,
and the remainder are obsolete, forbid all future use of them
in libvirt.

* Makefile.nonreentrant: Ban use of inet_*

14 years agoRemove all use of inet_pton and inet_ntop
Daniel P. Berrange [Thu, 21 Oct 2010 10:13:05 +0000 (11:13 +0100)]
Remove all use of inet_pton and inet_ntop

The  inet_pton and inet_ntop functions are obsolete, replaced
by getaddrinfo+getnameinfo with the AI_NUMERICHOST flag set.
These can be accessed via the virSocket APIs.

The bridge.c code had methods for fetching the IP address of
a bridge which used inet_ntop. Aside from the use of inet_ntop
these methods are broken, because a NIC can have multiple
addresses and this only returns one address. Since the methods
are never used, just remove them.

* src/conf/network_conf.c, src/nwfilter/nwfilter_learnipaddr.c:
  Replace inet_pton and inet_ntop with virSocket APIs
* src/util/bridge.c, src/util/bridge.h: Remove unused methods
  which called inet_ntop.

14 years agoRemove both addrToString methods
Daniel P. Berrange [Wed, 20 Oct 2010 16:29:56 +0000 (17:29 +0100)]
Remove both addrToString methods

The addrToString functionality is now available via the
virSocketFormatAddrFull method.

* daemon/remote.c, src/remote/remote_driver.c: Remove
  addrToString methods

14 years agoFix error reporting for virSocketParse
Daniel P. Berrange [Wed, 20 Oct 2010 14:20:37 +0000 (15:20 +0100)]
Fix error reporting for virSocketParse

The virSocketParse method was not doing any error reporting
which meant the true cause of the problem was lost. Remove
all error reporting from callers, and push it into virSocketParse

* src/util/network.c: Add error reporting to virSocketParse
* src/conf/domain_conf.c, src/conf/network_conf.c,
  src/network/bridge_driver.c: Remove error reporting in
  callers of virSocketParse

14 years agoExpand virSocketFormat to be more flexible
Daniel P. Berrange [Wed, 20 Oct 2010 14:13:00 +0000 (15:13 +0100)]
Expand virSocketFormat to be more flexible

The getnameinfo() function is more flexible than inet_ntop()
avoiding the need to if/else the code based on socket family.
Also make it support UNIX socket addrs and allow inclusion
of a port (service) address. Finally do proper error reporting
via normal APIs.

* src/conf/domain_conf.c, src/nwfilter/nwfilter_ebiptables_driver.c,
  src/qemu/qemu_conf.c: Fix error handling with virSocketFormat
* src/util/network.c: Rewrite virSocketFormat to use getnameinfo
  and cope with UNIX socket addrs.

14 years agoRemove pointless nwIPAddress struct & void *casts
Daniel P. Berrange [Wed, 20 Oct 2010 13:47:08 +0000 (14:47 +0100)]
Remove pointless nwIPAddress struct & void *casts

The nwIPAddress was simply a wrapper about virSocketAddr.
Just use the latter directly, removing all the extra field
de-references from code & helper APIs for parsing/formatting.

Also remove all the redundant casts from strong types to
void * and then immediately back to strong types.

* src/conf/nwfilter_conf.h: Remove nwIPAddress
* src/conf/nwfilter_conf.c, src/nwfilter/nwfilter_ebiptables_driver.c:
  Update to use virSocketAddr and remove void * casts.

14 years agoFix netmask checks for IPv6 in virSocketCheckNetmask
Daniel P. Berrange [Wed, 20 Oct 2010 13:28:55 +0000 (14:28 +0100)]
Fix netmask checks for IPv6 in virSocketCheckNetmask

There was a typo in the IPv6 path of virSocketCheckNetmask which
caused it to never execute.

* src/util/network.c: s/AF_INET/AF_INET6/ in virSocketCheckNetmask

14 years agoFix passing of address family to virSocketParseAddr
Daniel P. Berrange [Wed, 20 Oct 2010 13:26:30 +0000 (14:26 +0100)]
Fix passing of address family to virSocketParseAddr

The virSocketParseAddr function was accepting any AF_* constant
and using that to set the ai_flags field in struct addrinfo.
This is invalid, since address families must go in the ai_family
field of the struct.

* src/util/network.c: Fix handling of address family
* src/conf/network_conf.c, src/network/bridge_driver.c: Pass
  AF_UNSPEC instead of relying on it being 0.

14 years agoInclude length with virSocketAddr data
Daniel P. Berrange [Wed, 20 Oct 2010 13:21:15 +0000 (14:21 +0100)]
Include length with virSocketAddr data

Some operations on socket addresses need to know the length of
the sockaddr struct for the particular address family. This
info was being discarded when passing around virSocketAddr
instances. Turn it from a union into a struct containing
union+socklen_t fields, so length is always kept around.

* src/util/network.h: Add socklen_t field to virSocketAddr
* src/util/network.c, src/network/bridge_driver.c,
  src/conf/domain_conf.c: Update to take account of new
  struct definition.

14 years agoRemove useless code in error path of getnameinfo()
Daniel P. Berrange [Wed, 20 Oct 2010 12:53:27 +0000 (13:53 +0100)]
Remove useless code in error path of getnameinfo()

If getnameinfo() with NI_NUMERICHOST set fails, there are no
grounds to expect inet_ntop to succeed, since these calls
are functionally equivalent. Remove useless inet_ntop code
in the getnameinfo() error path.

* daemon/remote.c, src/remote/remote_driver.c: Remove
  calls to inet_ntop

14 years agomaint: sort private sym lists
Eric Blake [Wed, 20 Oct 2010 17:10:45 +0000 (11:10 -0600)]
maint: sort private sym lists

* src/libvirt_private.syms: Sort by header name, then within
header, and drop duplicate virNetworkDefParseNode,
virFileLinkPointsTo and virXPathBoolean.

14 years agoEnable JSON and netdev features in QEMU >= 0.13
Daniel P. Berrange [Wed, 20 Oct 2010 17:37:43 +0000 (18:37 +0100)]
Enable JSON and netdev features in QEMU >= 0.13

The QEMU 0.13 release is finally out and from testing in RHEL-6
we know that its JSON and netdev features are now good enough
for us to use by default.

* src/qemu/qemu_conf.c: Enable JSON + netdev for QEMU >= 0.13

14 years agoaudit: simplify declaration
Eric Blake [Wed, 20 Oct 2010 18:21:52 +0000 (12:21 -0600)]
audit: simplify declaration

* src/util/virtaudit.c (virAuditSend): one less ifdef, since gcc
does not care if an ATTRIBUTE_UNUSED var gets used in some paths.

14 years agoqemu: Exit on first error in qemuDomainGetMemoryParameters
Matthias Bolte [Wed, 20 Oct 2010 12:28:45 +0000 (14:28 +0200)]
qemu: Exit on first error in qemuDomainGetMemoryParameters

There is no point in trying to fill params beyond the first error,
because when qemuDomainGetMemoryParameters returns -1 then the caller
cannot detect which values in params are valid.

14 years agovirsh: Don't read nparams when virDomainGetMemoryParameters fails
Matthias Bolte [Wed, 20 Oct 2010 12:16:28 +0000 (14:16 +0200)]
virsh: Don't read nparams when virDomainGetMemoryParameters fails

Also exit early when nparams is 0.

14 years agoRename VIR_DOMAIN_SWAP_HARD_LIMIT to VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT
Matthias Bolte [Wed, 20 Oct 2010 11:52:48 +0000 (13:52 +0200)]
Rename VIR_DOMAIN_SWAP_HARD_LIMIT to VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT

To get them under the common VIR_DOMAIN_MEMORY_* prefix.

14 years agoFix formatting of the memtune XML element
Matthias Bolte [Wed, 20 Oct 2010 11:22:40 +0000 (13:22 +0200)]
Fix formatting of the memtune XML element

Also output the min_guarantee element when set.

14 years agoFix make check on RHEL-5
Jiri Denemark [Wed, 20 Oct 2010 14:14:18 +0000 (16:14 +0200)]
Fix make check on RHEL-5

The test for <vcpu> element is unrelated to vnc so the easiest fix is to
remove related configuration.

14 years agoDon't let daemon-conf test fail when auditing is disabled
Matthias Bolte [Tue, 19 Oct 2010 18:27:51 +0000 (20:27 +0200)]
Don't let daemon-conf test fail when auditing is disabled

14 years agoUpdate comments for the memory tunables macros
Nikunj A. Dadhania [Wed, 20 Oct 2010 09:38:39 +0000 (11:38 +0200)]
Update comments for the memory tunables macros

* include/libvirt/libvirt.h.in: Update comment with actual description

14 years agoAdd John Morrissey to AUTHORS
Daniel Veillard [Wed, 20 Oct 2010 08:32:57 +0000 (10:32 +0200)]
Add John Morrissey to AUTHORS

14 years agoAdd process= support for 'qemu-kvm -name'
John Morrissey [Wed, 20 Oct 2010 08:25:05 +0000 (10:25 +0200)]
Add process= support for 'qemu-kvm -name'

This sets the process name to the same value as the Windows title,
but since the name is limited to 16 chars only this is kept as a
configuration option and turned off by default
* src/qemu/qemu.conf src/qemu/qemu_conf.[ch]: hceck for support in the
  QEmu help output, add the option in qemu conf file and augment
  qemudBuildCommandLine to add it if switched on
* src/qemu/libvirtd_qemu.aug src/qemu/test_libvirtd_qemu.aug: augment
  the augeas lenses accordingly
* tests/qemuhelptest.c: cope with the extra flag being detected now

14 years agonwfilter: avoid dir. enforcement for certain types of rules
Stefan Berger [Tue, 19 Oct 2010 23:25:37 +0000 (19:25 -0400)]
nwfilter: avoid dir. enforcement for certain types of rules

 Avoid the enforcement of direction if
- icmp rules specify the type/code information
- the 'skipMatch' variable is set to 'true'

14 years agodocs: added initial page for c# binding, with links to it
Justin Clift [Tue, 19 Oct 2010 19:48:40 +0000 (06:48 +1100)]
docs: added initial page for c# binding, with links to it

Adds a new page for the C# language bindings being developed by Arnaud
Champion.

14 years agoDon't fail lxc domain start when memory controller support is missing
Guido Günther [Fri, 15 Oct 2010 08:01:38 +0000 (10:01 +0200)]
Don't fail lxc domain start when memory controller support is missing

Debian stock kernel has CONFIG_CGROUP_MEM_RES_CTLR disabled due to the
overhead [1]. Allow to start containers if the corresponding files in
the cgroup filesystem are missing. This fixes Debian bug #566180 [2].

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534964
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566180

14 years agoFix compile errors in remote.c and newly added audit code
Matthias Bolte [Tue, 19 Oct 2010 17:01:26 +0000 (19:01 +0200)]
Fix compile errors in remote.c and newly added audit code

14 years agoFix symbol exports & remove duplicated libvirt_util.la linkage
Daniel P. Berrange [Tue, 12 Oct 2010 11:23:18 +0000 (12:23 +0100)]
Fix symbol exports & remove duplicated libvirt_util.la linkage

The libvirt_util.la library was mistakenly linked into libvirtd
directly. Since libvirt_util.la is already linked to libvirt.so,
this resulted in libvirtd getting two copies of the code and
more critically 2 copies of static global variables.

Testing in turn exposed a issue with loadable modules. The
gnulib replacement functions are not exported to loadable
modules. Rather than trying to figure out the name sof all
gnulib functions & export them, just linkage all loadable
modules against libgnu.la statically.

* daemon/Makefile.am: Remove linkage of libvirt_util.la
  and libvirt_driver.la
* src/Makefile.am: Link driver modules against libgnu.la
* src/libvirt.c: Don't try to load modules which were
  compiled out
* src/libvirt_private.syms: Export all other internal
  symbols that are required  by drivers

14 years agoAudit SELinux label assignment.
Miloslav Trmač [Tue, 12 Oct 2010 11:23:55 +0000 (12:23 +0100)]
Audit SELinux label assignment.

A more natural auditing point would perhaps be
SELinuxSetSecurityProcessLabel, but this happens in the child after root
permissions are dropped, so the kernel would refuse the audit record.

14 years agoAudit VM start/stop/suspend/resume
Miloslav Trmač [Tue, 12 Oct 2010 11:22:03 +0000 (12:22 +0100)]
Audit VM start/stop/suspend/resume

Most operations are audited at the libvirtd level; auditing in
src/libvirt.c would result in two audit entries per operation (one in
the client, one in libvirtd).

The only exception is a domain stopping of its own will (e.g. because
the user clicks on "shutdown" inside the interface).  There can often be
no client connected at the time the domain stops, so libvirtd does not
have any virConnectPtr object on which to attach an event watch.  This
patch therefore adds auditing directly inside the qemu driver (other
drivers are not supported).

14 years agoBasic framework for auditing integration
Daniel P. Berrange [Wed, 15 Sep 2010 13:44:11 +0000 (14:44 +0100)]
Basic framework for auditing integration

Integrate with libaudit.so for auditing of important operations.
libvirtd gains a couple of config entries for auditing. By
default it will enable auditing, if its enabled on the host.
It can be configured to force exit if auditing is disabled
on the host. It will can also send audit messages via libvirt
internal logging API

Places requiring audit reporting can use the VIR_AUDIT
macro to report data. This is a no-op unless auditing is
enabled

* autobuild.sh, mingw32-libvirt.spec.in: Disable audit
  on mingw
* configure.ac: Add check for libaudit
* daemon/libvirtd.aug, daemon/libvirtd.conf,
  daemon/test_libvirtd.aug, daemon/libvirtd.c: Add config
  options to enable auditing
* include/libvirt/virterror.h, src/util/virterror.c: Add
  VIR_FROM_AUDIT source
* libvirt.spec.in: Enable audit
* src/util/virtaudit.h, src/util/virtaudit.c: Simple internal
  API for auditing messages

14 years agoFix statstest when driver modules are enabled
Daniel P. Berrange [Thu, 14 Oct 2010 12:22:18 +0000 (13:22 +0100)]
Fix statstest when driver modules are enabled

The statstest is xen specific. Instead of filling the code with
a huge number of #ifdef WITH_XEN, just make its entire compilation
conditional in the Makefile.am. Also ensure it links to the Xen
driver so that it builds when driver modules are enabled

* tests/Makefile.am: Make statstest xen conditional. Link to
  xen driver
* tests/Makefile.am: Remove all conditionals

14 years agovirsh: consolidate memtune docs
Eric Blake [Tue, 19 Oct 2010 15:39:51 +0000 (09:39 -0600)]
virsh: consolidate memtune docs

* tools/virsh.pod (memtune): Drop second copy, fill to 80 columns,
enhance wording.

14 years agovcpu: remove dead xen code
Eric Blake [Thu, 7 Oct 2010 14:59:27 +0000 (08:59 -0600)]
vcpu: remove dead xen code

* src/xen/xen_driver.h (xenUnifiedDriver): Remove now-unused
domainGetMaxVcpus, domainSetVcpus.
* src/xen/proxy_internal.c (xenProxyDriver): Likewise.
* src/xen/xen_hypervisor.c (xenHypervisorDriver): Likewise.
* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
* src/xen/xend_internal.c (xenDaemonDriver)
(xenDaemonDomainSetVcpus): Likewise.
* src/xen/xm_internal.c (xenXMDriver, xenXMDomainSetVcpus):
Likewise.
* src/xen/xs_internal.c (xenStoreDriver): Likewise.

14 years agovcpu: improve support for setting xen vcpu counts
Eric Blake [Thu, 14 Oct 2010 22:17:18 +0000 (16:17 -0600)]
vcpu: improve support for setting xen vcpu counts

Tested with RHEL 5.6 (xendConfigVersion 2, where xend_internal
controls live domains and xm_internal controls inactive domains).
Hopefully this works with xendConfigVersion 3 (where xend_internal
controls everything).

* src/xen/xen_driver.c (xenUnifiedDomainSetVcpusFlags): Support
more flags.
(xenUnifiedGetMaxVcpus): Export.
* src/xen/xm_internal.h (xenXMDomainSetVcpusFlags): New prototype.
* src/xen/xend_internal.h (xenDaemonDomainSetVcpusFlags): Likewise.
* src/xen/xen_driver.h (xenUnifiedGetMaxVcpus): Likewise.
* src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): New function.
* src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags): Likewise.

14 years agovcpu: improve support for getting xen vcpu counts
Eric Blake [Wed, 6 Oct 2010 23:54:41 +0000 (17:54 -0600)]
vcpu: improve support for getting xen vcpu counts

* src/xen/xen_driver.c (xenUnifiedDomainGetVcpusFlags): Support
more flags.
* src/xen/xend_internal.h (xenDaemonDomainGetVcpusFlags): New
prototype.
* src/xen/xm_internal.h (xenXMDomainGetVcpusFlags): Likewise.
* src/xen/xend_internal.c (virDomainGetVcpusFlags): New function.
* src/xen/xm_internal.c (xenXMDomainGetVcpusFlags): Likewise.

14 years agovcpu: improve vcpu support in xen command line
Eric Blake [Tue, 5 Oct 2010 14:18:52 +0000 (08:18 -0600)]
vcpu: improve vcpu support in xen command line

This patch series focuses on xendConfigVersion 2 (xm_internal) and 3
(xend_internal), but leaves out changes for xenapi drivers.

See this link for more details about vcpu_avail for xm usage.
http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01061.html

This relies on the fact that def->maxvcpus can be at most 32 with xen.

* src/xen/xend_internal.c (xenDaemonParseSxpr)
(sexpr_to_xend_domain_info, xenDaemonFormatSxpr): Use vcpu_avail
when current vcpus is less than maximum.
* src/xen/xm_internal.c (xenXMDomainConfigParse)
(xenXMDomainConfigFormat): Likewise.
* tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr: New file.
* tests/sexpr2xmldata/sexpr2xml-pv-vcpus.sexpr: Likewise.
* tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml: Likewise.
* tests/xmconfigdata/test-paravirt-vcpu.cfg: Likewise.
* tests/xmconfigdata/test-paravirt-vcpu.xml: Likewise.
* tests/xml2sexprtest.c (mymain): New test.
* tests/sexpr2xmltest.c (mymain): Likewise.
* tests/xmconfigtest.c (mymain): Likewise.

14 years agovcpu: complete vcpu support in qemu driver
Eric Blake [Wed, 29 Sep 2010 23:40:45 +0000 (17:40 -0600)]
vcpu: complete vcpu support in qemu driver

* src/qemu/qemu_driver.c (qemudDomainSetVcpusFlags)
(qemudDomainGetVcpusFlags): Support all feasible flag
combinations.

14 years agovcpu: improve vcpu support in qemu command line
Eric Blake [Wed, 29 Sep 2010 21:58:47 +0000 (15:58 -0600)]
vcpu: improve vcpu support in qemu command line

* src/qemu/qemu_conf.c (qemuParseCommandLineSmp): Distinguish
between vcpus and maxvcpus, for new enough qemu.
* tests/qemuargv2xmltest.c (mymain): Add new test.
* tests/qemuxml2argvtest.c (mymain): Likewise.
* tests/qemuxml2xmltest.c (mymain): Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smp.args: New file.

14 years agovcpu: support all flags in test driver
Eric Blake [Mon, 4 Oct 2010 23:01:12 +0000 (17:01 -0600)]
vcpu: support all flags in test driver

* src/test/test_driver.c (testDomainGetVcpusFlags)
(testDomainSetVcpusFlags): Support all flags.
(testDomainUpdateVCPUs): Update cpu count here.

14 years agovcpu: add virsh support
Eric Blake [Wed, 29 Sep 2010 21:20:23 +0000 (15:20 -0600)]
vcpu: add virsh support

* tools/virsh.c (cmdSetvcpus): Add new flags.  Let invalid
commands through to driver, to ease testing of hypervisor argument
validation.
(cmdMaxvcpus, cmdVcpucount): New commands.
(commands): Add new commands.
* tools/virsh.pod (setvcpus, vcpucount, maxvcpus): Document new
behavior.

14 years agovcpu: support maxvcpu in domain_conf
Eric Blake [Wed, 29 Sep 2010 16:20:07 +0000 (10:20 -0600)]
vcpu: support maxvcpu in domain_conf

Although this patch adds a distinction between maximum vcpus and
current vcpus in the XML, the values should be identical for all
drivers at this point.  Only in subsequent per-driver patches will
a distinction be made.

In general, virDomainGetInfo should prefer the current vcpus.

* src/conf/domain_conf.h (_virDomainDef): Adjust vcpus to unsigned
short, to match virDomainGetInfo limit.  Add maxvcpus member.
* src/conf/domain_conf.c (virDomainDefParseXML)
(virDomainDefFormat): parse and print out vcpu details.
* src/xen/xend_internal.c (xenDaemonParseSxpr)
(xenDaemonFormatSxpr): Manage both vcpu numbers, and require them
to be equal for now.
* src/xen/xm_internal.c (xenXMDomainConfigParse)
(xenXMDomainConfigFormat): Likewise.
* src/phyp/phyp_driver.c (phypDomainDumpXML): Likewise.
* src/openvz/openvz_conf.c (openvzLoadDomains): Likewise.
* src/openvz/openvz_driver.c (openvzDomainDefineXML)
(openvzDomainCreateXML, openvzDomainSetVcpusInternal): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxDomainDefineXML):
Likewise.
* src/xenapi/xenapi_driver.c (xenapiDomainDumpXML): Likewise.
* src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
* src/esx/esx_vmx.c (esxVMX_ParseConfig, esxVMX_FormatConfig):
Likewise.
* src/qemu/qemu_conf.c (qemuBuildSmpArgStr)
(qemuParseCommandLineSmp, qemuParseCommandLine): Likewise.
* src/qemu/qemu_driver.c (qemudDomainHotplugVcpus): Likewise.
* src/opennebula/one_conf.c (xmlOneTemplate): Likewise.

14 years agovcpu: make old API trivially wrap to new API
Eric Blake [Mon, 27 Sep 2010 22:37:53 +0000 (16:37 -0600)]
vcpu: make old API trivially wrap to new API

Note - this wrapping is completely mechanical; the old API will
function identically, since the new API validates that the exact
same flags are provided by the old API.  On a per-driver basis,
it may make sense to have the old API pass a different set of flags,
but that should be done in the per-driver patch that implements
the full range of flag support in the new API.

* src/esx/esx_driver.c (esxDomainSetVcpus, escDomainGetMaxVpcus):
Move guts...
(esxDomainSetVcpusFlags, esxDomainGetVcpusFlags): ...to new
functions.
(esxDriver): Trivially support the new API.
* src/openvz/openvz_driver.c (openvzDomainSetVcpus)
(openvzDomainSetVcpusFlags, openvzDomainGetMaxVcpus)
(openvzDomainGetVcpusFlags, openvzDriver): Likewise.
* src/phyp/phyp_driver.c (phypDomainSetCPU)
(phypDomainSetVcpusFlags, phypGetLparCPUMAX)
(phypDomainGetVcpusFlags, phypDriver): Likewise.
* src/qemu/qemu_driver.c (qemudDomainSetVcpus)
(qemudDomainSetVcpusFlags, qemudDomainGetMaxVcpus)
(qemudDomainGetVcpusFlags, qemuDriver): Likewise.
* src/test/test_driver.c (testSetVcpus, testDomainSetVcpusFlags)
(testDomainGetMaxVcpus, testDomainGetVcpusFlags, testDriver):
Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainSetVcpus)
(vboxDomainSetVcpusFlags, virDomainGetMaxVcpus)
(virDomainGetVcpusFlags, virDriver): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainSetVcpus)
(xenUnifiedDomainSetVcpusFlags, xenUnifiedDomainGetMaxVcpus)
(xenUnifiedDomainGetVcpusFlags, xenUnifiedDriver): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDomainSetVcpus)
(xenapiDomainSetVcpusFlags, xenapiDomainGetMaxVcpus)
(xenapiDomainGetVcpusFlags, xenapiDriver): Likewise.
(xenapiError): New helper macro.

14 years agovcpu: implement the remote protocol
Eric Blake [Mon, 27 Sep 2010 16:10:06 +0000 (10:10 -0600)]
vcpu: implement the remote protocol

Done by editing the first three files, then running
'make -C src rpcgen', then editing src/remote_protocol-structs
to match.

* daemon/remote.c (remoteDispatchDomainSetVcpusFlags)
(remoteDispatchDomainGetVcpusFlags): New functions.
* src/remote/remote_driver.c (remoteDomainSetVcpusFlags)
(remoteDomainGetVcpusFlags, remote_driver): Client side
serialization.
* src/remote/remote_protocol.x
(remote_domain_set_vcpus_flags_args)
(remote_domain_get_vcpus_flags_args)
(remote_domain_get_vcpus_flags_ret)
(REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
(REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS): Define wire format.
* daemon/remote_dispatch_args.h: Regenerate.
* daemon/remote_dispatch_prototypes.h: Likewise.
* daemon/remote_dispatch_table.h: Likewise.
* src/remote/remote_protocol.c: Likewise.
* src/remote/remote_protocol.h: Likewise.
* src/remote_protocol-structs: Likewise.

14 years agovcpu: implement the public APIs
Eric Blake [Mon, 27 Sep 2010 15:37:22 +0000 (09:37 -0600)]
vcpu: implement the public APIs

Factors common checks (such as nonzero vcpu count) up front, but
drivers will still need to do additional flag checks.

* src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpusFlags):
New functions.
(virDomainSetVcpus, virDomainGetMaxVcpus): Refer to new API.

14 years agovcpu: define internal driver API
Eric Blake [Mon, 27 Sep 2010 15:18:22 +0000 (09:18 -0600)]
vcpu: define internal driver API

* src/driver.h (virDrvDomainSetVcpusFlags)
(virDrvDomainGetVcpusFlags): New typedefs.
(_virDriver): New callback members.
* src/esx/esx_driver.c (esxDriver): Add stub for driver.
* src/lxc/lxc_driver.c (lxcDriver): Likewise.
* src/opennebula/one_driver.c (oneDriver): Likewise.
* src/openvz/openvz_driver.c (openvzDriver): Likewise.
* src/phyp/phyp_driver.c (phypDriver): Likewise.
* src/qemu/qemu_driver.c (qemuDriver): Likewise.
* src/remote/remote_driver.c (remote_driver): Likewise.
* src/test/test_driver.c (testDriver): Likewise.
* src/uml/uml_driver.c (umlDriver): Likewise.
* src/vbox/vbox_tmpl.c (Driver): Likewise.
* src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.

14 years agovcpu: add new public API
Eric Blake [Fri, 24 Sep 2010 22:48:45 +0000 (16:48 -0600)]
vcpu: add new public API

API agreed on in
https://www.redhat.com/archives/libvir-list/2010-September/msg00456.html,
but modified for enum names to be consistent with virDomainDeviceModifyFlags.

* include/libvirt/libvirt.h.in (virDomainVcpuFlags)
(virDomainSetVcpusFlags, virDomainGetVcpusFlags): New
declarations.
* src/libvirt_public.syms: Export new symbols.

14 years agovcpu: add current attribute to <vcpu> element
Eric Blake [Mon, 27 Sep 2010 23:36:06 +0000 (17:36 -0600)]
vcpu: add current attribute to <vcpu> element

Syntax agreed on in
https://www.redhat.com/archives/libvir-list/2010-September/msg00476.html

<domain ...>
  <vcpu current='x'>y</vcpu>
...

can now be used to specify 1 <= x <= y current vcpus, in relation
to the boot-time max of y vcpus.  If current is omitted, then
current and max are assumed to be the same value.

* docs/schemas/domain.rng: Add new attribute.
* docs/formatdomain.html.in: Document it.
* tests/qemuxml2argvdata/qemuxml2argv-smp.xml: Add to
domainschematest.
* tests/xml2sexprdata/xml2sexpr-pv-vcpus.xml: Likewise.

14 years agonwfilter: changes to rules in VM->host table
Stefan Berger [Tue, 19 Oct 2010 15:35:58 +0000 (11:35 -0400)]
nwfilter: changes to rules in VM->host table

In the table built for traffic coming from the VM going to the host make the following changes:

- don't ACCEPT the packets but do a 'RETURN' and let the host-specific firewall rules in subsequent rules evaluate whether the traffic is allowed to enter

- use the '-m state' in the rules as everywhere else

14 years agobuild: avoid false positive syntax-check failure
Eric Blake [Tue, 19 Oct 2010 15:23:50 +0000 (09:23 -0600)]
build: avoid false positive syntax-check failure

* .x-sc_po_check: Exclude docs directory.

14 years agoproxy: Fix undefined reference to virClose
Matthias Bolte [Tue, 19 Oct 2010 14:43:59 +0000 (16:43 +0200)]
proxy: Fix undefined reference to virClose

Add src/util/files.c to libvirt_proxy_SOURCES.

14 years agoesx: Handle non-UTF-8 encoded VMX files
Matthias Bolte [Fri, 15 Oct 2010 15:50:23 +0000 (17:50 +0200)]
esx: Handle non-UTF-8 encoded VMX files

ESX(i) uses UTF-8, but a Windows based GSX server writes
Windows-1252 encoded VMX files.

Add a test case to ensure that libxml2 provides Windows-1252
to UTF-8 conversion.

14 years agoIntroduce VIR_CLOSE to be used rather than close()
Stefan Berger [Tue, 19 Oct 2010 14:23:51 +0000 (10:23 -0400)]
Introduce VIR_CLOSE to be used rather than close()

Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here.

There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were.

I also dare to declare close() as being deprecated in libvirt code base (HACKING).

14 years agoroot_squash: virFileOperation may fail with EPERM too
Dan Kenigsberg [Tue, 19 Oct 2010 13:26:32 +0000 (15:26 +0200)]
root_squash: virFileOperation may fail with EPERM too

Over root-squashing nfs, when virFileOperation() is called as uid==0,
it may fail with EACCES, but also with EPERM, due to
virFileOperationNoFork()'s failed attemp to chown a writable file.

qemudDomainSaveFlag() should expect this case, too.

14 years agoRun initgroups() in qemudOpenAsUID()
Dan Kenigsberg [Tue, 19 Oct 2010 13:22:57 +0000 (15:22 +0200)]
Run initgroups() in qemudOpenAsUID()

qemudOpenAsUID is intended to open a file with the credentials of a
specified uid. Current implementation fails if the file is accessible to
one of uid's groups but not owned by uid.

This patch replaces the supplementary group list that the child process
inherited from libvirtd with the default group list of uid.

14 years agomemtune: Add min_guarantee to the virsh memtune command
Nikunj A. Dadhania [Tue, 19 Oct 2010 12:45:35 +0000 (14:45 +0200)]
memtune: Add min_guarantee to the virsh memtune command

* tools/virsh.c: Add new memory tunable "min_guarantee", currently only
  ESX can use this
* tools/virsh.pod: Update the manpage

14 years agoUpdate docs for memory parameters and memtune command
Nikunj A. Dadhania [Tue, 19 Oct 2010 12:27:12 +0000 (14:27 +0200)]
Update docs for memory parameters and memtune command

* docs/formatdomain.html.in: Add memtune element details, added min_guarantee
* src/libvirt.c: Update virDomainGetMemoryParameters api description, make
  it more clear that the user first needs to call the api to get the number
  of parameters supported and then call again to get the values.
* tools/virsh.pod: Add usage of new command memtune in virsh manpage

14 years agoqemu: let qemu group look below /var/lib/libvirt/qemu/
Dan Kenigsberg [Mon, 18 Oct 2010 16:21:15 +0000 (10:21 -0600)]
qemu: let qemu group look below /var/lib/libvirt/qemu/

Vdsm needs to communicate with its guest agent via unix domain socket,
which qemu creates due to the following domain xml device:

    <channel type='unix'>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/fcp-xp-1.com.redhat.rhevm.vdsm'/>
    </channel>

The location of the socket below /var/lib/libvirt/qemu/channels makes
sense, to humans and selinux policy alike. However, that socket should
be accessible to vdsm, too.

Due to other (storage) reasons, vdsm is to join the "qemu" group. With
this patch, vdsm can look below /var/lib/libvirt/qemu and connect to the
socket.

The socket itself should be chmod'ed to allow qemu group read/write, but
that's for another project.

BZ#643407

14 years agoesx: Fix check in esxDomainGetInfo's perf metric handling
Matthias Bolte [Fri, 15 Oct 2010 18:13:04 +0000 (20:13 +0200)]
esx: Fix check in esxDomainGetInfo's perf metric handling

14 years agobuild: use latest gnulib, for ignore-value fix
Eric Blake [Fri, 15 Oct 2010 22:10:18 +0000 (16:10 -0600)]
build: use latest gnulib, for ignore-value fix

* .gnulib: Update to latest.

14 years agovirsh: add tests for recent cli improvements
Eric Blake [Fri, 15 Oct 2010 16:34:11 +0000 (10:34 -0600)]
virsh: add tests for recent cli improvements

* tests/virshtest.c (mymain): Add tests of command parsing and
echo command.

14 years agovirsh: new echo command
Eric Blake [Fri, 15 Oct 2010 13:39:34 +0000 (07:39 -0600)]
virsh: new echo command

* tools/virsh.c (cmdEcho): New command.
(commands): Add it.
* tools/virsh.pod (echo): Document it.

14 years agovirsh: add support for accepting arbitrary argv
Eric Blake [Fri, 15 Oct 2010 13:38:49 +0000 (07:38 -0600)]
virsh: add support for accepting arbitrary argv

* tools/virsh.c (vshCmdOptType): Add VSH_OT_ARGV.  Delete
unused VSH_OT_NONE.
(vshCmddefGetData): Special case new opt flag.
(vshCmddefHelp): Display help for argv.
(vshCommandOptArgv): New function.

14 years agodocs: document how to disable memballoon
Eric Blake [Fri, 15 Oct 2010 19:34:24 +0000 (13:34 -0600)]
docs: document how to disable memballoon

https://bugzilla.redhat.com/show_bug.cgi?id=623903 documents a qemu
bug that causes libvirt to hang if virt-manager happens to be
querying balloon info when a guest is paused.  Until the qemu bug
is fixed, people need to know how to avoid the issue.

* docs/formatdomain.html.in (Memory balloon device): Mention
model='none'.

14 years agoesx: Explictly declare VMX file content as UTF-8
Matthias Bolte [Wed, 13 Oct 2010 21:58:09 +0000 (23:58 +0200)]
esx: Explictly declare VMX file content as UTF-8

14 years agoFix warning about a non-literal format string in qemu_driver.c
Laine Stump [Fri, 15 Oct 2010 15:34:38 +0000 (11:34 -0400)]
Fix warning about a non-literal format string in qemu_driver.c

14 years agobuild: skip xenapi driver when building for RHEL
Eric Blake [Thu, 14 Oct 2010 17:46:41 +0000 (11:46 -0600)]
build: skip xenapi driver when building for RHEL

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

* libvirt.spec.in: Provide xenapi conditionals.

14 years agoesx: Handle name escaping properly
Matthias Bolte [Tue, 12 Oct 2010 17:37:39 +0000 (19:37 +0200)]
esx: Handle name escaping properly

VMware uses a mix of percent-, pipe- and base64-encoding in
different combinations in different places.

Add a testcase for this.

14 years agonwfilter: prevent filters with different name but same UUID
Stefan Berger [Thu, 14 Oct 2010 15:53:08 +0000 (11:53 -0400)]
nwfilter: prevent filters with different name but same UUID

Patch to prevent multiple nwfilters with different name but same UUID.

14 years agomaint: add recent author
Eric Blake [Thu, 14 Oct 2010 15:17:42 +0000 (09:17 -0600)]
maint: add recent author

* AUTHORS: List Harsh Prateek Bora, for 'make syntax-check'.

14 years agobuild: fix accidental submodule reversion
Eric Blake [Thu, 14 Oct 2010 13:56:15 +0000 (07:56 -0600)]
build: fix accidental submodule reversion

* .gnulib: Undo change in previous commit.

14 years agonew attribute accessmode to filesystem element
Harsh Prateek Bora [Thu, 14 Oct 2010 13:08:24 +0000 (15:08 +0200)]
new attribute accessmode to filesystem element

This introduces new attribute to filesystem element
to support customizable access mode for mount type.
Valid accessmode are: passthrough, mapped and squash.

Usage:
        <filesystem type='mount' accessmode='passthrough'>
          <source dir='/export/to/guest'/>
          <target dir='mount_tag'/>
        </filesystem>

passthrough is the default model if not specified, that's
also the current behaviour.

14 years agonwfilter: cut off connections after changing filters
Stefan Berger [Thu, 14 Oct 2010 12:54:03 +0000 (08:54 -0400)]
nwfilter: cut off connections after changing filters

The following filter transition from a filter allowing incoming TCP connections

  <rule action='accept' direction='in' priority='401'>
    <tcp/>
  </rule>
  <rule action='accept' direction='out' priority='500'>
    <tcp/>
  </rule>

to one that does not allow them

  <rule action='drop' direction='in' priority='401'>
    <tcp/>
  </rule>
  <rule action='accept' direction='out' priority='500'>
    <tcp/>
  </rule>

did previously not cut off existing (ssh) connections but only prevented newly initiated ones. The attached patch allows to cut off existing connections as well, thus enforcing what the filter is showing.

I had only tested with a configuration where the physical interface is connected to the bridge where the filters are applied. This patch now also solves a filtering problem where the physical interface is not connected to the bridge, but the bridge is given an IP address and the host routes between bridge and physical interface. Here the filters drop non-allowed traffic on the outgoing side on the host.

14 years agobuild: provide URL in 'configure --help'
Eric Blake [Thu, 14 Oct 2010 01:37:25 +0000 (19:37 -0600)]
build: provide URL in 'configure --help'

* configure.ac (AC_INIT): Provide email and URL.

14 years agobuild: fix mingw build
Eric Blake [Wed, 13 Oct 2010 22:14:58 +0000 (16:14 -0600)]
build: fix mingw build

* .gnulib: Update to latest, for termios fix.
* configure.ac (AC_CHECK_HEADERS): Drop redundent check.
* bootstrap: Synchronize from upstream.
Reported by Daniel P. Berrange.

14 years agoqemu: Prohibit migration of guests with host devices
Jiri Denemark [Wed, 13 Oct 2010 13:51:50 +0000 (15:51 +0200)]
qemu: Prohibit migration of guests with host devices

Explicitly raising a nice error in the case user tries to migrate a
guest with assigned host devices is much better than waiting for a
mysterious error with no clue for the reason.