]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoAUTHORS: add recent contributors
Eric Blake [Mon, 8 Mar 2010 21:59:52 +0000 (14:59 -0700)]
AUTHORS: add recent contributors

15 years agohacking: add a section on preprocessor conventions
Eric Blake [Tue, 9 Mar 2010 00:02:45 +0000 (17:02 -0700)]
hacking: add a section on preprocessor conventions

* doc/hacking.html.in (preprocessor): New section to document
recently-discussed style issues.

Signed-off-by: Eric Blake <eblake@redhat.com>
15 years agohacking: fix typos
Eric Blake [Tue, 9 Mar 2010 00:02:44 +0000 (17:02 -0700)]
hacking: fix typos

* docs/hacking.html.in (committers): Fix spelling and grammar.

15 years agoFix format string warnings
Laine Stump [Tue, 9 Mar 2010 13:32:06 +0000 (14:32 +0100)]
Fix format string warnings

A few more non-literal format strings in error log messages have crept
in. Fix them in the standard way - turn the format string into "%s"
with the original string as the arg.

15 years agomacvtap build detection fix
Stefan Berger [Tue, 9 Mar 2010 13:14:48 +0000 (14:14 +0100)]
macvtap build detection fix

* configure.ac: fix the header test used for macvtap availability
  detection

15 years agoFix virDomainGetXMLDesc cache settings output
Soren Hansen [Tue, 9 Mar 2010 12:59:51 +0000 (13:59 +0100)]
Fix virDomainGetXMLDesc cache settings output

If a special cache strategy for a disk has been specified in a domain
definition, but no driverName has been set, virDomainGetXMLDesc would not
include the <driver> tag at all.

* src/conf/domain_conf.c: make sure any <driver> tag setting is
  serialized if set.

15 years agoUpdate hacking.html.in
David Allan [Mon, 8 Mar 2010 15:26:30 +0000 (10:26 -0500)]
Update hacking.html.in

* Added section on use of goto
* Added missing content from HACKING document

15 years agoGet thread and socket information in virsh nodeinfo.
Chris Lalancette [Thu, 4 Mar 2010 22:28:40 +0000 (17:28 -0500)]
Get thread and socket information in virsh nodeinfo.

The current code for "nodeinfo" is pretty naive
about socket and thread information.  To determine the
sockets, it just takes the number of cpus and divides
by the number of cores.  For the thread count, it always
sets it to 1.  With more recent Intel machines, however,
hyperthreading is again an option, meaning that these
heuristics no longer work and give bogus numbers.  This
patch goes through /sys to get the additional
information so we properly report it.

Note that I had to edit the tests not to report on
socket and thread counts, since these are determined
dynamically now.

v2: As pointed out by Eric Blake, gnulib provides
    count-one-bits (which is LGPLv2+).  Use it instead
    of a hand-coded popcnt.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix locking in qemudDomainMemoryStats
Adam Litke [Mon, 8 Mar 2010 14:15:44 +0000 (15:15 +0100)]
Fix locking in qemudDomainMemoryStats

When adding domainMemoryStats API support for the qemu driver, I didn't
follow the locking rules exactly.  The job condition must be held when
executing monitor commands.  This corrects the segfaults I was seeing
when calling domainMemoryStats in a multi-threaded environment.

* src/qemu/qemu_driver.c: in qemudDomainMemoryStats() add missing
  calls to qemuDomainObjBeginJob/qemuDomainObjEndJob

15 years agoEliminate large stack buffer in doTunnelSendAll
Laine Stump [Mon, 8 Mar 2010 14:01:52 +0000 (15:01 +0100)]
Eliminate large stack buffer in doTunnelSendAll

doTunnelSendAll function (used by QEMU migration) uses a 64k buffer on
the stack, which could be problematic. This patch replaces that with a
buffer from the heap.

While in the neighborhood, this patch also improves error reporting in
the case that saferead fails - previously, virStreamAbort() was called
(resetting errno) before reporting the error. It's been changed to
report the error first.

* src/qemu/qemu_driver.c: fix doTunnelSendAll() to use a malloc'ed
  buffer

15 years agobuild: consistently use C99 varargs macros
Eric Blake [Mon, 1 Mar 2010 23:38:28 +0000 (16:38 -0700)]
build: consistently use C99 varargs macros

Prior to this patch, there was an inconsistent mix between GNU and C99.

For consistency, and potential portability to other compilers, stick
with the C99 vararg macro syntax.

* src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
  vararg macro syntax.
* src/conf/domain_conf.c (virDomainReportError): Likewise.
* src/conf/domain_event.c (eventReportError): Likewise.
* src/conf/interface_conf.c (virInterfaceReportError): Likewise.
* src/conf/network_conf.c (virNetworkReportError): Likewise.
* src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
* src/conf/secret_conf.h (virSecretReportError): Likewise.
* src/conf/storage_conf.h (virStorageReportError): Likewise.
* src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
  GNU vararg macro syntax.
* src/esx/esx_driver.c (ESX_ERROR): Likewise.
* src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
* src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
* src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
* src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
* src/esx/esx_util.c (ESX_ERROR): Likewise.
* src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
* src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
* src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
* src/esx/esx_vmx.c (ESX_ERROR): Likewise.
* src/util/hostusb.c (usbReportError): Use C99 rather than GNU
  vararg macro syntax.
* src/util/json.c (virJSONError): Likewise.
* src/util/macvtap.c (ReportError): Likewise.
* src/util/pci.c (pciReportError): Likewise.
* src/util/stats_linux.c (virStatsError): Likewise.
* src/util/util.c (virUtilError): Likewise.
* src/util/xml.c (virXMLError): Likewise.
* src/xen/proxy_internal.c (virProxyError): Use C99 rather than
  GNU vararg macro syntax.
* src/xen/sexpr.c (virSexprError): Likewise.
* src/xen/xen_driver.c (xenUnifiedError): Likewise.
* src/xen/xen_hypervisor.c (virXenError): Likewise.
* src/xen/xen_inotify.c (virXenInotifyError): Likewise.
* src/xen/xend_internal.c (virXendError): Likewise.
* src/xen/xm_internal.c (xenXMError): Likewise.
* src/xen/xs_internal.c (virXenStoreError): Likewise.
* src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
  vararg macro syntax.
* src/datatypes.c (virLibConnError): Likewise.
* src/interface/netcf_driver.c (interfaceReportError): Likewise.
* src/libvirt.c (virLibStreamError): Likewise.
* src/lxc/lxc_conf.h (lxcError): Likewise.
* src/network/bridge_driver.c (networkReportError): Likewise.
* src/nodeinfo.c (nodeReportError): Likewise.
* src/opennebula/one_conf.h (oneError): Likewise.
* src/openvz/openvz_conf.h (openvzError): Likewise.
* src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
* src/qemu/qemu_conf.h (qemuReportError): Likewise.
* src/remote/remote_driver.c (errorf): Likewise.
* src/security/security_driver.h (virSecurityReportError): Likewise.
* src/test/test_driver.c (testError): Likewise.
* src/uml/uml_conf.h (umlReportError): Likewise.
* src/vbox/vbox_driver.c (vboxError): Likewise.
* src/vbox/vbox_tmpl.c (vboxError): Likewise.

15 years agoebtablesAddRemoveRule: avoid dead store
Jim Meyering [Fri, 5 Mar 2010 16:36:40 +0000 (17:36 +0100)]
ebtablesAddRemoveRule: avoid dead store

* src/util/ebtables.c (ebtablesAddRemoveRule): Avoid dead store
to local, "s".

15 years agovirInterfaceDefParseBond: avoid dead stores
Jim Meyering [Fri, 5 Mar 2010 15:18:47 +0000 (16:18 +0100)]
virInterfaceDefParseBond: avoid dead stores

* src/conf/interface_conf.c (virInterfaceDefParseBond): Avoid dead stores
to local, "node".  Remove declaration, too.

15 years agoxenXMDomainConfigParse: avoid dead store
Jim Meyering [Fri, 5 Mar 2010 15:15:09 +0000 (16:15 +0100)]
xenXMDomainConfigParse: avoid dead store

* src/xen/xm_internal.c (xenXMDomainConfigParse): Avoid dead store
to local, "data".  Remove declaration, too.

15 years agoqemudDomainAttachSCSIDisk: handle empty controller list
Jim Meyering [Tue, 2 Mar 2010 16:45:10 +0000 (17:45 +0100)]
qemudDomainAttachSCSIDisk: handle empty controller list

* src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): Handle
the (theoretical) case of an empty controller list, so that
clang does not think the subsequent dereference of "cont"
would dereference an undefined variable (due to preceding
loop not iterating even once).

15 years agoqemu restore: don't let corrupt input provoke unwarranted OOM
Jim Meyering [Wed, 3 Mar 2010 10:27:16 +0000 (11:27 +0100)]
qemu restore: don't let corrupt input provoke unwarranted OOM

* src/qemu/qemu_driver.c (qemudDomainRestore): A corrupt save file
(in particular, a too-large header.xml_len value) would cause an
unwarranted out-of-memory error.  Do not trust the just-read
header.xml_len.  Instead, merely use that as a hint, and
read/allocate up to that number of bytes from the file.
Also verify that header.xml_len is positive; if it were negative,
passing it to virFileReadLimFD could cause trouble.

15 years agovirFileReadLimFD: diagnose maxlen <= 0, rather than passing it on...
Jim Meyering [Wed, 3 Mar 2010 10:42:11 +0000 (11:42 +0100)]
virFileReadLimFD: diagnose maxlen <= 0, rather than passing it on...

to saferead_lim, which interprets it as a size_t.
* src/util/util.c (virFileReadLimFD): Do not malfunction when
maxlen < -1.  Return -1,EINVAL in that case.  Handle maxlen==0
in the same manner.

15 years agoxen: don't let bogus packets trigger over-allocation and segfault
Jim Meyering [Wed, 3 Mar 2010 15:50:02 +0000 (16:50 +0100)]
xen: don't let bogus packets trigger over-allocation and segfault

* src/xen/proxy_internal.c (xenProxyDomainDumpXML): An invalid packet
could include a too-large "ans.len" value, which would make us allocate
too much memory and then copy data from beyond the end of "ans",
possibly evoking a segfault.  Ensure that the value we use is no
larger than the remaining portion of "ans".
Also, change unnecessary memmove to memcpy (src and dest obviously
do not overlap, so no need to use memmove).
(xenProxyDomainGetOSType): Likewise.
(xenProxyGetCapabilities): Likewise.

15 years agoqemuMonitorTextGetMemoryStats: decrease risk of false positive in parsing
Jim Meyering [Fri, 5 Mar 2010 14:25:48 +0000 (15:25 +0100)]
qemuMonitorTextGetMemoryStats: decrease risk of false positive in parsing

The code erroneously searched the entire "reply" for a comma, when
its intent was to search only that portion after "balloon: actual="
* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetMemoryStats):
Search for "," only starting *after* the BALLOON_PREFIX string.
Otherwise, we'd be more prone to false positives.

15 years agoRelease of libvirt-0.7.7
Daniel Veillard [Fri, 5 Mar 2010 16:10:21 +0000 (17:10 +0100)]
Release of libvirt-0.7.7

* configure.ac libvirt.spec.in: update with new version
* docs/news.html.in: add list of changes in 0.7.7
* po/*po*: updated spanish and russian localisations, rebuilt

15 years agoFix USB passthrough based on product/vendor
Daniel P. Berrange [Thu, 4 Mar 2010 11:48:16 +0000 (11:48 +0000)]
Fix USB passthrough based on product/vendor

Changeset

  commit 5073aa994af460e775cb3e548528e28d7660fcc8
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Mon Jan 11 11:40:46 2010 -0500

Added support for product/vendor based passthrough, but it only
worked at the security driver layer. The main guest XML config
was not updated with the resolved bus/device ID. When the QEMU
argv refactoring removed use of product/vendor, this then broke
launching guests.

THe solution is to move the product/vendor resolution up a layer
into the QEMU driver. So the first thing QEMU does is resolve
the product/vendor to a bus/device and updates the XML config
with this info. The rest of the code, including security drivers
and QEMU argv generated can now rely on bus/device always being
set.

* src/util/hostusb.c, src/util/hostusb.h: Split vendor/product
  resolution code out of usbGetDevice and into usbFindDevice.
  Add accessors for bus/device ID
* src/security/virt-aa-helper.c, src/security/security_selinux.c,
  src/qemu/qemu_security_dac.c: Remove vendor/product from the
  usbGetDevice() calls
* src/qemu/qemu_driver.c: Use usbFindDevice to resolve vendor/product
  into a bus/device ID

15 years agoConvert QEMU driver all hotunplug code from pci_del to device_del
Daniel P. Berrange [Wed, 3 Mar 2010 15:42:53 +0000 (15:42 +0000)]
Convert QEMU driver all hotunplug code from pci_del to device_del

The pci_del command is not being ported to QMP. Convert all the
QEMU hotplug code over to use device_del whenever it is available
to avoid the pci_del problem

* src/qemu/qemu_driver.c: Convert unplug code to device_del

15 years agoSupport hot-unplug for USB devices in QEMU
Daniel P. Berrange [Wed, 3 Mar 2010 15:10:36 +0000 (15:10 +0000)]
Support hot-unplug for USB devices in QEMU

Previously hot-unplug could not be supported for USB devices
in QEMU, since usb_del required the guest visible address
which libvirt never knows. With 'device_del' command we can
now unplug based on device alias, so support that.

* src/qemu/qemu_driver.c: Use device_del to remove USB devices

15 years agoTweak container initialization to make upstart/init happier
Daniel P. Berrange [Thu, 4 Mar 2010 11:23:28 +0000 (11:23 +0000)]
Tweak container initialization to make upstart/init happier

Upstart crashes & burns in a heap if $TERM environment variable
is missing. Presumably the kernel always sets this when booting
init on a real machine, so libvirt should set it for containers
too.

To make a typical inittab / mingetty setup happier, we need to
symlink the primary console /dev/pts/0 to /dev/tty1.

Improve logging in certain scenarios to make troubleshooting
easier

* src/lxc/lxc_container.c: Create /dev/tty1 and set $TERM

15 years agoMisc fixes for LXC cgroups setup
Daniel P. Berrange [Thu, 4 Mar 2010 11:15:42 +0000 (11:15 +0000)]
Misc fixes for LXC cgroups setup

When using the 'ns' cgroup controller, the moment a process calls
'unshare(CLONE_NEWNS)', it will be given a private cgroup tree
under its current location. This really messages up the LXC
controller process, because it ends up creating the containers'
cgroup in the wrong place. The fix is fairly easy, just move
the cgroup setup before the code which calls unshare(). The
'ns' controller will still create extra undesired cgroups, but
they at least won't break libvirt's setup now.

The patch also adds a missing cgroups allow rule for /dev/tty
device node

15 years agoAvoid creating top level cgroups if just querying for existance
Daniel P. Berrange [Thu, 4 Mar 2010 11:01:52 +0000 (11:01 +0000)]
Avoid creating top level cgroups if just querying for existance

When getting the driver/domain cgroup it is possible to specify
whether it should be auto created. If auto-creation was turned
off, libvirt still mistakenly created its own top level cgroup

* src/util/cgroup.c: Honour autocreate flag for top level cgroup

15 years agoweb docs -- macvtap mode explanation
Stefan Berger [Fri, 5 Mar 2010 14:41:38 +0000 (15:41 +0100)]
web docs -- macvtap mode explanation

This adds more information about the different macvtap device modes,
spells out VEPA and adds a link to a pdf at the ieee site.

15 years agoChange default for storage uid/gid from getuid()/getgid() to -1/-1
Laine Stump [Thu, 4 Mar 2010 22:35:27 +0000 (17:35 -0500)]
Change default for storage uid/gid from getuid()/getgid() to -1/-1

This allows the config to have a setting that means "leave it alone",
eg when building a pool where the directory already exists the user
may want the current uid/gid of the directory left intact. This
actually gets us back to older behavior - before recent changes to the
pool building code, we weren't as insistent about honoring the uid/gid
settings in the XML, and virt-manager was taking advantage of this
behavior.

As a side benefit, removing calls to getuid/getgid from the XML
parsing functions also seems like a good idea. And having a default
that is different from a common/useful value (0 == root) is a good
thing in general, as it removes ambiguity from decisions (at least one
place in the code was checking for (perms.uid == 0) to see if a
special uid was requested).

Note that this will only affect newly created pools and volumes. Due
to the way that the XML is parsed, then formatted for newly created
volumes, all existing pools/volumes already have an explicit uid and
gid set.

src/conf/storage_conf.c: Remove calls to setuid/setgid for default values
                         of uid/gid, and set them to -1 instead

src/storage/storage_backend.c:
src/storage/storage_backend_fs.c:
        Make account for the new default values of perms.uid
        and perms.gid.

15 years agobuild: vbox: avoid build failure when linking with --no-add-needed
Diego Elio Pettenò [Thu, 4 Mar 2010 15:48:10 +0000 (16:48 +0100)]
build: vbox: avoid build failure when linking with --no-add-needed

With the recent changes to the linking defaults in Fedora 13 (namely
enabling --no-add-needed behaviour by default), we have to pass the
dlopen()-providing libraries directly at the link of the module; use the
same AC_SEARCH_LIBS function as used before to look for it and add it to
the Makefile.

15 years agobuild: avoid dlopen-related link failure on rawhide/F13
Diego Elio Pettenò [Thu, 4 Mar 2010 15:45:02 +0000 (16:45 +0100)]
build: avoid dlopen-related link failure on rawhide/F13

Instead of using AC_CHECK_LIB and hardcoding -ldl, search for the library
needed to get dlopen() and then use the cached value.

15 years agoSupport VCPU hotplug in QEMU guests
Daniel P. Berrange [Mon, 8 Feb 2010 16:37:17 +0000 (16:37 +0000)]
Support VCPU hotplug in QEMU guests

QEMU has a monitor command 'set_cpu' which allows a specific
CPU to be toggled between online& offline state. libvirt CPU
hotplug does not work in terms of individual indexes CPUs.
Thus to support this, we iteratively toggle the online state
when the total number of vCPUs is adjusted via libvirt

NB, currently untested since QEMU segvs when running this!

* src/qemu/qemu_driver.c: Toggle online state for CPUs when
  doing hotplug
* 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
  monitor API for toggling a CPU's online status via 'set_cpu

15 years agoFix parser checking of storage pool device
Daniel P. Berrange [Wed, 3 Mar 2010 18:47:12 +0000 (18:47 +0000)]
Fix parser checking of storage pool device

The storage backend implementations all presume that the XML parser
is validating correctness of the source specification. The check for
a source device was lost at some point. This allowed for a potential
crash in the disk backend. Re-introduce the sanity check

* src/conf/storage_conf.c: Re-add check for source device

15 years agoFix mis-leading error message in pool delete API
Daniel P. Berrange [Wed, 3 Mar 2010 18:46:27 +0000 (18:46 +0000)]
Fix mis-leading error message in pool delete API

When trying to delete a pool the error message claimed the volume
could not be deleted.

* src/storage/storage_driver.c: Error message referred to
  volumes instead of pools

15 years agoFix typo in QEMU migration command name
Daniel P. Berrange [Wed, 3 Mar 2010 17:07:50 +0000 (17:07 +0000)]
Fix typo in QEMU migration command name

The QMP code was running query-migration instead of query-migrate.
This doesn't work so well

* src/qemu/qemu_monitor_json.c: s/query-migration/query-migrate/

15 years agoDon't raise error message from cgroups if QEMU fails to start
Daniel P. Berrange [Wed, 3 Mar 2010 15:48:22 +0000 (15:48 +0000)]
Don't raise error message from cgroups if QEMU fails to start

The code to remove the cgroup after QEMU failed to startup could
be obscuring a real error from earlier on. It is not neccessary
to raise an error in this case, so tell cgroups to keep quiet

* src/qemu/qemu_driver.c: Don't raise cgroups error in QEMU start
  cleanup code.

15 years agoAdd missing device type check in QEMU PCI hotunplug
Daniel P. Berrange [Wed, 3 Mar 2010 15:15:21 +0000 (15:15 +0000)]
Add missing device type check in QEMU PCI hotunplug

The QEMU hotunplug code for PCI devices was looking at host
devices in the guest config without first filtering non
PCI devices. This means it was reading garbage

* src/qemu/qemu_driver.c: Filter out non-PCI devices

15 years agoAdd a define for NFS_SUPER_MAGIC
Chris Lalancette [Wed, 3 Mar 2010 16:42:08 +0000 (11:42 -0500)]
Add a define for NFS_SUPER_MAGIC

Commit 3c12a67b766cce51b47861ccde2be41de369f832 added
a dependency on the NFS_SUPER_MAGIC macro, which is
defined in linux/magic.h.  Unfortunately linux/magic.h
is not available in RHEL-5, and causes a compile error.
Just define it locally, since this is something that
can't change.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoMake domain save work on root-squash NFS
Laine Stump [Wed, 3 Mar 2010 16:07:18 +0000 (17:07 +0100)]
Make domain save work on root-squash NFS

Move *all* file operations related to creation and writing of libvirt
header to the domain save file into a hook function that is called by
virFileOperation. First try to call virFileOperation as root. If that
fails with EACCESS, and (in the case of Linux) statfs says that we're
trying to save the file on an NFS share, rerun virFileOperation,
telling it to fork a child process and setuid to the qemu user. This
is the only way we can successfully create a file on a root-squashed
NFS server.

This patch (along with setting dynamic_ownership=0 in qemu.conf)
makes qemudDomainSave work on root-squashed NFS.

* src/qemu/qemu_driver.c: provide new qemudDomainSaveFileOpHook()
  utility, use it in qemudDomainSave() if normal creation of the
  file as root failed, and after checking the filesystem type for
  the storage is NFS. In that case we also bypass the security
  driver, as this would fail on NFS.

15 years agoFix domain restore for files on root-squash NFS
Laine Stump [Wed, 3 Mar 2010 15:38:42 +0000 (16:38 +0100)]
Fix domain restore for files on root-squash NFS

If qemudDomainRestore fails to open the domain save file, create a
pipe, then fork a process that does setuid(qemu_user) and opens the
file, then reads this file and stuffs it into the pipe. the parent
libvirtd process will use the other end of the pipe as its fd, then
reap the child process after it's done reading.

This makes domain restore work on a root-squash NFS share that is only
visible to the qemu user.

* src/qemu/qemu_driver.c: add new qemudOpenAsUID() helper function,
  and use it in qemudDomainRestore() if reading as root directly failed.

15 years agoFix USB/PCI device address aliases in QEMU hotplug driver
Daniel P. Berrange [Mon, 1 Mar 2010 21:06:01 +0000 (21:06 +0000)]
Fix USB/PCI device address aliases in QEMU hotplug driver

The USB/PCI device hotplug code for the QEMU driver was forgetting
to allocate a unique device alias.

* src/qemu/qemu_driver.c: Fill in device alias for USB/PCI devices

15 years agoFix detection of errors in QEMU device_add command
Daniel P. Berrange [Tue, 2 Mar 2010 17:16:30 +0000 (17:16 +0000)]
Fix detection of errors in QEMU device_add command

The code assumed that 'device_add' returned an empty string upon
success. This is not true, it sometimes prints random debug info.
THus we need to check for an explicit fail string

* src/qemu/qemu_monitor_text.c: Fix error checking of the device_add
  monitor command

15 years agoesx: don't ignore failure on close
Eric Blake [Wed, 3 Mar 2010 10:22:46 +0000 (11:22 +0100)]
esx: don't ignore failure on close

Another warning caught by coverity.  Continue to perform best-effort
closing and resource release, but warn the caller about the failure.

* src/esx/esx_driver.c (esxClose): Return an error on failure to close.

15 years agouml: avoid crash on partial read
Eric Blake [Wed, 3 Mar 2010 00:16:05 +0000 (17:16 -0700)]
uml: avoid crash on partial read

Coverity detected a potential dereference of uninitialized memory
if recvfrom got cut short.

* src/uml/uml_driver.c (umlMonitorCommand): Validate complete read
prior to dereferencing res.

15 years agovirsh: silence compiler warning
Eric Blake [Wed, 3 Mar 2010 00:19:01 +0000 (17:19 -0700)]
virsh: silence compiler warning

gcc warns:
virsh.c:1879: warning: '0' flag ignored with '-' flag in gnu_printf format

* tools/virsh.c (cmdDomjobinfo): Delete useless flag.

15 years agoFix safezero()
Jiri Denemark [Tue, 2 Mar 2010 15:11:24 +0000 (16:11 +0100)]
Fix safezero()

Various safezero() implementations used either -1, errno or -errno
return values. This patch fixes them all to return -1 and set errno
appropriately.

There was also a bug in size parameter passed to safewrite() which could
result in an attempt to write gigabytes out of a megabyte buffer.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoFix QEMU domain state after a save attempt fails
Daniel P. Berrange [Thu, 4 Feb 2010 17:19:51 +0000 (17:19 +0000)]
Fix QEMU domain state after a save attempt fails

When a VM save attempt failed, the VM would be left in a paused
state. It is neccessary to resume CPU execution upon failure
if it was running originally

* src/qemu/qemu_driver.c: Resume CPUs upon save failure

15 years agoSupport job cancellation in QEMU driver
Daniel P. Berrange [Wed, 3 Feb 2010 19:11:27 +0000 (19:11 +0000)]
Support job cancellation in QEMU driver

This supports cancellation of jobs for the QEMU driver against
the virDomainMigrate, virDomainSave and virDomainCoreDump APIs.
It is not yet supported for the virDomainRestore API, although
it is desirable.

* src/qemu/qemu_driver.c: Issue 'migrate_cancel' command if
  virDomainAbortJob is issued during a migration operation
* tools/virsh.c: Add a domjobabort command

15 years agoRemote driver implementation for the virDomainAbortJob APi
Daniel P. Berrange [Thu, 4 Feb 2010 16:18:57 +0000 (16:18 +0000)]
Remote driver implementation for the virDomainAbortJob APi

This defines the wire protocol for the new API

* src/remote/remote_protocol.x: Wire protocol definition
* src/remote/remote_driver.c,daemon/remote.c: Client and server
  side implementation
* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
  daemon/remote_dispatch_table.h, src/remote/remote_protocol.c,
  src/remote/remote_protocol.h: Re-generate from remote_protocol.x

15 years agoWire up internal entry points for virDomainAbortJob API
Daniel P. Berrange [Thu, 4 Feb 2010 16:16:35 +0000 (16:16 +0000)]
Wire up internal entry points for virDomainAbortJob API

This provides the internal glue for the driver API

* src/driver.h: Internal API contract
* src/libvirt.c, src/libvirt_public.syms: Connect public API
  to driver API
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/test/test_driver.c src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
  src/xen/xen_driver.c: Stub out entry points

15 years agoIntroduce public API for cancelling async domain jobs
Daniel P. Berrange [Thu, 4 Feb 2010 16:12:01 +0000 (16:12 +0000)]
Introduce public API for cancelling async domain jobs

The new virDomainAbortJob() method provides a way for a second
thread to abort an ongoing job run by another thread. This
extends to any API with  which the virDomainGetJobInfo() API
is intended to work. Cancellation is not guarenteed, rather best
effort on part of the hypervisor and not required to be implmented.

* include/libvirt/libvirt.h.in: Define virDomainAbortJob()

15 years agoAdd QEMU driver support for job info on migration ops
Daniel P. Berrange [Wed, 3 Feb 2010 16:45:05 +0000 (16:45 +0000)]
Add QEMU driver support for job info on migration ops

Introduce support for  virDomainGetJobInfo in the QEMU driver. This
allows for monitoring of any API that uses the 'info migrate' monitor
command. ie virDomainMigrate, virDomainSave and virDomainCoreDump

Unfortunately QEMU does not provide a way to monitor incoming migration
so we can't wire up virDomainRestore yet.

The virsh tool gets a new command 'domjobinfo' to query status

* src/qemu/qemu_driver.c: Record virDomainJobInfo and start time
  in qemuDomainObjPrivatePtr objects. Add generic shared handler
  for calling 'info migrate' with all migration based APIs.
* src/qemu/qemu_monitor_text.c: Fix parsing of 'info migration' reply
* tools/virsh.c: add new 'domjobinfo' command to query progress

15 years agoRemote driver implmentation of job info API
Daniel P. Berrange [Wed, 3 Feb 2010 14:10:13 +0000 (14:10 +0000)]
Remote driver implmentation of job info API

* src/remote/remote_protocol.x: Define wire protocol format
  for virDomainGetJobInfo API
* src/remote/remote_driver.c, daemon/remote.c: Implement client
  and server marshalling code for virDomainGetJobInfo()
* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h
  daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h,
  src/remote/remote_protocol.c, src/remote/remote_protocol.h: Rebuild
  files from src/remote/remote_protocol.x

15 years agoStub out internal driver entry points for job processing
Daniel P. Berrange [Wed, 3 Feb 2010 11:32:24 +0000 (11:32 +0000)]
Stub out internal driver entry points for job processing

The internal glue layer for the new pubic API

* src/driver.h: Define internal driver API contract
* src/libvirt.c, src/libvirt_public.syms: Wire up public
  API to internal driver API
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
  src/xen/xen_driver.c: Stub new entry point

15 years agoIntroduce public API for domain async job handling
Daniel P. Berrange [Wed, 3 Feb 2010 11:31:45 +0000 (11:31 +0000)]
Introduce public API for domain async job handling

Introduce a new public API that provides a way to get progress
info on currently running jobs on a virDomainpPtr. APIs that
are initially within scope of this idea are

 virDomainMigrate
 virDomainMigrateToURI
 virDomainSave
 virDomainRestore
 virDomainCoreDump

These all take a potentially long time and benefit from monitoring.
The virDomainJobInfo struct allows for various pieces of information
to be reported

 - Percentage completion
 - Time
 - Overall data
 - Guest memory data
 - Guest disk/file data

* include/libvirt/libvirt.h.in: Add virDomainGetJobInfo
* python/generator.py, python/libvirt-override-api.xml,
  python/libvirt-override.c: Override for virDomainGetJobInfo API
* python/typewrappers.c, python/typewrappers.h: Introduce wrapper
  for unsigned long long type

15 years agobuild: silence coverity warning in node_device
Eric Blake [Tue, 2 Mar 2010 14:51:57 +0000 (07:51 -0700)]
build: silence coverity warning in node_device

All other uses of get_str_prop in this file that ignored
failure explicitly cast to void.

* src/node_device/node_device_hal.c (dev_create): Silence coverity
warning.

15 years agoFix error messages when parsing USB devices in QEMU
Rolf Eike Beer [Mon, 1 Mar 2010 21:00:37 +0000 (21:00 +0000)]
Fix error messages when parsing USB devices in QEMU

A number of the error messages raised when parsing USB devices
refered to PCI devices by mistake

* src/qemu/qemu_conf.c: s/PCI/USB/ in qemuParseCommandLineUSB()

15 years agoFix USB hotplug device string in QEMU driver
Rolf Eike Beer [Mon, 1 Mar 2010 20:59:05 +0000 (20:59 +0000)]
Fix USB hotplug device string in QEMU driver

The USB hotplug method was mistakenly generating a PCI address
string

* src/qemu/qemu_driver.c: Fix USB hotplug device string

15 years agoUse device_del to remove SCSI controllers
Wolfgang Mauerer [Tue, 2 Mar 2010 08:40:51 +0000 (09:40 +0100)]
Use device_del to remove SCSI controllers

when the underlying qemu supports the drive/device model and the
controller has been added this way.
* src/qemu/qemu_driver.c: use qemuMonitorDelDevice() when detaching
  PCI controller and if supported
* src/qemu/qemu_monitor.[ch]: add new qemuMonitorDelDevice() function
* src/qemu/qemu_monitor_json.[ch]: JSON backend for DelDevice command
* src/qemu/qemu_monitor_text.[ch]: Text backend for DelDevice command

15 years agoFix PCI address handling when controllers are deleted
Wolfgang Mauerer [Tue, 2 Mar 2010 08:28:26 +0000 (09:28 +0100)]
Fix PCI address handling when controllers are deleted

* src/qemu/qemu_driver.c: in qemudDomainDetachPciControllerDevice()
  when a controller is not present in the system anymore, the PCI
  address must be deleted from libvirt's hashtable because it can
  be re-used for other purposes.

15 years agoFix data structure handling when controllers are attached
Wolfgang Mauerer [Tue, 2 Mar 2010 08:24:59 +0000 (09:24 +0100)]
Fix data structure handling when controllers are attached

* src/qemu/qemu_driver.c: in qemudDomainAttachDevice(), one must not
  delete the data part when the operation succeeds because it is
  required later on. The correct pattern to handlethe parsed
  representation of the device information on success
  is dev->data.controller = NULL; virDomainDeviceDefFree(dev);,
  which leaves the structure pointed at by data in memory.

15 years agoTiny spelling fix
Wolfgang Mauerer [Tue, 2 Mar 2010 08:21:48 +0000 (09:21 +0100)]
Tiny spelling fix

15 years agolibvirtd: avoid false-positive NULL-deref warning from clang
Eric Blake [Mon, 1 Mar 2010 18:59:43 +0000 (11:59 -0700)]
libvirtd: avoid false-positive NULL-deref warning from clang

* daemon/libvirtd.c (qemudWorker): Rewrite loop to silence a
warning.

15 years agox86Decode: avoid NULL-dereference upon questionable input
Jim Meyering [Sun, 28 Feb 2010 12:34:06 +0000 (13:34 +0100)]
x86Decode: avoid NULL-dereference upon questionable input

* src/cpu/cpu_x86.c (x86Decode): Don't dereference NULL when passed
a NULL "models" pointer, or when passed a nonzero "nmodels" value
and a corresponding NULL models[i].

15 years agophypUUIDTable_Push: do not corrupt output stream upon partial write
Jim Meyering [Mon, 1 Mar 2010 20:26:59 +0000 (21:26 +0100)]
phypUUIDTable_Push: do not corrupt output stream upon partial write

* src/phyp/phyp_driver.c (phypUUIDTable_Push): Move incr/decr
of ptr/nread into the loop where those variables are used.
Also, remove "exit" label and just-preceding "goto".

15 years agoopenvzDomainDefineCmd: remove useless increment
Jim Meyering [Mon, 1 Mar 2010 20:38:06 +0000 (21:38 +0100)]
openvzDomainDefineCmd: remove useless increment

* src/openvz/openvz_driver.c (openvzDomainDefineCmd): Remove
useless increment of "max_veid".

15 years agomaint: disallow TAB-in-indentation also in *.rng files
Jim Meyering [Mon, 1 Mar 2010 19:05:06 +0000 (20:05 +0100)]
maint: disallow TAB-in-indentation also in *.rng files

* cfg.mk (sc_TAB_in_indentation): Also check .rng files.

15 years agomaint: convert leading TABs in *.rng files to equivalent spaces
Jim Meyering [Mon, 1 Mar 2010 19:09:26 +0000 (20:09 +0100)]
maint: convert leading TABs in *.rng files to equivalent spaces

* docs/schemas/capability.rng: Likewise.
* docs/schemas/network.rng: Likewise.
* docs/schemas/nodedev.rng: Likewise.
* docs/schemas/storagepool.rng: Likewise.
* docs/schemas/storagevol.rng: Likewise.
Use these commands:
t=$'\t'
git ls-files | grep '\.rng$' | xargs grep -lE "^ *$t" \
  | xargs perl -MText::Tabs -ni -le \
    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'

15 years agoExpand docs about clock modes
Daniel P. Berrange [Tue, 2 Feb 2010 18:46:52 +0000 (18:46 +0000)]
Expand docs about clock modes

* formatdomain.html.in: Document new clock options

15 years agoAllow configurable timezones with QEMU
Daniel P. Berrange [Tue, 2 Feb 2010 18:37:33 +0000 (18:37 +0000)]
Allow configurable timezones with QEMU

Allow an arbitrary timezone with QEMU by setting the $TZ environment
variable when launching QEMU

* src/qemu/qemu_conf.c: Set TZ environment variable if a timezone
  is requested
* tests/qemuxml2argvtest.c: Add test case for timezones
* tests/qemuxml2argvdata/qemuxml2argv-clock-france.xml,
  tests/qemuxml2argvdata/qemuxml2argv-clock-france.args: Data
  for timezone tests

15 years agoAllow a timezone to be specified instead of sync to host timezone
Daniel P. Berrange [Tue, 2 Feb 2010 18:28:44 +0000 (18:28 +0000)]
Allow a timezone to be specified instead of sync to host timezone

This extends the XML to allow for

  <clock offset='timezone' timezone='Europe/Paris'/>

This is useful if the admin has not configured any timezone on the
host OS, but still wants to synchronize a guest to a specific one.

* src/conf/domain_conf.h, src/conf/domain_conf.c: Support extra
  'timezone' attribute on clock configuration
* docs/schemas/domain.rng: Add 'timezone' attribute
* src/xen/xend_internal.c, src/xen/xm_internal.c: Reject configs
  with a configurable timezone

15 years agoSupport variable clock offset mode in QEMU
Daniel P. Berrange [Tue, 2 Feb 2010 18:07:12 +0000 (18:07 +0000)]
Support variable clock offset mode in QEMU

This allows QEMU guests to be started with an arbitrary clock
offset

The test case can't actually be enabled, since QEMU argv expects
an absolute timestring, and this will obviously change every
time the test runs :-( Hopefully QEMU will allow a relative
time offset in the future.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Use the -rtc arg
  if available to support variable clock offset mode
* tests/qemuhelptest.c: Add QEMUD_CMD_FLAG_RTC for qemu 0.12.1
* qemuxml2argvdata/qemuxml2argv-clock-variable.args,
  qemuxml2argvdata/qemuxml2argv-clock-variable.xml,
  qemuxml2argvtest.c: Test case, except we can't actually enable
  it yet.

15 years agoAdd new clock mode allowing variable adjustments
Daniel P. Berrange [Tue, 2 Feb 2010 17:49:09 +0000 (17:49 +0000)]
Add new clock mode allowing variable adjustments

This introduces a third option for clock offset synchronization,
that allows an arbitrary / variable adjustment to be set. In
essence the XML contains the time delta in seconds, relative to
UTC.

  <clock offset='variable' adjustment='123465'/>

The difference from 'utc' mode, is that management apps should
track adjustments and preserve them at next reboot.

* docs/schemas/domain.rng: Schema for new clock mode
* src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
  new clock time delta
* src/libvirt_private.syms, src/util/xml.c, src/util/xml.h: Add
  virXPathLongLong() method

15 years agoChange the internal domain conf representation of localtime/utc
Daniel P. Berrange [Tue, 2 Feb 2010 17:22:03 +0000 (17:22 +0000)]
Change the internal domain conf representation of localtime/utc

The XML will soon be extended to allow more than just a simple
localtime/utc boolean flag. This change replaces the plain
'int localtime' with a separate struct to prepare for future
extension

* src/conf/domain_conf.c, src/conf/domain_conf.h: Add a new
  virDomainClockDef structure
* src/libvirt_private.syms: Export virDomainClockOffsetTypeToString
  and virDomainClockOffsetTypeFromString
* src/qemu/qemu_conf.c, src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
  src/xen/xm_internal.c: Updated to use new structure for localtime

15 years agoudevEnumerateDevices: remove dead code
Jim Meyering [Mon, 1 Mar 2010 15:14:35 +0000 (16:14 +0100)]
udevEnumerateDevices: remove dead code

* src/node_device/node_device_udev.c (udevEnumerateDevices): Remove
unnecessary call to udev_list_entry_get_name.

15 years agoqemudNetworkIfaceConnect: remove dead store
Jim Meyering [Mon, 1 Mar 2010 14:59:42 +0000 (15:59 +0100)]
qemudNetworkIfaceConnect: remove dead store

* src/qemu/qemu_conf.c (qemudNetworkIfaceConnect): Remove extraneous
virSaveLastError call, whose result was unused.

15 years agocmdPoolDiscoverSources: initialize earlier to avoid FP from clang
Jim Meyering [Mon, 1 Mar 2010 14:41:15 +0000 (15:41 +0100)]
cmdPoolDiscoverSources: initialize earlier to avoid FP from clang

* tools/virsh.c (cmdPoolDiscoverSources): Always initialize srcSpec.
Otherwise, clang would report that srcSpec could be used uninitialized
in the call to virConnectFindStoragePoolSources.

15 years agoqemu: avoid null dereference on failed migration
Eric Blake [Mon, 1 Mar 2010 14:34:33 +0000 (15:34 +0100)]
qemu: avoid null dereference on failed migration

* src/qemu/qemu_monitor_text.c: qemuMonitorTextGetMigrationStatus: Check for
  failed strchr, to silence a coverity warning.

15 years agoFree the macvtap mode string
Stefan Berger [Mon, 1 Mar 2010 12:09:42 +0000 (13:09 +0100)]
Free the macvtap mode string

* src/conf/domain_conf.c: forgot to free the attribute value in
  virDomainNetDefParseXML()

15 years agoUpdate of indian, spanish and russian translations
Daniel Veillard [Mon, 1 Mar 2010 11:14:23 +0000 (12:14 +0100)]
Update of indian, spanish and russian translations

and regeneration of the po/pot files

15 years agoRevert fs pool formatting
David Allan [Fri, 26 Feb 2010 08:32:17 +0000 (03:32 -0500)]
Revert fs pool formatting

* We are reverting this patch pending a discussion of the right way to implement.

15 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 26 Feb 2010 16:14:01 +0000 (17:14 +0100)]
build: update gnulib submodule to latest

* .gnulib: Update to latest.
Commit 89bdf84bcd9c6032e37 inadvertently rewound the .gnulib
submodule by 51 commits.  This corrects it.
Spotted by Eric Blake.

15 years agobuild: avoid warning about return-with-value in void function
Jim Meyering [Fri, 26 Feb 2010 10:50:34 +0000 (11:50 +0100)]
build: avoid warning about return-with-value in void function

* tools/virsh.c: Just "return;", not "return NULL;".

15 years agolibvirtd: do not ignore failure to set group ID in privileged mode
Jim Meyering [Fri, 26 Feb 2010 09:42:14 +0000 (10:42 +0100)]
libvirtd: do not ignore failure to set group ID in privileged mode

* daemon/libvirtd.c (qemudListenUnix): Diagnose and fail upon
failure to set or restore group-ID.

15 years agoOnly build virDomainObjFormat if not building proxy.
Chris Lalancette [Wed, 24 Feb 2010 20:45:16 +0000 (15:45 -0500)]
Only build virDomainObjFormat if not building proxy.

While building under RHEL-5, I got a compile warning because
virDomainObjFormat was defined but not used.  That came about
because in RHEL-5 we build with "#define PROXY", and
virDomainObjFormat is only used with !PROXY.  Move the
define.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoopenvzGetVEID: don't leak (memory + file descriptor)
Jim Meyering [Thu, 25 Feb 2010 18:24:50 +0000 (19:24 +0100)]
openvzGetVEID: don't leak (memory + file descriptor)

* src/openvz/openvz_conf.c (openvzGetVEID): Always call fclose.
Diagnose parse failure also when vzlist output is empty.
If somehow we read a -1, diagnose that (albeit as a parse failure).

15 years agoUse standard spacing for user/pass prompt
Cole Robinson [Wed, 24 Feb 2010 19:19:28 +0000 (14:19 -0500)]
Use standard spacing for user/pass prompt

Kind of minor, but it annoys me that the default auth callback
doesn't put a space between the prompt and the input, like a typical
terminal, ssh, etc. This patch changes the current prompt:

Please enter your authentication name:myuser

to

Please enter your authentication name: myuser

15 years agolibvirtd: Better initscript error reporting
Cole Robinson [Tue, 23 Feb 2010 23:17:56 +0000 (18:17 -0500)]
libvirtd: Better initscript error reporting

From time to time I bork my install, and hate it when the initscript
returns no info. This patch removes the sanity check, which lets
the shell give us 'command not found' or 'permission denied' errors.

15 years agoqemu: Report binary path if error parsing -help
Cole Robinson [Wed, 24 Feb 2010 16:44:36 +0000 (11:44 -0500)]
qemu: Report binary path if error parsing -help

15 years agoremote: Improve daemon startup error reporting
Cole Robinson [Wed, 24 Feb 2010 16:29:35 +0000 (11:29 -0500)]
remote: Improve daemon startup error reporting

If I toggle enable_tcp in libvirtd.conf and add --listen in
/etc/init.d/libvirtd, I get the unhelpful error:

Starting libvirtd daemon: error: Unable to initialize network sockets.

Running without --daemon provides much more useful info:

sudo libvirtd --listen
11:29:26.117: error : remoteCheckCertFile:270 : Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory

The daemon architecture makes it difficult to report this useful
info if daemonized, so point users to /var/log/messages and
dropping the --daemon flag if they want more info.

15 years agovirsh: Show errors reported by nonAPI functions
Cole Robinson [Wed, 24 Feb 2010 16:13:00 +0000 (11:13 -0500)]
virsh: Show errors reported by nonAPI functions

Only API calls trigger the error callback, which is required for
proper virsh error reporting. Since we use non API functions from
util/, make sure we properly report these errors.

Fixes lack of error message from 'virsh create idontexit.xml'

15 years agoremote: Improve error message when libvirtd isn't running
Cole Robinson [Wed, 24 Feb 2010 13:26:11 +0000 (08:26 -0500)]
remote: Improve error message when libvirtd isn't running

While this could lead people in the wrong direction, people most commonly
hit this error when libvirtd isn't running, so let's mention a possible
fix.

15 years agobuild: avoid warning about unused variables
Jim Meyering [Thu, 25 Feb 2010 13:19:33 +0000 (14:19 +0100)]
build: avoid warning about unused variables

* tools/virsh.c (cmdCPUBaseline): Remove declarations of unused
variables, p and cur.

15 years agobuild: avoid "make rpm" failure in docs/
Jim Meyering [Thu, 25 Feb 2010 09:35:20 +0000 (10:35 +0100)]
build: avoid "make rpm" failure in docs/

Add missing rule to build html/libvirt-libvirt.html.
Use a GNU Make pattern rule to avoid running apibuild.py once
for each out-of-date target, in a parallel build.
* docs/Makefile.am

15 years agobuild: teach apibuild.py to work in a non-srcdir build
Jim Meyering [Wed, 24 Feb 2010 21:51:47 +0000 (22:51 +0100)]
build: teach apibuild.py to work in a non-srcdir build

* docs/Makefile.am (libvirt-api.xml libvirt-refs.xml): Generalize
apibuild.py to work in a non-srcdir build.  Pass "srcdir" to it.
* docs/apibuild.py (rebuild): Honor the $srcdir envvar.

15 years agobuild: avoid non-srcdir "make distcheck" failures (CLEANFILES)
Jim Meyering [Thu, 25 Feb 2010 08:28:51 +0000 (09:28 +0100)]
build: avoid non-srcdir "make distcheck" failures (CLEANFILES)

* docs/Makefile.am (MAINTAINERCLEANFILES): Use this variable
for generated-and-distributed files, not "CLEANFILES".
Besides, "make clean" and "make distclean" should not delete
distributed files.

15 years agobuild: make git submodule checking more reliable
Jim Meyering [Wed, 24 Feb 2010 11:01:09 +0000 (12:01 +0100)]
build: make git submodule checking more reliable

* cfg.mk (_curr_status): Accommodate leading "+" or "-" in the output
of git submodule status.
* autogen.sh: Likewise.

15 years agobuild: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard)
Jim Meyering [Wed, 24 Feb 2010 14:18:51 +0000 (15:18 +0100)]
build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard)

* tests/xencapsdata/Makefile.am: Use $(wildcard in $(srcdir)-aware manner
* tests/xmconfigdata/Makefile.am: Likewise.
* tests/xml2sexprdata/Makefile.am: Likewise.
* tests/sexpr2xmldata/Makefile.am (EXTRA_DIST): Likewise.
* Makefile.am (XML_EXAMPLES): Use $(wildcard in $(srcdir)-aware manner.

15 years agobuild: avoid non-srcdir "make distcheck" failure (test_conf.sh)
Jim Meyering [Wed, 24 Feb 2010 14:01:11 +0000 (15:01 +0100)]
build: avoid non-srcdir "make distcheck" failure (test_conf.sh)

* tests/confdata/Makefile.am (EXTRA_DIST): Apply $(wildcard... to
$(srcdir)/..., and then remove the prefix.

15 years agobuild: avoid non-srcdir installation failure (sitemap.html.in)
Jim Meyering [Wed, 24 Feb 2010 13:15:26 +0000 (14:15 +0100)]
build: avoid non-srcdir installation failure (sitemap.html.in)

* docs/Makefile.am (EXTRA_DIST): Add sitemap.html.in.

15 years agobuild: avoid non-srcdir installation failure (apibuild.py)
Jim Meyering [Wed, 24 Feb 2010 13:18:40 +0000 (14:18 +0100)]
build: avoid non-srcdir installation failure (apibuild.py)

* docs/Makefile.am (libvirt-api.xml): Insert missing "$(srcdir)/".
Also, remove unnecessary sub-shell.