]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
13 years agoConvert the remote driver to new RPC client APIs
Daniel P. Berrange [Wed, 1 Dec 2010 16:46:36 +0000 (16:46 +0000)]
Convert the remote driver to new RPC client APIs

This guts the current remote driver, removing all its networking
handling code. Instead it calls out to the new virClientPtr and
virClientProgramPtr APIs for all RPC & networking work.

* src/Makefile.am: Link remote driver with generic RPC code
* src/remote/remote_driver.c: Gut code, replacing with RPC
  API calls
* src/rpc/gendispatch.pl: Update for changes in the way
  streams are handled

13 years agoAdd XDR_CFLAGS to libvirt-net-rpc.la library
Daniel P. Berrange [Tue, 28 Jun 2011 15:44:59 +0000 (16:44 +0100)]
Add XDR_CFLAGS to libvirt-net-rpc.la library

* src/Makefile.am: Add XDR_CFLAGS

13 years agoEnsure sanlock socket is labelled with the VM process label
Daniel P. Berrange [Fri, 24 Jun 2011 14:14:41 +0000 (15:14 +0100)]
Ensure sanlock socket is labelled with the VM process label

The libvirt sanlock plugin is intentionally leaking a file
descriptor to QEMU. To enable QEMU to use this FD under
SELinux, it must be labelled correctly. We dont want to use
the svirt_image_t for this, since QEMU must not be allowed
to actually use the FD. So instead we label it with svirt_t
using virSecurityManagerSetProcessFDLabel

* src/locking/domain_lock.c, src/locking/domain_lock.h,
  src/locking/lock_driver.h, src/locking/lock_driver_nop.c,
  src/locking/lock_driver_sanlock.c, src/locking/lock_manager.c,
  src/locking/lock_manager.h: Optionally pass an FD back to
  the hypervisor for security driver labelling
* src/qemu/qemu_process.c: label the lock manager plugin
  FD with the process label

13 years agoAdd a virSecurityManagerSetProcessFDLabel
Daniel P. Berrange [Fri, 24 Jun 2011 13:50:36 +0000 (14:50 +0100)]
Add a virSecurityManagerSetProcessFDLabel

Add a new security driver method for labelling an FD with
the process label, rather than the image label

* src/libvirt_private.syms, src/security/security_apparmor.c,
  src/security/security_dac.c, src/security/security_driver.h,
  src/security/security_manager.c, src/security/security_manager.h,
  src/security/security_selinux.c, src/security/security_stack.c:
  Add virSecurityManagerSetProcessFDLabel & impl

13 years agoRename virSecurityManagerSetFDLabel method
Daniel P. Berrange [Fri, 24 Jun 2011 13:43:43 +0000 (14:43 +0100)]
Rename virSecurityManagerSetFDLabel method

The virSecurityManagerSetFDLabel method is used to label
file descriptors associated with disk images. There will
shortly be a need to label other file descriptors in a
different way. So the current name is ambiguous. Rename
the method to virSecurityManagerSetImageFDLabel to clarify
its purpose

* src/libvirt_private.syms,
  src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
  src/security/security_apparmor.c, src/security/security_dac.c,
  src/security/security_driver.h, src/security/security_manager.c,
  src/security/security_manager.h, src/security/security_selinux.c,
  src/security/security_stack.c: s/FDLabel/ImageFDLabel/

13 years agoAdd node prefix to virNodeGet(CPU|Memory)Stats structs and defines
Matthias Bolte [Wed, 15 Jun 2011 10:39:57 +0000 (12:39 +0200)]
Add node prefix to virNodeGet(CPU|Memory)Stats structs and defines

13 years agoqemu: Fix update device for CURRENT + FORCE flags
Jiri Denemark [Mon, 27 Jun 2011 09:25:19 +0000 (11:25 +0200)]
qemu: Fix update device for CURRENT + FORCE flags

When CURRENT and FORCE flags were used together, UpdateDeviceFlags did
nothing because it failed to transform CURRENT into either LIVE or
CONFIG.

13 years agonwfilter: Return error message about unresolvable variables
Stefan Berger [Mon, 27 Jun 2011 16:53:59 +0000 (12:53 -0400)]
nwfilter: Return error message about unresolvable variables

This is in response to bugzilla 664629

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

The patch below returns an appropriate error message if the chain of
nwfilters is found to contain unresolvable variables and therefore
cannot be instantiated.

Example: The following XMl added to a domain:

    <interface type='bridge'>
      <mac address='52:54:00:9f:80:45'/>
      <source bridge='virbr0'/>
      <model type='virtio'/>
      <filterref filter='test'/>
    </interface>

that references the following filter

<filter name='test' chain='root'>
  <filterref filter='clean-traffic'/>
  <filterref filter='allow-dhcp-server'/>
</filter>

now displays upon 'virsh start mydomain'

error: Failed to start domain mydomain
error: internal error Cannot instantiate filter due to unresolvable variable: DHCPSERVER

'DHPCSERVER' is contained in allow-dhcp-server.

13 years agobuild: rename Vcpupin to VcpuPin
Eric Blake [Fri, 24 Jun 2011 23:09:46 +0000 (17:09 -0600)]
build: rename Vcpupin to VcpuPin

We already have a public virDomainPinVcpu, which implies that
Pin and Vcpu are treated as separate words.  Unreleased commit
e261987c introduced virDomainGetVcpupinInfo as the first public
API that used Vcpupin, although we had prior internal uses of
that spelling.  For consistency, change the spelling to be two
words everywhere, regardless of whether pin comes first or last.

* daemon/remote.c: Treat vcpu and pin as separate words.
* include/libvirt/libvirt.h.in: Likewise.
* src/conf/domain_conf.c: Likewise.
* src/conf/domain_conf.h: Likewise.
* src/driver.h: Likewise.
* src/libvirt.c: Likewise.
* src/libvirt_private.syms: Likewise.
* src/libvirt_public.syms: Likewise.
* src/libxl/libxl_driver.c: Likewise.
* src/qemu/qemu_driver.c: Likewise.
* src/remote/remote_driver.c: Likewise.
* src/xen/xend_internal.c: Likewise.
* tools/virsh.c: Likewise.
* src/remote/remote_protocol.x: Likewise.
* src/remote_protocol-structs: Likewise.
Suggested by Matthias Bolte.

13 years agosysinfo: cleanup function/struct names.
Minoru Usui [Mon, 27 Jun 2011 07:39:34 +0000 (16:39 +0900)]
sysinfo: cleanup function/struct names.

Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]

13 years agosysinfo: fix lack of error check in virSysinfoFormat().
Minoru Usui [Mon, 27 Jun 2011 07:40:56 +0000 (16:40 +0900)]
sysinfo: fix lack of error check in virSysinfoFormat().

Fix lack of error check in virSysinfoFormat().

Signed-off-by: Minoru Usui <usui@mxm.nes.nec.co.jp>
13 years agotests: Partly fix networkxml2argvtest being configure result dependent
Matthias Bolte [Mon, 27 Jun 2011 14:55:13 +0000 (16:55 +0200)]
tests: Partly fix networkxml2argvtest being configure result dependent

Convert networkDnsmasqLeaseFileName to a replaceable function pointer
that allow the testsuite to use a version of that function that is not
depending on configure --localstatedir.

This fixes 5 of 6 test failures, when configure --localstatedir isn't
set to /var.

13 years agoqemu: Remove bogus error codes for NUMA memory tuning
Osier Yang [Mon, 27 Jun 2011 15:20:15 +0000 (23:20 +0800)]
qemu: Remove bogus error codes for NUMA memory tuning

This is no code between virSaveLastError and virGetLastError will
set an error, remove the bogus codes.

13 years agonetwork: fix indentation in networkBuildDnsmasqArgv
Laine Stump [Sat, 25 Jun 2011 05:11:05 +0000 (01:11 -0400)]
network: fix indentation in networkBuildDnsmasqArgv

This block was inadvertently added with the wrong indentation.

13 years agoOnly include parthelper if built with storage_disk
Ruben Kerkhof [Sun, 26 Jun 2011 09:39:14 +0000 (11:39 +0200)]
Only include parthelper if built with storage_disk

Parthelper is only compiled if both --with-libvirtd
and --with-storage-disk are set.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
13 years agobuild: avoid uninitialized variable
Eric Blake [Sat, 25 Jun 2011 02:53:53 +0000 (20:53 -0600)]
build: avoid uninitialized variable

Caught by gcc -O2, during autobuild.sh.

* src/qemu/qemu_driver.c (qemudDomainGetVcpupinInfo): Initialize vm.

13 years agobuild: fix VPATH builds
Eric Blake [Sat, 25 Jun 2011 02:48:49 +0000 (20:48 -0600)]
build: fix VPATH builds

The build currently fails when trying to create virnetprotocol.c
into $(builddir)/rpc, which doesn't exist.  But since the file
is part of the tarball, it should be generated into $(srcdir).
Caught by autobuild.sh.

* src/Makefile.am (VIR_NET_RPC_GENERATED): Generate into srcdir.

13 years agovcpupin: add query option to virsh vcpupin command
Taku Izumi [Fri, 24 Jun 2011 09:02:28 +0000 (18:02 +0900)]
vcpupin: add query option to virsh vcpupin command

This patch teaches "virsh vcpupin" command to query if no list
is given. Its feature is to show CPU affinity information in more
reader-friendly way.

 # virsh vcpupin VM --config
 VCPU: CPU Affinity
 ----------------------------------
    0: 1-6,9-20
    1: 10
    2: 5,9-11,15-20
    3: 1,3,5,7,9,11,13,15

When cpulist is omitted, vcpu number is optional. When vcpu number is
provided, information of only specified vcpu is displayed.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
13 years agovcpuinfo: add the code to fallback to try new API
Taku Izumi [Fri, 24 Jun 2011 09:01:25 +0000 (18:01 +0900)]
vcpuinfo: add the code to fallback to try new API

The "virsh vcpuinfo" command results in failure when the target domain
is inactive on KVM. This patch improves this behavior by adding the
fallback to invoke virDomainGetVcpupinInfo API in case of
virDomainGetVcpus API returns error and the target domain is inactive.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
13 years agovcpupin: implement the remote protocol to address the new API
Taku Izumi [Fri, 24 Jun 2011 09:00:22 +0000 (18:00 +0900)]
vcpupin: implement the remote protocol to address the new API

This patch implements the remote protocol to address the new API
(virDomainGetVcpupinInfo).

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
13 years agovcpupin: implement the code to support new API for the qemu driver
Taku Izumi [Fri, 24 Jun 2011 08:57:34 +0000 (17:57 +0900)]
vcpupin: implement the code to support new API for the qemu driver

This patch implements the code to address the new API (virDomainGetVcpupinInfo)
in the qemu driver.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
13 years agovcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo)
Taku Izumi [Fri, 24 Jun 2011 08:56:21 +0000 (17:56 +0900)]
vcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo)

This patch introduces a new libvirt API (virDomainGetVcpupinInfo),
as a counterpart to virDomainPinVcpuFlags.

We can use virDomainGetVcpus API to retrieve CPU affinity information,
but can't use this API against inactive domains (at least in case of KVM),
as it lacks a flags parameter.
The usual thing is to add a new virDomainGetVcpusFlags, but that API name
is already occupied by the counterpart to virDomainGetMaxVcpus, which
has a completely different signature.

The virDomainGetVcpupinInfo is the new API to retrieve CPU affinity
information of active and inactive domains.  While the usual convention
is to list an array before its length, this API violates that rule
in order to be more like virDomainGetVcpus (where maxinfo was doing
double-duty as the length of two different arrays).

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
13 years agodocs: fix indentation of sub-elements of <ip> in network XML
Laine Stump [Fri, 24 Jun 2011 21:48:55 +0000 (17:48 -0400)]
docs: fix indentation of sub-elements of <ip> in network XML

The sub-elements of <ip> had been placed at the same level of
indentation as ip itself, implying that they were really elements of
<network>. Within that, sub-elements of ip/dhcp were also at that same
level. These have been double-indented.

At the same time, I realized that the documentation for the new <dns>
element had been placed right in the middle of the description of the
sub-elements of <ip>. I moved it up out of the way.

13 years agobuf: protect against integer overflow
Eric Blake [Fri, 24 Jun 2011 20:04:04 +0000 (14:04 -0600)]
buf: protect against integer overflow

It's unlikely that we'll ever want to escape a string as long as
INT_MAX/6, but adding this check can't hurt.

* src/util/buf.c (virBufferEscapeSexpr, virBufferEscapeString):
Check for (unlikely) overflow.

13 years agoremote: protect against integer overflow
Eric Blake [Fri, 24 Jun 2011 18:16:05 +0000 (12:16 -0600)]
remote: protect against integer overflow

Integer overflow and remote code are never a nice mix.

This has existed since commit 56cd414.

* src/libvirt.c (virDomainGetVcpus): Reject overflow up front.
* src/remote/remote_driver.c (remoteDomainGetVcpus): Avoid overflow
on sending rpc.
* daemon/remote.c (remoteDispatchDomainGetVcpus): Avoid overflow on
receiving rpc.

13 years agobuild: update gnulib for intprops
Eric Blake [Fri, 24 Jun 2011 18:24:44 +0000 (12:24 -0600)]
build: update gnulib for intprops

Done as a separate commit to make backporting the next patch easier.
We are already using "intprops.h", but this makes it explicit.

* .gnulib: Update, for syntax-check fix.
* bootstrap.conf (gnulib_modules): Make intprops use explicit.
* src/locking/domain_lock.c (includes): Drop unused header.
* src/nwfilter/nwfilter_learnipaddr.c (includes): Use "", not <>,
for gnulib.

13 years agobuild: avoid long line tests
Eric Blake [Fri, 24 Jun 2011 21:30:00 +0000 (15:30 -0600)]
build: avoid long line tests

'make syntax-check' regression introduced in commit 60b9c69.

* tests/networkxml2argvdata/*.argv: Break long lines.

13 years agoRename iface(G|S)etMacaddr to iface(G|S)etMacAddress for consistency
Matthias Bolte [Fri, 24 Jun 2011 20:39:15 +0000 (22:39 +0200)]
Rename iface(G|S)etMacaddr to iface(G|S)etMacAddress for consistency

13 years agoFix typo in libvirt_private.syms
Matthias Bolte [Fri, 24 Jun 2011 20:31:05 +0000 (22:31 +0200)]
Fix typo in libvirt_private.syms

Triggered a linker error on MinGW.

13 years agoNetwork: Add support for DNS hosts definition to the network XML
Michal Novotny [Fri, 24 Jun 2011 10:04:40 +0000 (12:04 +0200)]
Network: Add support for DNS hosts definition to the network XML

This commit introduces names definition for the DNS hosts file using
the following syntax:

  <dns>
    <host ip="192.168.1.1">
      <name>alias1</name>
      <name>alias2</name>
    </host>
  </dns>

Some of the improvements and fixes were done by Laine Stump so
I'm putting him into the SOB clause again ;-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Laine Stump <laine@laine.org>
13 years agoNetwork: Add additional hosts internal infrastructure
Michal Novotny [Fri, 24 Jun 2011 10:04:39 +0000 (12:04 +0200)]
Network: Add additional hosts internal infrastructure

Signed-off-by: Michal Novotny <minovotn@redhat.com>
13 years agoNetwork: Add regression tests for the command-line arguments
Michal Novotny [Fri, 24 Jun 2011 10:04:37 +0000 (12:04 +0200)]
Network: Add regression tests for the command-line arguments

The regression testing done by comparison of command-line
generated from the network XML file and the expected
command-line arguments (read from file).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
13 years agoNetwork: modify dnsmasq commandline build function to allow testing
Michal Novotny [Fri, 24 Jun 2011 10:04:38 +0000 (12:04 +0200)]
Network: modify dnsmasq commandline build function to allow testing

The dnsmasq commandline was being built as a part of running
dnsmasq. This patch puts the commandline build into a separate
function (and exports it as a private API) making it possible to build
a dnsmasq commandline without executing it, so that we can write a
test program to verify that the proper commandlines are being created.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
13 years agoAdd TXT record support for virtual DNS service
Michal Novotny [Fri, 24 Jun 2011 10:04:36 +0000 (12:04 +0200)]
Add TXT record support for virtual DNS service

This commit introduces the <dns> element and <txt> record for the
virtual DNS network. The DNS TXT record can be defined using following
syntax in the network XML file:

  <dns>
    <txt name="example" value="example value" />
  </dns>

Also, the Relax-NG scheme has been altered to allow the texts without
spaces only for the name element and some nitpicks about memory
free'ing have been fixed by Laine so therefore I'm adding Laine to the
SOB clause ;-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Laine Stump <laine@laine.org>
13 years agopython: Don't declare Py_ssize_t for Python 2.6
Matthias Bolte [Fri, 24 Jun 2011 17:34:56 +0000 (19:34 +0200)]
python: Don't declare Py_ssize_t for Python 2.6

Commit cd48c3f4e95597 added a Py_ssize_t typedef for Python < 2.7.
But Py_ssize_t was added in Python 2.5. This makes the build fail
for Python 2.6.

Adjust the check to match Python < 2.5 to fix this.

13 years agotests: Improve IPv6 detection for virNetSocket tests
Matthias Bolte [Fri, 24 Jun 2011 15:32:56 +0000 (17:32 +0200)]
tests: Improve IPv6 detection for virNetSocket tests

getifaddrs can return an IPv6 address, but getaddrinfo can fail
for an IPv6 address. Cover this combination.

13 years agoMove load of AppArmor profile to GenLabel()
Jamie Strandboge [Fri, 24 Jun 2011 14:51:37 +0000 (09:51 -0500)]
Move load of AppArmor profile to GenLabel()

Commit 12317957ecd6c37a2fb16275dcdeeacfe25c517 introduced an incompatible
architectural change for the AppArmor security driver. Specifically,
virSecurityManagerSetAllLabel() is now called much later in
src/qemu/qemu_process.c:qemuProcessStart(). Previously, SetAllLabel() was
called immediately after GenLabel() such that after the dynamic label (profile
name) was generated, SetAllLabel() would be called to create and load the
AppArmor profile into the kernel before qemuProcessHook() was executed. With
12317957ecd6c37a2fb16275dcdeeacfe25c517, qemuProcessHook() is now called
before SetAllLabel(), such that aa_change_profile() ends up being called
before the AppArmor profile is loaded into the kernel (via ProcessLabel() in
qemuProcessHook()).

This patch addresses the change by making GenLabel() load the AppArmor
profile into the kernel after the label (profile name) is generated.
SetAllLabel() is then adjusted to only reload_profile() and append stdin_fn to
the profile when it is specified. This also makes the AppArmor driver work
like its SELinux counterpart with regard to SetAllLabel() and stdin_fn.
Bug-Ubuntu: https://launchpad.net/bugs/801569

13 years agodocs: document correct flag name
Eric Blake [Fri, 24 Jun 2011 15:02:39 +0000 (09:02 -0600)]
docs: document correct flag name

When adding virDomainGetVcpusFlags in commit ea3f5c6, I did
enough rebasing that the doc comments in libvirt.c no longer
matched the final chosen enum names in libvirt.h.

And now we've gone ahead and deprecated the names
VIR_DOMAIN_VCPU_{LIVE,CONFIG}.

* src/libvirt.c (virDomainGetVcpusFlags): Fix comment.

13 years agoRevert "Add new API virDomainBlockPull* to headers"
Eric Blake [Thu, 23 Jun 2011 21:40:48 +0000 (15:40 -0600)]
Revert "Add new API virDomainBlockPull* to headers"

This reverts commit 7d56a16d036d9aa7292e10e884c129742036f8a7.

Conflicts:

python/generator.py
src/libvirt_public.syms

13 years agoRevert "virDomainBlockPull: Implement the main entry points"
Eric Blake [Thu, 23 Jun 2011 21:31:37 +0000 (15:31 -0600)]
Revert "virDomainBlockPull: Implement the main entry points"

This reverts commit 6419f596e114ee9f372136cc2b9eb19f1cbb7a77.

13 years agoRevert "Add virDomainBlockPull support to the remote driver"
Eric Blake [Thu, 23 Jun 2011 21:31:30 +0000 (15:31 -0600)]
Revert "Add virDomainBlockPull support to the remote driver"

This reverts commit d1693bb160ea78954592c45a40eb856190c619c8.

Conflicts:

daemon/remote.c
src/remote/remote_driver.c
src/remote/remote_protocol.x

13 years agoRevert "Implement virDomainBlockPull for the qemu driver"
Eric Blake [Thu, 23 Jun 2011 17:58:21 +0000 (11:58 -0600)]
Revert "Implement virDomainBlockPull for the qemu driver"

This reverts commit 784ee08d2220d2a77424d5fc756b6eebe8efd5fa.

13 years agoRevert "Enable the virDomainBlockPull API in virsh"
Eric Blake [Thu, 23 Jun 2011 17:57:00 +0000 (11:57 -0600)]
Revert "Enable the virDomainBlockPull API in virsh"

This reverts commit 3e2493ce28b7e20416e916fdf893a9569c267925.

13 years agoRevert "Enable virDomainBlockPull in the python API."
Eric Blake [Thu, 23 Jun 2011 17:56:54 +0000 (11:56 -0600)]
Revert "Enable virDomainBlockPull in the python API."

This reverts commit d74b86f5d6ecae3d18a391f90a918fcac75914db.

Conflicts:

python/generator.py

13 years agoRevert "Asynchronous event for BlockPull completion"
Eric Blake [Thu, 23 Jun 2011 17:54:19 +0000 (11:54 -0600)]
Revert "Asynchronous event for BlockPull completion"

This reverts commit 12cd77a0c58a80179182f7d09e8e73f9f66b4677.

Conflicts:

python/libvirt-override-virConnect.py
python/libvirt-override.c
src/remote/remote_protocol.x

13 years agobuild: avoid python 2.4 build failure
Eric Blake [Fri, 24 Jun 2011 04:17:19 +0000 (22:17 -0600)]
build: avoid python 2.4 build failure

I'm not sure when Py_ssize_t was introduced; but Fedora 14 Python 2.7
has it, while RHEL 5 Python 2.4 lacks it.  It should be easy enough
to adjust if someone runs into problems.

* python/typewrappers.h (Py_ssize_t): Define for older python.

13 years agobuild: fix NUMA build on RHEL 5
Eric Blake [Fri, 24 Jun 2011 03:53:08 +0000 (21:53 -0600)]
build: fix NUMA build on RHEL 5

Use NUMA's older nodemask_t (fixed-size map) rather than the newer
'struct bitmask' (variable-size) in order to still compile on RHEL 5,
with its numactl-devel-0.9.8.

* src/qemu/qemu_process.c [HAVE_NUMA]: Prefer back-compat mode.
(qemuProcessInitNumaMemoryPolicy): Use older nodemask_t.

13 years agoAdd Memory Device Information to virSysinfoRead() from dmidecode type 17
Minoru Usui [Fri, 24 Jun 2011 06:05:48 +0000 (14:05 +0800)]
Add Memory Device Information to virSysinfoRead() from dmidecode type 17

* src/util/sysinfo.[ch]: also parse and save all the SMBIOS informations
  about memory modules

13 years agoAdd Processor Information to virSysinfoRead() from dmidecode type 4
Minoru Usui [Fri, 24 Jun 2011 05:42:02 +0000 (13:42 +0800)]
Add Processor Information to virSysinfoRead() from dmidecode type 4

* src/util/sysinfo.c: add parsing and formatting of processor
  information data

13 years agoCleanup virSysinfoRead()
Minoru Usui [Thu, 23 Jun 2011 10:04:26 +0000 (18:04 +0800)]
Cleanup virSysinfoRead()

* src/util/sysinfo.c: Separate BIOSInfo and SystemInfo part from
                      virSysinfoRead()

13 years agoMake sure virnetprotocol.[ch] are in BUILT_SOURCES
Daniel P. Berrange [Fri, 24 Jun 2011 14:04:11 +0000 (15:04 +0100)]
Make sure virnetprotocol.[ch] are in BUILT_SOURCES

To ensure virnetprotocol.[ch] are generated before any other
files, add them to BUILT_SOURCES and MAINTAINERCLEANFILES.
At the same time, move ESX_DRIVER_GENERATED out of DISTCLEAN
and into MAINTAINERCLEANFILES, since they are included in
EXTRA_DIST

* src/Makefile.am: Add virnetprotocol.[ch] to BUILT_SOURCES

13 years agomaint: typo fixes
Eric Blake [Fri, 24 Jun 2011 14:01:10 +0000 (08:01 -0600)]
maint: typo fixes

* src/xenxs/xen_sxpr.c (xenParseSxprPCI): Comment fix.
* tests/object-locking.ml (driverTables): Likewise.
* tests/testutils.c (virtTestDifferenceBin): Likewise.

13 years agoFix some bugs in RPC protocol make rules
Daniel P. Berrange [Fri, 24 Jun 2011 13:37:25 +0000 (14:37 +0100)]
Fix some bugs in RPC protocol make rules

The Makefile.am rules for generating RPC protocol had a couple
of bugs

 - A instance of remote/rpcgen_fix.pl  was not changed
   to rpc/genprotocol.pl
 - A dep from rpc/virnetmessage.h on the generated
   rpc/virnetprotocol.h was missing
 - The generated rpc/virnetprotocol.[ch] were not listed
   in MAINTAINERCLEANFILES

* Makefile.am: Fix RPC protocol generation

13 years agoAdd missing translation of error message from QEMU reboot patch
Daniel P. Berrange [Fri, 24 Jun 2011 11:20:20 +0000 (12:20 +0100)]
Add missing translation of error message from QEMU reboot patch

* src/qemu/qemu_process.c: Add missing _(...)

13 years agoFix job type set in qemuMigrationPrepareDirect/PrepareTunnel
Daniel P. Berrange [Thu, 23 Jun 2011 09:58:18 +0000 (10:58 +0100)]
Fix job type set in qemuMigrationPrepareDirect/PrepareTunnel

The qemuMigrationPrepareDirect/PrepareTunnel methods accidentally
set the domain job to  QEMU_JOB_MIGRATION_OUT when it should have
been  QEMU_JOB_MIGRATION_IN. This didn't have any ill-effect, but
it is none-the-less wrong.

* src/qemu/qemu_migration.c: Fix job type

13 years agoAvoid high privileges taint warning for QEMU session driver
Daniel P. Berrange [Thu, 23 Jun 2011 10:40:24 +0000 (11:40 +0100)]
Avoid high privileges taint warning for QEMU session driver

The code emitting taint warnings was mistakenly thinking
that guests run from the QEMU session driver were tainted
for having high privileges. This is of course nonsense
since the session driver is always unprivileged

* src/qemu/qemu_domain.c: Don't warn for high privileges in
  non-privileged QEMU

13 years agoAllow automatic kill of guests when a connection is closed
Daniel P. Berrange [Thu, 23 Jun 2011 10:41:57 +0000 (11:41 +0100)]
Allow automatic kill of guests when a connection is closed

If an application is using libvirt + KVM as a piece of its
internal infrastructure to perform a specific task, it can
be desirable to guarentee the VM dies when the virConnectPtr
disconnects from libvirtd. This ensures the app can't leak
any VMs it was using. Adding VIR_DOMAIN_START_AUTOKILL as
a flag when starting guests enables this to be done.

* include/libvirt/libvirt.h.in: All VIR_DOMAIN_START_AUTOKILL
* src/qemu/qemu_driver.c: Support automatic killing of guests
  upon connection close
* tools/virsh.c: Add --autokill flag to 'start' and 'create'
  commands

13 years agoAutomatically kill target QEMU if migration aborts abnormally
Daniel P. Berrange [Thu, 23 Jun 2011 10:03:57 +0000 (11:03 +0100)]
Automatically kill target QEMU if migration aborts abnormally

Migration is a multi-step process

  1. Begin(src)
  2. Prepare(dst)
  3. Perform(src)
  4. Finish(dst)
  5. Confirm(src)

At step 2, a QEMU process is lauched in the destination to
accept the incoming migration. Occasionally the process
that is controlling the migration workflow aborts, and fails
to call step 4, Finish. This leaves a QEMU process running
on the target (albeit with paused CPUs). Unfortunately because
step 2 actives a job on the QEMU process, it is unkillable by
normal means.

By registering the VM for autokill against the src virConnectPtr
in step 2, we can ensure that the guest is forcefully killed off
if the connection is closed without step 4 being invoked

* src/qemu/qemu_migration.c: Register autokill in PrepareDirect
  and PrepareTunnel. Unregister autokill on successful run
  of Finish
* src/qemu/qemu_process.c: Unregister autokill when stopping a
  process

13 years agoAdd infrastructure to automatically destroy guests when a connection closes
Daniel P. Berrange [Thu, 23 Jun 2011 09:37:57 +0000 (10:37 +0100)]
Add infrastructure to automatically destroy guests when a connection closes

Sometimes it is useful to be able to automatically destroy a guest when
a connection is closed. For example, kill an incoming migration if
the client managing the migration dies. This introduces a map between
guest 'uuid' strings and virConnectPtr objects. When a connection is
closed, any associated guests are killed off.

* src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
* src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
  for performing autokill of guests associated with a connection
* src/qemu/qemu_driver.c: Initialize autodestroy map

13 years agoSupport reboots with the QEMU driver
Daniel P. Berrange [Wed, 15 Jun 2011 16:49:58 +0000 (17:49 +0100)]
Support reboots with the QEMU driver

For controlled shutdown we issue a 'system_powerdown' command
to the QEMU monitor. This triggers an ACPI event which (most)
guest OS wire up to a controlled shutdown. There is no equiv
ACPI event to trigger a controlled reboot. This patch attempts
to fake a reboot.

 - In qemuDomainObjPrivatePtr we have a bool fakeReboot
   flag.
 - The virDomainReboot method sets this flag and then
   triggers a normal 'system_powerdown'.
 - The QEMU process is started with '-no-shutdown'
   so that the guest CPUs pause when it powers off the
   guest
 - When we receive the 'POWEROFF' event from QEMU JSON
   monitor if fakeReboot is not set we invoke the
   qemuProcessKill command and shutdown continues
   normally
 - If fakeReboot was set, we spawn a background thread
   which issues 'system_reset' to perform a warm reboot
   of the guest hardware. Then it issues 'cont' to
   start the CPUs again

* src/qemu/qemu_command.c: Add -no-shutdown flag if
  we have JSON support
* src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
  qemuDomainObjPrivate struct
* src/qemu/qemu_driver.c: Fake reboot using the
  system_powerdown command if JSON support is available
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
  binding for system_reset command
* src/qemu/qemu_process.c: Reset the guest & start CPUs if
  fakeReboot is set

13 years agoMove the RPC generator scripts into src/rpc
Daniel P. Berrange [Fri, 10 Dec 2010 12:27:33 +0000 (12:27 +0000)]
Move the RPC generator scripts into src/rpc

Move the daemon/remote_generator.pl to src/rpc/gendispatch.pl
and move the src/remote/rpcgen_fix.pl to src/rpc/genprotocol.pl

* daemon/Makefile.am: Update for new name/location of generator
* src/Makefile.am: Update for new name/location of generator

13 years agoIntroduce generic RPC client objects
Daniel P. Berrange [Wed, 1 Dec 2010 16:35:50 +0000 (16:35 +0000)]
Introduce generic RPC client objects

To facilitate creation of new clients using XDR RPC services,
pull alot of the remote driver code into a set of reusable
objects.

 - virNetClient: Encapsulates a socket connection to a
   remote RPC server. Handles all the network I/O for
   reading/writing RPC messages. Delegates RPC encoding
   and decoding to the registered programs

 - virNetClientProgram: Handles processing and dispatch
   of RPC messages for a single RPC (program,version).
   A program can register to receive async events
   from a client

 - virNetClientStream: Handles generic I/O stream
   integration to RPC layer

Each new client program now merely needs to define the list of
RPC procedures & events it wants and their handlers. It does
not need to deal with any of the network I/O functionality at
all.

13 years agoIntroduce generic RPC module for advertising via MDNS
Daniel P. Berrange [Wed, 2 Mar 2011 17:11:42 +0000 (17:11 +0000)]
Introduce generic RPC module for advertising via MDNS

Allow RPC servers to advertise themselves using MDNS,
via Avahi

* src/rpc/virnetserver.c, src/rpc/virnetserver.h: Allow
  registration of MDNS services via avahi
* src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h: Add
  API to fetch the listen port number
* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add API to
  fetch the local port number
* src/rpc/virnetservermdns.c, src/rpc/virnetservermdns.h: Represent
  an MDNS advertisement

13 years agoIntroduce generic RPC server objects
Daniel P. Berrange [Wed, 1 Dec 2010 16:36:40 +0000 (16:36 +0000)]
Introduce generic RPC server objects

To facilitate creation of new daemons providing XDR RPC services,
pull a lot of the libvirtd daemon code into a set of reusable
objects.

 * virNetServer: A server contains one or more services which
   accept incoming clients. It maintains the list of active
   clients. It has a list of RPC programs which can be used
   by clients. When clients produce a complete RPC message,
   the server passes this onto the corresponding program for
   handling, and queues any response back with the client.

 * virNetServerClient: Encapsulates a single client connection.
   All I/O for the client is handled, reading & writing RPC
   messages.

 * virNetServerProgram: Handles processing and dispatch of
   RPC method calls for a single RPC (program,version).
   Multiple programs can be registered with the server.

 * virNetServerService: Encapsulates socket(s) listening for
   new connections. Each service listens on a single host/port,
   but may have multiple sockets if on a dual IPv4/6 host.

Each new daemon now merely has to define the list of RPC procedures
& their handlers. It does not need to deal with any network related
functionality at all.

13 years agoIntegrate TLS/SASL directly into the socket APIs
Daniel P. Berrange [Fri, 10 Dec 2010 12:22:03 +0000 (12:22 +0000)]
Integrate TLS/SASL directly into the socket APIs

This extends the basic virNetSocket APIs to allow them to have
a handle to the TLS/SASL session objects, once established.
This ensures that any data reads/writes are automagically
passed through the TLS/SASL encryption layers if required.

* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Wire up
  SASL/TLS encryption

13 years agoGeneric module for handling SASL authentication & encryption
Daniel P. Berrange [Fri, 10 Dec 2010 12:21:18 +0000 (12:21 +0000)]
Generic module for handling SASL authentication & encryption

This provides two modules for handling SASL

 * virNetSASLContext provides the process-wide state, currently
   just a whitelist of usernames on the server and a one time
   library init call

 * virNetTLSSession provides the per-connection state, ie the
   SASL session itself. This also include APIs for providing
   data encryption/decryption once the session is established

* src/Makefile.am: Add to libvirt-net-rpc.la
* src/rpc/virnetsaslcontext.c, src/rpc/virnetsaslcontext.h: Generic
  SASL handling code

13 years agoGeneric module for handling TLS encryption and x509 certs
Daniel P. Berrange [Tue, 23 Nov 2010 20:17:41 +0000 (20:17 +0000)]
Generic module for handling TLS encryption and x509 certs

This provides two modules for handling TLS

 * virNetTLSContext provides the process-wide state, in particular
   all the x509 credentials, DH params and x509 whitelists
 * virNetTLSSession provides the per-connection state, ie the
   TLS session itself.

The virNetTLSContext provides APIs for validating a TLS session's
x509 credentials. The virNetTLSSession includes APIs for performing
the initial TLS handshake and sending/recving encrypted data

* src/Makefile.am: Add to libvirt-net-rpc.la
* src/rpc/virnettlscontext.c, src/rpc/virnettlscontext.h: Generic
  TLS handling code

13 years agoIntroduce a generic object for using network sockets
Daniel P. Berrange [Mon, 6 Dec 2010 17:03:35 +0000 (17:03 +0000)]
Introduce a generic object for using network sockets

Introduces a simple wrapper around the raw POSIX sockets APIs
and name resolution APIs. Allows for easy creation of client
and server sockets with correct usage of name resolution APIs
for protocol agnostic socket setup.

It can listen for UNIX and TCP stream sockets.

It can connect to UNIX, TCP streams directly, or indirectly
to UNIX sockets via an SSH tunnel or external command

* src/Makefile.am: Add to libvirt-net-rpc.la
* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Generic
  sockets APIs
* tests/Makefile.am: Add socket test
* tests/virnetsockettest.c: New test case
* tests/testutils.c: Avoid overriding LIBVIRT_DEBUG settings
* tests/ssh.c: Dumb helper program for SSH tunnelling tests

13 years agoProvide a simple object for encoding/decoding RPC messages
Daniel P. Berrange [Mon, 6 Dec 2010 17:03:22 +0000 (17:03 +0000)]
Provide a simple object for encoding/decoding RPC messages

This provides a new struct that contains a buffer for the RPC
message header+payload, as well as a decoded copy of the message
header. There is an API for applying a XDR encoding & decoding
of the message headers and payloads. There are also APIs for
maintaining a simple FIFO queue of message instances.

Expected usage scenarios are:

To send a message

   msg = virNetMessageNew()

   ...fill in msg->header fields..
   virNetMessageEncodeHeader(msg)
   ...loook at msg->header fields to determine payload filter
   virNetMessageEncodePayload(msg, xdrfilter, data)
   ...send msg->bufferLength worth of data from buffer

To receive a message

   msg = virNetMessageNew()
   ...read VIR_NET_MESSAGE_LEN_MAX of data into buffer
   virNetMessageDecodeLength(msg)
   ...read msg->bufferLength-msg->bufferOffset of data into buffer
   virNetMessageDecodeHeader(msg)
   ...look at msg->header fields to determine payload filter
   virNetMessageDecodePayload(msg, xdrfilter, data)
   ...run payload processor

* src/Makefile.am: Add to libvirt-net-rpc.la
* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Internal
  message handling API.
* testutils.c, testutils.h: Helper for printing binary differences
* virnetmessagetest.c: Validate all XDR encoding/decoding

13 years agoDefines the basics of a generic RPC protocol in XDR
Daniel P. Berrange [Mon, 6 Dec 2010 17:03:10 +0000 (17:03 +0000)]
Defines the basics of a generic RPC protocol in XDR

This patch defines the basics of a generic RPC protocol in XDR.
This is wire ABI compatible with the original remote_protocol.x.
It takes everything except for the RPC calls / events from that
protocol

 - The basic header virNetMessageHeader (aka remote_message_header)
 - The error object virNetMessageError  (aka remote_error)
 - Two dummy objects virNetMessageDomain & virNetMessageNetwork
   sadly needed to keep virNetMessageError ABI compatible with
   the old remote_error

The RPC protocol supports method calls, async events and
bidirectional data streams as before

* src/Makefile.am: Add rules for generating RPC code from
  protocol & define a new libvirt-net-rpc.la helper library
* src/rpc/virnetprotocol.x: New generic RPC protocol

13 years agobuild: avoid python 2.4 build failure
Eric Blake [Fri, 24 Jun 2011 04:09:00 +0000 (22:09 -0600)]
build: avoid python 2.4 build failure

On RHEL 5, I got:

/usr/bin/python ./generator.py /usr/bin/python
  File "./generator.py", line 427
    "virStreamFree", # Needed in custom virStream __del__, but free shouldn't
                   ^
SyntaxError: invalid syntax

* python/generator.py (function_skip_python_impl): Use same syntax
as other skip lists.

13 years agobuild: avoid compiler failure
Eric Blake [Fri, 24 Jun 2011 03:57:58 +0000 (21:57 -0600)]
build: avoid compiler failure

GCC complained about a C99 for-loop declaration outside of C99 mode
when compiling on RHEL 5.

* src/qemu/qemu_driver.c (qemudDomainPinVcpuFlags): Avoid C99 for
loop, since gcc 4.1.2 hates it.

13 years agodocumenting the 802.1Qbh parameters of a 'direct' interface
David S. Wang [Thu, 23 Jun 2011 16:35:30 +0000 (09:35 -0700)]
documenting the 802.1Qbh parameters of a 'direct' interface

This patch adds documentation about the 802.1Qbh related parameters
of the virtualport element for 'direct' interfaces.

Signed-off-by: David S. Wang <dwang2@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
13 years agobuild: update to latest gnulib
Eric Blake [Wed, 22 Jun 2011 14:47:11 +0000 (08:47 -0600)]
build: update to latest gnulib

Gnulib has been busy, with 397 commits; it's easier to update now
even without any known libvirt issue to be fixed, rather than
having to analyze an even larger changeset later on.

* .gnulib: Update to latest, for lots of changes.
* bootstrap: Synchronize to upstream.

13 years agobuild: fix compilation on systems missing libnl and new includes
Stefan Berger [Thu, 23 Jun 2011 15:54:11 +0000 (11:54 -0400)]
build: fix compilation on systems missing libnl and new includes

This patch fixes the compilation of netlink.c and interface.c on those
systems missing either libnl or that have an older linux/if_link.h
include file not supporting macvtap or VF_PORTS.

WITH_MACVTAP is '1' if newer include files were detected, '0' otherwise.

IFLA_PORT_MAX is defined in linux/if_link.h if yet more functionality is
supported.

13 years agoconfigure: Make libnl optional unless macvtap is required
Matthias Bolte [Thu, 23 Jun 2011 15:51:00 +0000 (11:51 -0400)]
configure: Make libnl optional unless macvtap is required

If macvtap is required then libnl has to be available, otherwise
libnl is optional.

13 years agopython: Generate virStreamFree but don't expose in bindings
Cole Robinson [Tue, 21 Jun 2011 00:06:49 +0000 (20:06 -0400)]
python: Generate virStreamFree but don't expose in bindings

Turns out I was right in removing this the first time :) This is
needed in our custom __del__ function, but the C code wasn't
being generated. Add new infrastructure to do what we want

13 years agomaint: avoid future setgid problems
Eric Blake [Wed, 22 Jun 2011 22:18:01 +0000 (16:18 -0600)]
maint: avoid future setgid problems

* cfg.mk (sc_prohibit_setuid)
(exclude_file_name_regexp--sc_prohibit_setuid): New rule.
(VC_LIST_ALWAYS_EXCLUDE_REGEX): Always exempt po files.
(exclude_file_name_regexp--sc_prohibit_asprintf): Simplify.
(exclude_file_name_regexp--sc_prohibit_can_not): Drop.
(exclude_file_name_regexp--sc_prohibit_doubled_word): Likewise.

13 years agodocs: Make virConnectClose comply to apibuild.py expectations
Matthias Bolte [Wed, 22 Jun 2011 22:38:58 +0000 (00:38 +0200)]
docs: Make virConnectClose comply to apibuild.py expectations

apibuild.py expects a sentence that starts with "Returns"
describing the return value of a function.

13 years agoutil: Fix memory leak in virJSONParserHandleStartMap
Osier Yang [Thu, 23 Jun 2011 10:16:31 +0000 (18:16 +0800)]
util: Fix memory leak in virJSONParserHandleStartMap

13 years agoqemu: Fix memory leak in qemuProcessWaitForMonitor
Osier Yang [Thu, 23 Jun 2011 10:15:25 +0000 (18:15 +0800)]
qemu: Fix memory leak in qemuProcessWaitForMonitor

Move "VIR_FREE(buf) into label "closelog", so that "buf" could be
freed before returning.

13 years agoqemu: Only check for NUMA availability if required
Jiri Denemark [Tue, 21 Jun 2011 16:37:10 +0000 (18:37 +0200)]
qemu: Only check for NUMA availability if required

We only care about NUMA availability if NUMA configuration is requested
in domain XML.

13 years agostorage: fix volDelete return when volume still being allocated
Matthew Booth [Thu, 23 Jun 2011 03:28:29 +0000 (11:28 +0800)]
storage: fix volDelete return when volume still being allocated

volDelete used to return VIR_ERR_INTERNAL_ERROR when attempting to
delete a volume which was still being allocated. It should return
VIR_ERR_OPERATION_INVALID.

* src/storage/storage_driver.c: Fix return of volDelete.

13 years agoutil: avoid PATH_MAX-sized array
Eric Blake [Wed, 22 Jun 2011 20:52:32 +0000 (14:52 -0600)]
util: avoid PATH_MAX-sized array

See previous patch for why this is good...

* src/util/pci.c (struct _pciDevice, pciGetDevice, pciFreeDevice):
Manage path dynamically.  Report snprintf overflow.
* src/util/hostusb.c (struct _usbDevice, usbGetDevice)
(usbFreeDevice): Likewise.

13 years agoxen: avoid PATH_MAX-sized array
Eric Blake [Wed, 22 Jun 2011 20:31:45 +0000 (14:31 -0600)]
xen: avoid PATH_MAX-sized array

See previous patch for why this is good...

* src/xen/xen_driver.h (xenXMConfCache): Manage filename
dynamically.
* src/xen/xm_internal.c (xenXMConfigCacheAddFile)
(xenXMConfigFree, xenXMDomainDefineXML): Likewise.

13 years agotests: avoid PATH_MAX-sized array
Eric Blake [Wed, 22 Jun 2011 20:03:30 +0000 (14:03 -0600)]
tests: avoid PATH_MAX-sized array

See previous patch for why this is good...

* src/test/test_driver.c (struct _testConn, testOpenFromFile)
(testClose): Manage path dynamically.

13 years agovirStorageVol: avoid PATH_MAX-sized array
Eric Blake [Wed, 22 Jun 2011 19:51:32 +0000 (13:51 -0600)]
virStorageVol: avoid PATH_MAX-sized array

POSIX allows implementations where PATH_MAX is undefined, leading
to compilation error.  Not to mention that even if it is defined,
it is often wasteful in relation to the amount of data being stored.

All clients of vol->key were audited, and found not to care about
whether key is static or dynamic, except for these offenders:

* src/datatypes.h (struct _virStorageVol): Manage key dynamically.
* src/datatypes.c (virReleaseStorageVol): Free key.
(virGetStorageVol): Copy key.

13 years agomaint: add omitted copyright header
Eric Blake [Wed, 22 Jun 2011 21:42:51 +0000 (15:42 -0600)]
maint: add omitted copyright header

Bug introduced in commit 6a597883.

* src/util/netlink.h: Add boilerplate.

13 years agodocs: fix docs to match behavior of virConnectClose
Eric Blake [Wed, 22 Jun 2011 16:17:04 +0000 (10:17 -0600)]
docs: fix docs to match behavior of virConnectClose

* src/libvirt.c (virConnectClose): Mention reference count return.
Reported by Michal Novotny, analyzed by Matthias Bolte.

13 years agocleanup: make several interface functions commonly available
Stefan Berger [Wed, 22 Jun 2011 18:28:57 +0000 (14:28 -0400)]
cleanup: make several interface functions commonly available

In a second cleanup step this patch makes several interface functions from macvtap.c commonly available by moving them into interface.c and prefixing their names with 'iface'. Those functions taking Linux-specific structures as parameters are only visible on Linux.

ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr call and display an error message if setting the MAC address did not work. The caller is unchanged and still ignores the return code (which is ok).

13 years agocleanup: make nlComm commonly available
Stefan Berger [Wed, 22 Jun 2011 18:17:36 +0000 (14:17 -0400)]
cleanup: make nlComm commonly available

In a first cleanup step, make nlComm from macvtap.c commonly available
for other code to use. Since nlComm uses Linux-specific structures as
parameters it's prototype is only visible on Linux.

13 years agomaint: remove syntax-check exception
Eric Blake [Wed, 22 Jun 2011 16:40:24 +0000 (10:40 -0600)]
maint: remove syntax-check exception

We weren't using the @FOO@ notation for a Makefile substitution,
but instead for a sed rule, so using [@]FOO@ instead avoids the
need to exempt this syntax check.

* cfg.mk (_makefile_at_at_check_exceptions): Delete.
* tools/Makefile.am (virt-xml-validate, virt-pki-validate): Avoid
tripping syntax-check.
Reported by Daniel P. Berrange.

13 years agoFix use-after-free in handling domain taint flags
Daniel P. Berrange [Wed, 22 Jun 2011 16:33:10 +0000 (17:33 +0100)]
Fix use-after-free in handling domain taint flags

* src/conf/domain_conf.c: Fix use after free

13 years agoRemove macvtap dependency on domain configuration
Daniel P. Berrange [Mon, 20 Jun 2011 16:08:41 +0000 (17:08 +0100)]
Remove macvtap dependency on domain configuration

Files under src/util must not depend on src/conf
Solve the macvtap problem by moving the definition
of macvtap modes from domain_conf.h into macvtap.h

* src/util/macvtap.c, src/util/macvtap.h: Add enum
  for macvtap modes
* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove
  enum for macvtap modes

13 years agoutil: Correct the error prompt string
Osier Yang [Wed, 22 Jun 2011 11:33:24 +0000 (19:33 +0800)]
util: Correct the error prompt string

virCommandProcessIO: It's reading from stdout or stderr of child,
but not writing.

13 years agoqemu: Fix one memory leak
Osier Yang [Wed, 22 Jun 2011 11:32:04 +0000 (19:32 +0800)]
qemu: Fix one memory leak

* src/qemu/qemu_domain.c: (qemuDomainAppendLog)

  Free "message" in "cleanup".

13 years agoFix to python API extractor and API doc generation
Daniel Veillard [Mon, 20 Jun 2011 03:25:34 +0000 (11:25 +0800)]
Fix to python API extractor and API doc generation

This fixes a number of issues most of them raised by Eric Blake on the
generated documentation output:
   - parsing of "long long int" and similar
   - add parsing of unions within a struct
   - remove spurious " * " fron comments on structure fields and enums
   - fix concatenation of base type and name in arrays
   - extend XSLT to cope with union in structs

* docs/apibuild.py: fix and extend API extraction tool
* docs/newapi.xsl: extend the stylesheets to cope with union in
  public structures

13 years agoqemu: domain I/O asynchronous handling
Michal Privoznik [Mon, 20 Jun 2011 08:26:47 +0000 (10:26 +0200)]
qemu: domain I/O asynchronous handling

For virtio disks and interfaces, qemu allows users to enable or disable
ioeventfd feature. This means, qemu can execute domain code, while
another thread waits for I/O event. Basically, in some cases it is win,
in some loss. This feature is available via 'ioeventfd' attribute in disk
and interface <driver> element. It accepts 'on' and 'off'. Leaving this
attribute out defaults to hypervisor decision.

13 years agobuild: require newer netcf when it is available
Eric Blake [Mon, 20 Jun 2011 15:41:49 +0000 (09:41 -0600)]
build: require newer netcf when it is available

When building rpms for newer Fedora or RHEL, take advantage of the
newer netcf packaging to guarantee interface snapshot support.

* libvirt.spec.in (BuildRequires): Bump minimum version on
platforms that support netcf 0.1.8.

13 years agovirsh: avoid bogus description
Eric Blake [Mon, 20 Jun 2011 20:25:08 +0000 (14:25 -0600)]
virsh: avoid bogus description

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

Gettext reserves the empty string for internal use, and it must
not be passed through _().  We were violating this for commands
that (for whatever reason) used "" for their description.

* tools/virsh.c (vshCmddefHelp): Don't translate empty string.
Reported by Tatsuo Kawasaki.