]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
14 years agomaint: avoid long lines in more tests
Eric Blake [Fri, 25 Feb 2011 22:20:58 +0000 (15:20 -0700)]
maint: avoid long lines in more tests

* tests/xml2sexprdata/*.sexpr: Add backslash-newlines.
* tests/sexpr2xmldata/*.sexpr: Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args: Likewise.

14 years agoutil: Allow removing hash entries in virHashForEach
Jiri Denemark [Thu, 3 Mar 2011 13:10:51 +0000 (14:10 +0100)]
util: Allow removing hash entries in virHashForEach

This fixes a possible crash of libvirtd during its startup. When qemu
driver reconnects to running domains, it iterates over all domain
objects in a hash. When reconnecting to an associated qemu monitor
fails and the domain is transient, it's immediately removed from the
hash. Despite the fact that it's explicitly forbidden to do so. If
libvirtd is lucky enough, virHashForEach will access random memory when
the callback finishes and the deamon will crash.

Since it's trivial to fix virHashForEach to allow removal of hash
entries while iterating through them, I went this way instead of fixing
qemuReconnectDomain callback (and possibly others) to avoid deleting the
entries.

14 years agoAttempt to improve an error message
Daniel P. Berrange [Fri, 18 Feb 2011 15:52:20 +0000 (15:52 +0000)]
Attempt to improve an error message

Replace the 'Unknown failure' error message with something a
little bit more descriptive.

* src/util/virterror.c: Improve error message

14 years agoqemu: avoid double close on domain restore
Eric Blake [Wed, 2 Mar 2011 03:59:38 +0000 (20:59 -0700)]
qemu: avoid double close on domain restore

qemudDomainSaveImageStartVM was evil - it closed the incoming fd
argument on some, but not all, code paths, without informing the
caller about that action.  No wonder that this resulted in
double-closes: https://bugzilla.redhat.com/show_bug.cgi?id=672725

* src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Alter
signature, to avoid double-close.
(qemudDomainRestore, qemudDomainObjRestore): Update callers.

14 years agoadd additional event debug points
Daniel P. Berrange [Tue, 1 Mar 2011 23:53:32 +0000 (16:53 -0700)]
add additional event debug points

Followup to commit 2222bd24

14 years agoqemu: only request sound cgroup ACL when required
Eric Blake [Fri, 25 Feb 2011 18:55:44 +0000 (11:55 -0700)]
qemu: only request sound cgroup ACL when required

When a SPICE or VNC graphics controller is present, and sound is
piggybacked over a channel to the graphics device rather than
directly accessing host hardware, then there is no need to grant
host hardware access to that qemu process.

* src/qemu/qemu_cgroup.c (qemuSetupCgroup): Prevent sound with
spice, and with vnc when vnc_allow_host_audio is 0.
Reported by Daniel Berrange.

14 years agoAdd check for kill() to fix build of cgroups on win32
Daniel P. Berrange [Mon, 28 Feb 2011 14:13:58 +0000 (14:13 +0000)]
Add check for kill() to fix build of cgroups on win32

The kill() function doesn't exist on Win32, so it needs to be
checked for at build time & code disabled in cgroups

* configure.ac: Check for kill()
* src/util/cgroup.c: Stub out virCGroupKill* functions
  when kill() isn't available

14 years agoAdd support for multiple serial ports into the Xen driver
Michal Novotny [Fri, 25 Feb 2011 14:41:12 +0000 (15:41 +0100)]
Add support for multiple serial ports into the Xen driver

this is the patch to add support for multiple serial ports to the
libvirt Xen driver. It support both old style (serial = "pty") and
new style (serial = [ "/dev/ttyS0", "/dev/ttyS1" ]) definition and
tests for xml2sexpr, sexpr2xml and xmconfig have been added as well.

Written and tested on RHEL-5 Xen dom0 and working as designed but
the Xen version have to have patch for RHBZ #614004 but this patch
is for upstream version of libvirt.

Also, this patch is addressing issue described in RHBZ #670789.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
14 years agoFix port value parsing for serial and parallel ports
Michal Novotny [Fri, 25 Feb 2011 14:41:11 +0000 (15:41 +0100)]
Fix port value parsing for serial and parallel ports

this is the patch to fix the virDomainChrDefParseTargetXML() functionality
to parse the target port from XML if available. This is necessary for
multiple serial port support which is the second part of this patch.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
14 years agoAdd APIs for killing off processes inside a cgroup
Daniel P. Berrange [Tue, 22 Feb 2011 17:33:59 +0000 (17:33 +0000)]
Add APIs for killing off processes inside a cgroup

The virCgroupKill method kills all PIDs found in a cgroup

The virCgroupKillRecursively method does this recursively
for child cgroups.

The virCgroupKillPainfully method does a recursive kill
several times in a row until everything has really died

14 years agoAllow hash tables to use generic pointers as keys
Daniel P. Berrange [Tue, 22 Feb 2011 15:11:59 +0000 (15:11 +0000)]
Allow hash tables to use generic pointers as keys

Relax the restriction that the hash table key must be a string
by allowing an arbitrary hash code generator + comparison func
to be provided

* util/hash.c, util/hash.h: Allow any pointer as a key
* internal.h: Include stdbool.h as standard.
* conf/domain_conf.c, conf/domain_conf.c,
  conf/nwfilter_params.c, nwfilter/nwfilter_gentech_driver.c,
  nwfilter/nwfilter_gentech_driver.h, nwfilter/nwfilter_learnipaddr.c,
  qemu/qemu_command.c, qemu/qemu_driver.c,
  qemu/qemu_process.c, uml/uml_driver.c,
  xen/xm_internal.c: s/char */void */ in hash callbacks

14 years agoRemove deallocator parameter from hash functions
Daniel P. Berrange [Tue, 22 Feb 2011 15:11:59 +0000 (15:11 +0000)]
Remove deallocator parameter from hash functions

Since the deallocator is passed into the constructor of
a hash table it is not desirable to pass it into each
function again. Remove it from all functions, but provide
a virHashSteal to allow a item to be removed from a hash
table without deleteing it.

* src/util/hash.c, src/util/hash.h: Remove deallocator
  param from all functions. Add virHashSteal
* src/libvirt_private.syms: Add virHashSteal
* src/conf/domain_conf.c, src/conf/nwfilter_params.c,
  src/nwfilter/nwfilter_learnipaddr.c,
  src/qemu/qemu_command.c, src/xen/xm_internal.c: Update
  for changed hash API

14 years agoMake commandtest more robust wrt its execution environment
Daniel P. Berrange [Thu, 24 Feb 2011 12:12:27 +0000 (12:12 +0000)]
Make commandtest more robust wrt its execution environment

When executed from cron, commandtest would fail to correctly
identify daemon processes. Set session ID and process group
IDs at startup to ensure we have a consistent environment to
run in.

* tests/commandtest.c: Call setsid() and setpgid()

14 years agoFix spelling mistake: seek
Philipp Hahn [Thu, 24 Feb 2011 07:06:03 +0000 (08:06 +0100)]
Fix spelling mistake: seek

Replace wrong "set" by correct "seek" in error message.

Signed-off-by: Philipp Hahn <hahn@univention.de>
14 years agoaudit: audit qemu pci and usb device passthrough
Eric Blake [Wed, 23 Feb 2011 23:15:23 +0000 (16:15 -0700)]
audit: audit qemu pci and usb device passthrough

* src/qemu/qemu_audit.h (qemuDomainHostdevAudit): New prototype.
* src/qemu/qemu_audit.c (qemuDomainHostdevAudit): New function.
(qemuDomainStartAudit): Call as appropriate.
* src/qemu/qemu_hotplug.c (qemuDomainAttachHostPciDevice)
(qemuDomainAttachHostUsbDevice, qemuDomainDetachHostPciDevice)
(qemuDomainDetachHostUsbDevice): Likewise.

14 years agoaudit: audit qemu memory and vcpu adjusments
Eric Blake [Tue, 22 Feb 2011 00:02:17 +0000 (17:02 -0700)]
audit: audit qemu memory and vcpu adjusments

* src/qemu/qemu_audit.h (qemuDomainMemoryAudit)
(qemuDomainVcpuAudit): New prototypes.
* src/qemu/qemu_audit.c (qemuDomainResourceAudit)
(qemuDomainMemoryAudit, qemuDomainVcpuAudit): New functions.
(qemuDomainStartAudit): Call as appropriate.
* src/qemu/qemu_driver.c (qemudDomainSetMemory)
(qemudDomainHotplugVcpus): Likewise.

14 years agoaudit: add qemu hooks for auditing cgroup events
Eric Blake [Wed, 16 Feb 2011 02:35:43 +0000 (19:35 -0700)]
audit: add qemu hooks for auditing cgroup events

* src/qemu/qemu_audit.h (qemuDomainCgroupAudit): New prototype.
* src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Implement it.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Add audit.
* src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
(qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
(qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.

14 years agoaudit: prepare qemu for listing vm in cgroup audits
Eric Blake [Wed, 16 Feb 2011 02:18:40 +0000 (19:18 -0700)]
audit: prepare qemu for listing vm in cgroup audits

* src/qemu/qemu_cgroup.h (struct qemuCgroupData): New helper type.
(qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
(qemuTeardownDiskPathDeny): Drop unneeded prototypes.
(qemuSetupDiskCgroup, qemuTeardownDiskCgroup): Adjust prototype.
* src/qemu/qemu_cgroup.c
(qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
(qemuTeardownDiskPathDeny): Mark static and use new type.
(qemuSetupHostUsbDeviceCgroup): Use new type.
(qemuSetupDiskCgroup): Alter signature.
(qemuSetupCgroup): Adjust caller.
* src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
(qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
Likewise.
* src/qemu/qemu_driver.c (qemudDomainAttachDevice)
(qemuDomainUpdateDeviceFlags): Likewise.

14 years agocgroup: determine when skipping non-devices
Eric Blake [Thu, 17 Feb 2011 00:05:54 +0000 (17:05 -0700)]
cgroup: determine when skipping non-devices

* src/util/cgroup.c (virCgroupAllowDevicePath)
(virCgroupDenyDevicePath): Don't fail with EINVAL for
non-devices.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update caller.
* src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
(qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
(qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.

14 years agovirExec: avoid uninitialized memory usage
Eric Blake [Mon, 21 Feb 2011 21:27:04 +0000 (14:27 -0700)]
virExec: avoid uninitialized memory usage

valgrind warns:

==21079== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
==21079==    at 0x329840F63E: __libc_sigaction (sigaction.c:67)
==21079==    by 0x4E5A8E7: __virExec (util.c:661)

Regression introduced in commit ab07533e.  Technically, sa_mask
shouldn't affect operation if sa_flags selects sa_handler, and
sa_handler selects SIG_IGN, but better safe than sorry.

* src/util/util.c (__virExec): Supply missing sigemptyset.

14 years agoAllow 32-on-64 execution for LXC guests
Daniel P. Berrange [Wed, 23 Feb 2011 17:17:53 +0000 (17:17 +0000)]
Allow 32-on-64 execution for LXC guests

Using the 'personality(2)' system call, we can make a container
on an x86_64 host appear to be i686. Likewise for most other
Linux 64bit arches.

* src/lxc/lxc_conf.c: Fill in 32bit capabilities for x86_64 hosts
* src/lxc/lxc_container.h, src/lxc/lxc_container.c: Add API to
  check if an arch has a 32bit alternative
* src/lxc/lxc_controller.c: Set the process personality when
  starting guest

14 years agoPut <stdbool.h> into internal.h so it is available everywhere
Daniel P. Berrange [Wed, 23 Feb 2011 11:37:03 +0000 (11:37 +0000)]
Put <stdbool.h> into internal.h so it is available everywhere

Remove the <stdbool.h> header from all source files / headers
and just put it into internal.h

* src/internal.h: Add <stdbool.h>

14 years agoqemu: Switch over command line capabilities to virBitmap
Jiri Denemark [Tue, 8 Feb 2011 14:22:39 +0000 (15:22 +0100)]
qemu: Switch over command line capabilities to virBitmap

This is done for two reasons:
- we are getting very close to 64 flags which is the maximum we can use
  with unsigned long long
- by using LL constants in enum we already violates C99 constraint that
  enum values have to fit into int

14 years agoqemu: Rename qemud\?CmdFlags to qemuCaps
Jiri Denemark [Tue, 8 Feb 2011 14:28:53 +0000 (15:28 +0100)]
qemu: Rename qemud\?CmdFlags to qemuCaps

The new name complies more with the fact that it contains a set of
qemuCapsFlags.

14 years agoqemu: Use helper functions for handling cmd line capabilities
Jiri Denemark [Tue, 8 Feb 2011 14:08:12 +0000 (15:08 +0100)]
qemu: Use helper functions for handling cmd line capabilities

Three new functions (qemuCapsSet, qemuCapsClear, and qemuCapsGet) were
introduced replacing direct bit operations.

14 years agoqemu: Rename QEMUD_CMD_FLAG_* to QEMU_CAPS_*
Jiri Denemark [Mon, 7 Feb 2011 14:54:08 +0000 (15:54 +0100)]
qemu: Rename QEMUD_CMD_FLAG_* to QEMU_CAPS_*

The new names comply more with the fact that they are all members of
enum qemuCapsFlags.

14 years agoutil: Add API for converting virBitmap into printable string
Jiri Denemark [Wed, 9 Feb 2011 12:14:51 +0000 (13:14 +0100)]
util: Add API for converting virBitmap into printable string

14 years agoutil: Use unsigned long as a base type for virBitmap
Jiri Denemark [Thu, 10 Feb 2011 10:11:15 +0000 (11:11 +0100)]
util: Use unsigned long as a base type for virBitmap

14 years agoExpose name + UUID to LXC containers via env variables
Daniel P. Berrange [Tue, 22 Feb 2011 13:09:19 +0000 (13:09 +0000)]
Expose name + UUID to LXC containers via env variables

When spawning 'init' in the container, set

  LIBVIRT_LXC_UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  LIBVIRT_LXC_NAME=YYYYYYYYYYYY

to allow guest software to detect & identify that they
are in a container

* src/lxc/lxc_container.c: Set LIBVIRT_LXC_UUID and
  LIBVIRT_LXC_NAME env vars

14 years agoFix discard of expected errors
Daniel P. Berrange [Tue, 22 Feb 2011 17:31:35 +0000 (17:31 +0000)]
Fix discard of expected errors

In a couple of commands virsh catches & ignores errors, but fails
to reset last_error. Thus the error is ignored, but still reported
to the user.

* tools/virsh.c: Reset last_error if ignoring an error

14 years agoFix off-by-1 in virFileAbsPath.
Daniel P. Berrange [Tue, 22 Feb 2011 17:08:12 +0000 (17:08 +0000)]
Fix off-by-1 in virFileAbsPath.

The virFileAbsPath was not taking into account the '/' directory
separator when allocating memory for combining cwd + path. Convert
to use virAsprintf to avoid this type of bug completely.

* src/util/util.c: Convert virFileAbsPath to use virAsprintf

14 years agoFix group/mode for /dev/pts inside LXC container
Daniel P. Berrange [Tue, 22 Feb 2011 14:06:09 +0000 (14:06 +0000)]
Fix group/mode for /dev/pts inside LXC container

Normal practice for /dev/pts is to have it mode=620,gid=5
but LXC was leaving mode=000,gid=0 preventing unprivilegd
users in the guest use of PTYs

* src/lxc/lxc_controller.c: Fix /dev/pts setup

14 years agosecurity: avoid memory leak
Eric Blake [Mon, 21 Feb 2011 22:05:24 +0000 (15:05 -0700)]
security: avoid memory leak

Leak introduced in commit d6623003.

* src/qemu/qemu_driver.c (qemuSecurityInit): Avoid leak on failure.
* src/security/security_stack.c (virSecurityStackClose): Avoid
leaking component drivers.

14 years ago802.1Qbh: Delay IFF_UP'ing interface until migration final stage
Roopa Prabhu [Tue, 22 Feb 2011 12:48:54 +0000 (07:48 -0500)]
802.1Qbh: Delay IFF_UP'ing interface until migration final stage

Current code does an IFF_UP on a 8021Qbh interface immediately after a port
profile set. This is ok in most cases except when its the migration prepare
stage. During migration we want to postpone IFF_UP'ing the interface on the
destination host until the source host has disassociated the interface.
This patch moves IFF_UP of the interface to the final stage of migration.
The motivation for this change is to postpone any addr registrations on the
destination host until the source host has done the addr deregistrations.

While at it, for symmetry with associate move ifDown of a 8021Qbh interface
to before disassociate

14 years agostorage: make debug log more useful
Osier Yang [Tue, 22 Feb 2011 02:10:31 +0000 (10:10 +0800)]
storage: make debug log more useful

"__func__" is useless there, as VIR_DEBUG will print the function
name.

* src/storage/storage_backend_mpath.c

14 years agovirsh: replace vshPrint with vshPrintExtra for snapshot list
Osier Yang [Tue, 22 Feb 2011 02:06:08 +0000 (10:06 +0800)]
virsh: replace vshPrint with vshPrintExtra for snapshot list
Otherwise extra information will be printed even if "--quiet"
is specified.

* tools/virsh.c

14 years agocheck device-mapper when building with mpath or disk storage driver
Wen Congyang [Mon, 21 Feb 2011 01:57:24 +0000 (09:57 +0800)]
check device-mapper when building with mpath or disk storage driver

Currently, we need virIsDevMapperDevice() when we build libvirt with
disk or mpath storage drivers.  So we should check device-mapper-devel
when we build with disk storage driver but without mpath storage
driver.

14 years agobuild: add dependency on gnutls-utils
Eric Blake [Mon, 21 Feb 2011 17:43:29 +0000 (10:43 -0700)]
build: add dependency on gnutls-utils

* libvirt.spec.in (Requires): Add gnutls-utils, for virt-pki-validate.
Suggested by Daniel P. Berrange.

14 years agoRenamed functions in xenxs
Markus Groß [Mon, 21 Feb 2011 13:40:12 +0000 (14:40 +0100)]
Renamed functions in xenxs

14 years agoMoved XM formatting functions to xenxs
Markus Groß [Mon, 21 Feb 2011 13:40:11 +0000 (14:40 +0100)]
Moved XM formatting functions to xenxs

14 years agoMoved XM parsing functions to xenxs
Markus Groß [Mon, 21 Feb 2011 13:40:10 +0000 (14:40 +0100)]
Moved XM parsing functions to xenxs

14 years agoMoved SEXPR formatting functions to xenxs
Markus Groß [Mon, 21 Feb 2011 13:40:09 +0000 (14:40 +0100)]
Moved SEXPR formatting functions to xenxs

14 years agoMoved SEXPR parsing functions to xenxs
Markus Groß [Mon, 21 Feb 2011 13:40:08 +0000 (14:40 +0100)]
Moved SEXPR parsing functions to xenxs

14 years agoMoved some SEXPR functions from xen-unified
Markus Groß [Mon, 21 Feb 2011 13:40:07 +0000 (14:40 +0100)]
Moved some SEXPR functions from xen-unified

14 years agoMoved SEXPR unit to utils
Markus Groß [Mon, 21 Feb 2011 13:40:06 +0000 (14:40 +0100)]
Moved SEXPR unit to utils

14 years agoprotect the scsi controller to be deleted when it is in use
Wen Congyang [Mon, 21 Feb 2011 07:35:52 +0000 (15:35 +0800)]
protect the scsi controller to be deleted when it is in use

Steps to reproduce this bug:
1. virsh attach-disk domain --source imagefile --target sdb --sourcetype file --driver qemu --subdriver raw
2. virsh detach-device controller.xml # remove scsi controller 0
3. virsh detach-disk domain sdb
   error: Failed to detach disk
   error: operation failed: detaching scsi0-0-1 device failed: Device 'scsi0-0-1' not found

I think we should not detach a controller when it is used by some other device.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agomaint: fix grammar in error message
Eric Blake [Mon, 21 Feb 2011 17:35:25 +0000 (10:35 -0700)]
maint: fix grammar in error message

* python/tests/create.py: Use correct wording.

14 years agovirt-*-validate.in: quote all variable references
Dan Kenigsberg [Sun, 20 Feb 2011 20:29:26 +0000 (22:29 +0200)]
virt-*-validate.in: quote all variable references

Alas, the shell is not a real programming language.

Patch generated by manual confirmation of vim's
s/[^"]\@<=\$\S\+\s\@=/"&"/gc
and
s/\(echo \)\@<=[^"].*\$.*$/"&"/c matches.

This patch generate a lot of noise and carries little benefits, as
I do not really expect $PKI to contain spaces or backticks. I'm just
fuming, and would not really mind if this patch is ignored

14 years agovirt-pki-validate: behave when CERTTOOL is missing
Dan Kenigsberg [Sun, 20 Feb 2011 20:29:25 +0000 (22:29 +0200)]
virt-pki-validate: behave when CERTTOOL is missing

14 years agoautobuild.sh: use VPATH build
Eric Blake [Fri, 30 Apr 2010 14:52:54 +0000 (08:52 -0600)]
autobuild.sh: use VPATH build

Try to avoid future regressions on the VPATH front.

* autobuild.sh: Uncomment VPATH use.
* .gitignore: Exclude build directory.

14 years agomaint: fix 'make dist' in VPATH build
Eric Blake [Fri, 18 Feb 2011 21:40:35 +0000 (14:40 -0700)]
maint: fix 'make dist' in VPATH build

A diff of 'make dist' from in-tree vs. a VPATH build showed
that we were missing docs/api_extension/*.patch files, but
shipping other files that we didn't need.

* bootstrap.conf (gnulib_extra_files): Don't distribute files we
don't care about.
* docs/Makefile.am (patches): Perform wildcard correctly.

14 years agobuild: don't require pod2man for tarball builds
Eric Blake [Wed, 16 Feb 2011 22:43:24 +0000 (15:43 -0700)]
build: don't require pod2man for tarball builds

Right now, 'man libvirtd' includes information that depends on
configure results, so it must be generated on the fly and live
in $(builddir); however, requiring pod2man on all end user
machines is overkill.  Meanwhile, 'man virsh' doesn't mention
any configure results, so it can be built at 'make dist' time.
If that situation changes in the future, we can generate virsh.1
in the same way that we generate libvirtd.8.

* daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in
advance of distribution.
(libvirtd.8): Use only sed from tarball.
(EXTRA_DIST): Ship new file.
(libvirtd.pod): Delete unused rule.
(man8_MANS): Let automake know which section to use.
(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files.
* tools/Makefile.am (dist_man1_MANS): Distribute pre-built man
pages, fine since they don't require any substitution.
(virt-xml-validate.1, virt-pki-validate.1): Change input source.
(virsh.1): Build into srcdir.
(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style.
* daemon/.gitignore: Update.
Reported by Diego Elio Pettenò.

14 years agomaint: kill all remaining uses of old DEBUG macro
Eric Blake [Wed, 16 Feb 2011 23:37:57 +0000 (16:37 -0700)]
maint: kill all remaining uses of old DEBUG macro

Done mechanically with:
$ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'

followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
with a single 'make syntax-check' fallout in the same file, and the
actual deletion in src/util/logging.h.

* src/util/logging.h (DEBUG, DEBUG0): Delete.
* daemon/libvirtd.h (qemudDebug): Likewise.
* global: Change remaining clients over to VIR_DEBUG counterpart.

14 years agohash: make virHashFree more free-like
Eric Blake [Fri, 18 Feb 2011 21:30:24 +0000 (14:30 -0700)]
hash: make virHashFree more free-like

Two-argument free functions are uncommon; match the style elsewhere
by caching the callback at creation.

* src/util/hash.h (virHashCreate, virHashFree): Move deallocator
argument to creation.
* cfg.mk (useless_free_options): Add virHashFree.
* src/util/hash.c (_virHashTable): Track deallocator.
(virHashCreate, virHashFree): Update to new signature.
* src/conf/domain_conf.c (virDomainObjListDeinit)
(virDomainObjListInit, virDomainDiskDefForeachPath)
(virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
Update callers.
* src/conf/nwfilter_params.c (virNWFilterHashTableFree)
(virNWFilterHashTableCreate): Likewise.
* src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
Likewise.
* src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
Likewise.
* src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
* src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
(virNWFilterLearnShutdown): Likewise.
* src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
(qemuDomainPCIAddressSetFree): Likewise.
* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.

14 years agobuild: Fix API docs generation in VPATH build
Jiri Denemark [Fri, 18 Feb 2011 11:12:28 +0000 (12:12 +0100)]
build: Fix API docs generation in VPATH build

XSLT allows for two ways of generating the output of transformation.
Either implicit, which xsltproc prints to stdout and can be redirected
to a file using -o file. Or explicit, which means the stylesheet
contains <xsl:document> element which specifies where the output should
be saved. This can be used for generating more files by a single run of
xsltproc and -o directory/ can change the directory where the output
files will be stored.

devhelp.xsl is special in that it combines both options in one
stylesheet, which doesn't work well with -o:

xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml

Outputs 4 *.html files into ./devhelp but then tries to write to
./devhelp/ as a file (hence the I/O error) rather than writing output to
the fifth file devhelp/libvirt.devhelp.

This patch modifies devhelp.xsl so that all files are generated using
<xsl:document> element and -o directory/ can be used to override output
directory where those files are saved.

14 years agoRemove all object hashtable caches from virConnectPtr
Daniel P. Berrange [Fri, 29 Oct 2010 11:43:34 +0000 (12:43 +0100)]
Remove all object hashtable caches from virConnectPtr

The virConnectPtr struct will cache instances of all other
objects. APIs like virDomainLookupByUUID will return a
cached object, so if you do virDomainLookupByUUID twice in
a row, you'll get the same exact virDomainPtr instance.

This does not have any performance benefit, since the actual
logic in virDomainLookupByUUID (and other APIs returning
virDomainPtr, etc instances) is not short-circuited. All
it does is to ensure there is only one single virDomainPtr
in existance for any given UUID.

The caching has a number of downsides though, all relating
to stale data. If APIs aren't careful to always overwrite
the 'id' field in virDomainPtr it may become out of data.
Likewise for the name field, if a guest is renamed, or if
a guest is deleted, and then a new one created with the
same UUID but different name.

This has been an ongoing, endless source of bugs for all
applications using libvirt from languages with garbage
collection, causing them to get virDomainPtr instances
from long ago with stale data.

The caching is also a waste of memory resources, since
both applications, and language bindings often maintain
their own hashtable caches of object instances.

This patch removes all the hash table caching, so all
APIs return brand new virDomainPtr (etc) object instances.

* src/datatypes.h: Delete all hash tables.
* src/datatypes.c: Remove all object caching code

14 years agonwfilter: enable rejection of packets
Stefan Berger [Sat, 19 Feb 2011 01:13:40 +0000 (20:13 -0500)]
nwfilter: enable rejection of packets

This patch adds the possibility to not just drop packets, but to also have them rejected where iptables at least sends an ICMP msg back to the originator. On ebtables this again maps into dropping packets since rejecting is not supported.

I am adding 'since 0.8.9' to the docs assuming this will be the next version of libvirt.

14 years agoDrop empty argument from dnsmasq call
Guido Günther [Fri, 18 Feb 2011 14:32:02 +0000 (15:32 +0100)]
Drop empty argument from dnsmasq call

since dnsmasq >= 2.56 now bails out with empty arguments. See
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613944
for the Debian bug and
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589885
for the upstream reasoning.

14 years agobuild: fix broken mingw cross-compilation
Eric Blake [Fri, 18 Feb 2011 19:00:47 +0000 (12:00 -0700)]
build: fix broken mingw cross-compilation

Two regressions:
Commit df1011ca broke builds for systems that lack devmapper
(non-Linux, as well as Linux with ./autogen.sh --without-libvirtd
and without the libraries present).
Commit ce6fd650 broke cross-compilation, due to a gnulib bug.

* .gnulib: Update to latest, for cross-compilation fix.
* src/util/util.c (virIsDevMapperDevice): Provide stub for
platforms not using storage driver.
* configure.ac (devmapper): Arrange to define HAVE_LIBDEVMAPPER_H.
devmapper issue reported by Wen Congyang.

14 years agoesx: Ignore malformed host UUID from BIOS
Matthias Bolte [Fri, 18 Feb 2011 09:09:32 +0000 (10:09 +0100)]
esx: Ignore malformed host UUID from BIOS

Etienne Gosset reported that libvirt fails to connect to his ESX
server because it failed to parse its malformed host UUID, that
contains an additional space and lacks one hexdigit in the last
group:

xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxx

Don't treat this as a fatal error, just ignore it.

14 years agovirsh: freecell --all getting wrong NUMA nodes count
Michal Privoznik [Fri, 18 Feb 2011 11:42:21 +0000 (12:42 +0100)]
virsh: freecell --all getting wrong NUMA nodes count

Virsh freecell --all was not only getting wrong NUMA nodes count, but
even the NUMA nodes IDs. They doesn't have to be continuous, as I've
found out during testing this. Therefore a modification of
nodeGetCellsFreeMemory() error message.

14 years agobuild: speed up non-maintainer builds
Eric Blake [Fri, 11 Feb 2011 19:43:05 +0000 (12:43 -0700)]
build: speed up non-maintainer builds

* configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Use to reduce
time spent in configure.

14 years agobuild: recompute symbols after changing configure options
Eric Blake [Thu, 17 Feb 2011 20:16:53 +0000 (13:16 -0700)]
build: recompute symbols after changing configure options

$ ./configure
...
$ make
...
  GEN    libvirt.syms
...
$ ./configure --with-driver-modules
...
$ make
...

libvirt.syms doesn't get regenerated but it should as it should
contain virDriverLoadModule now.

* src/Makefile.am (libvirt.syms): Depend on configure changes.
Reported by Matthias Bolte.

14 years agomaint: Expand tabs in python code
Jiri Denemark [Wed, 16 Feb 2011 15:57:50 +0000 (16:57 +0100)]
maint: Expand tabs in python code

Also cfg.mk is tweaked to force this for all future changes to *.py
files.

14 years agoRequires gettext for client package
Osier Yang [Fri, 18 Feb 2011 05:45:13 +0000 (13:45 +0800)]
Requires gettext for client package

libvirt-guests invokes functions in gettext.sh, so we need to
require gettext package in spec file.

Demo with the fix:
% rpm -q gettext
package gettext is not installed

% rpm -ivh libvirt-client-0.8.8-1.fc14.x86_64.rpm
error: Failed dependencies:
gettext is needed by libvirt-client-0.8.8-1.fc14.x86_64

* libvirt.spec.in

14 years agoDo not add drive 'boot=on' param when a kernel is specified
Jim Fehlig [Thu, 17 Feb 2011 21:22:55 +0000 (14:22 -0700)]
Do not add drive 'boot=on' param when a kernel is specified

libvirt-tck was failing several domain tests [1] with qemu 0.14, which
is now less tolerable of specifying 2 bootroms with the same boot index [2].

Drop the 'boot=on' param if kernel has been specfied.

[1] https://www.redhat.com/archives/libvir-list/2011-February/msg00559.html
[2] http://lists.nongnu.org/archive/html/qemu-devel/2011-02/msg01892.html

14 years agoremove duplicated call to reportOOMError
Christophe Fergeau [Thu, 17 Feb 2011 21:18:22 +0000 (22:18 +0100)]
remove duplicated call to reportOOMError

14 years agoremove space between function name and (
Christophe Fergeau [Thu, 17 Feb 2011 21:18:21 +0000 (22:18 +0100)]
remove space between function name and (

There were several occurrences of an extra space inserted between
a function name and the ( opening the argument list in
datatypes.c. This is not consistent with the coding style used in
the rest of this file so removing this extra space makes the
code slightly more readable.

14 years agodon't check for NULL before calling virHashFree
Christophe Fergeau [Thu, 17 Feb 2011 21:14:59 +0000 (22:14 +0100)]
don't check for NULL before calling virHashFree

virHashFree follows the convention described in HACKING that
XXXFree() functions can be called with a NULL argument.

14 years agoremove no longer needed calls to virReportOOMError
Christophe Fergeau [Thu, 17 Feb 2011 21:14:58 +0000 (22:14 +0100)]
remove no longer needed calls to virReportOOMError

Now that the virHash handling functions call virReportOOMError by
themselves when needed, users of the virHash API no longer need to
do it by themselves. Since users of the virHash API were not
consistently calling virReportOOMError after memory failures from
the virHash code, this has the added benefit of making OOM
reporting from this code more consistent and reliable.

14 years agofactor common code in virHashAddEntry and virHashUpdateEntry
Christophe Fergeau [Thu, 17 Feb 2011 21:14:57 +0000 (22:14 +0100)]
factor common code in virHashAddEntry and virHashUpdateEntry

The only difference between these 2 functions is that one errors
out when the entry is already present while the other modifies
the existing entry. Add an helper function with a boolean argument
indicating whether existing entries should be updated or not, and
use this helper in both functions.

14 years agoadd hash table rebalancing in virHashUpdateEntry
Christophe Fergeau [Thu, 17 Feb 2011 21:14:56 +0000 (22:14 +0100)]
add hash table rebalancing in virHashUpdateEntry

The code in virHashUpdateEntry and virHashAddEntry is really
similar. However, the latter rebalances the hash table when
one of its buckets contains too many elements while the former
does not. Fix this discrepancy.

14 years agohash: modernize debug code
Eric Blake [Thu, 17 Feb 2011 23:33:12 +0000 (16:33 -0700)]
hash: modernize debug code

* src/util/hash.c (virHashGrow) [DEBUG_GROW]: Use modern logging.
Reported by Christophe Fergeau.

14 years agobuild: improve 'make install' for VPATH builds
Eric Blake [Wed, 16 Feb 2011 21:47:39 +0000 (14:47 -0700)]
build: improve 'make install' for VPATH builds

This still doesn't fix {html,devhelp}/libvirt-{libvirt-virterror}.html,
but it's progress in the right direction.

* docs/Makefile.am (%.html): Build into srcdir.

14 years agocheck more error info about whether drive_add failed
Wen Congyang [Thu, 17 Feb 2011 03:32:16 +0000 (11:32 +0800)]
check more error info about whether drive_add failed

When we attach a disk, but we specify a wrong format of disk image,
qemu monitor command drive_add will fail, but libvirt does not detect
this error.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agologging: make VIR_ERROR and friends preserve errno
Eric Blake [Wed, 16 Feb 2011 23:49:15 +0000 (16:49 -0700)]
logging: make VIR_ERROR and friends preserve errno

Followup to commit 17e19add, and would have prevented the bug
independently fixed in commit 76c57a7c.

* src/util/logging.c (virLogMessage): Preserve errno, since
logging should be as unintrusive as possible.

14 years agomaint: avoid 'make syntax-check' from tarball
Eric Blake [Wed, 16 Feb 2011 21:35:42 +0000 (14:35 -0700)]
maint: avoid 'make syntax-check' from tarball

* .gnulib: update to latest gnulib for maint.mk fixes

14 years agoGive each virtual network bridge its own fixed MAC address
Laine Stump [Wed, 9 Feb 2011 08:28:12 +0000 (03:28 -0500)]
Give each virtual network bridge its own fixed MAC address

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=609463

The problem was that, since a bridge always acquires the MAC address
of the connected interface with the numerically lowest MAC, as guests
are started and stopped, it was possible for the MAC address to change
over time, and this change in the network was being detected by
Windows 7 (it sees the MAC of the default route change), so on each
reboot it would bring up a dialog box asking about this "new network".

The solution is to create a dummy tap interface with a MAC guaranteed
to be lower than any guest interface's MAC, and attach that tap to the
bridge as soon as it's created. Since all guest MAC addresses start
with 0xFE, we can just generate a MAC with the standard "0x52, 0x54,
0" prefix, and it's guaranteed to always win (physical interfaces are
never connected to these bridges, so we don't need to worry about
competing numerically with them).

Note that the dummy tap is never set to IFF_UP state - that's not
necessary in order for the bridge to take its MAC, and not setting it
to UP eliminates the clutter of having an (eg) "virbr0-nic" displayed
in the output of the ifconfig command.

I chose to not auto-generate the MAC address in the network XML
parser, as there are likely to be consumers of that API that don't
need or want to have a MAC address associated with the
bridge.

Instead, in bridge_driver.c when the network is being defined, if
there is no MAC, one is generated. To account for virtual network
configs that already exist when upgrading from an older version of
libvirt, I've added a %post script to the specfile that searches for
all network definitions in both the config directory
(/etc/libvirt/qemu/networks) and the state directory
(/var/lib/libvirt/network) that are missing a mac address, generates a
random address, and adds it to the config (and a matching address to
the state file, if there is one).

docs/formatnetwork.html.in: document <mac address.../>
docs/schemas/network.rng: add nac address to schema
libvirt.spec.in: %post script to update existing networks
src/conf/network_conf.[ch]: parse and format <mac address.../>
src/libvirt_private.syms: export a couple private symbols we need
src/network/bridge_driver.c:
    auto-generate mac address when needed,
    create dummy interface if mac address is present.
tests/networkxml2xmlin/isolated-network.xml
tests/networkxml2xmlin/routed-network.xml
tests/networkxml2xmlout/isolated-network.xml
tests/networkxml2xmlout/routed-network.xml: add mac address to some tests

14 years agoAllow brAddTap to create a tap device that is down
Laine Stump [Wed, 9 Feb 2011 06:20:39 +0000 (01:20 -0500)]
Allow brAddTap to create a tap device that is down

An upcoming patch has a use for a tap device to be created that
doesn't need to be actually put into the "up" state, and keeping it
"down" keeps the output of ifconfig from being unnecessarily cluttered
(ifconfig won't show down interfaces unless you add "-a").

bridge.[ch]: add "up" as an arg to brAddTap()
uml_conf.c, qemu_command.c: add "up" (set to "true") to brAddTap() call.

14 years agoAdd txmode attribute to interface XML for virtio backend
Laine Stump [Thu, 3 Feb 2011 20:20:01 +0000 (15:20 -0500)]
Add txmode attribute to interface XML for virtio backend

This is in response to:

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

Explanation

qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.

'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)

'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)

The resulting difference, according to the qemu developer who added
the option is:

    bh makes tx more asynchronous and reduces latency, but potentially
    causes more processor bandwidth contention since the cpu doing the
    tx isn't necessarily the cpu where the guest generated the
    packets.

Solution

This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:

    <interface ...>
      ...
      <model type='virtio'/>
      <driver txmode='iothread'/>
      ...
    </interface>

I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)

Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of

    qemu -device virtio-net-pci,?

If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.

14 years agoRestructure domain struct interface "driver" data for easier expansion
Laine Stump [Thu, 3 Feb 2011 18:52:08 +0000 (13:52 -0500)]
Restructure domain struct interface "driver" data for easier expansion

When the <driver> element (and its "name" attribute) was added to the
domain XML's interface element, a "backend" enum was simply added to
the toplevel of the virDomainNetDef struct.

Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
when there's only a single item contained in the driver element of the
XML, but doesn't scale well as we add more attributes that apply to
the backend of the virtio-net driver, or add attributes applicable to
other drivers.

This patch changes virDomainNetDef in two ways:

1) Rename the item in the struct from "backend" to "name", so that
   it's the same in the XML and in the struct, hopefully avoiding
   confusion for someone unfamiliar with the function of the
   attribute.

2) Create a "driver" union within virDomainNetDef, and a "virtio"
   struct in that struct, which contains the "name" enum value.

3) Move around the virDomainNetParse and virDomainNetFormat functions
   to allow for simple plugin of new attributes without disturbing
   existing code. (you'll note that this results in a seemingly
   redundant if() in the format function, but that will no longer be
   the case as soon as a 2nd attribute is added).

In the future, new attributes for the virtio driver backend can be
added to the "virtio" struct, and any other network device backend that
needs an attribute will have its own struct added to the "driver"
union.

14 years agobuild: Fix VPATH build
Jiri Denemark [Wed, 16 Feb 2011 14:09:09 +0000 (15:09 +0100)]
build: Fix VPATH build

Even VPATH make dist succeeds now

14 years agoMove all the QEMU migration code to a new file
Daniel P. Berrange [Mon, 31 Jan 2011 10:47:03 +0000 (10:47 +0000)]
Move all the QEMU migration code to a new file

The introduction of the v3 migration protocol, along with
support for migration cookies, will significantly expand
the size of the migration code. Move it all to a separate
file to make it more manageable

The functions are not moved 100%. The API entry points
remain in the main QEMU driver, but once the public
virDomainPtr is resolved to the internal virDomainObjPtr,
all following code is moved.

This will allow the new v3 API entry points to call into the
same shared internal migration functions

* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
  qemuDomainFormatXML helper method
* src/qemu/qemu_driver.c: Remove all migration code
* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Add
  all migration code.

14 years agoSplit all QEMU process mangement code into separate file
Daniel P. Berrange [Mon, 14 Feb 2011 16:09:39 +0000 (16:09 +0000)]
Split all QEMU process mangement code into separate file

Move the qemudStartVMDaemon and qemudShutdownVMDaemon
methods into a separate file, renaming them to
qemuProcessStart, qemuProcessStop. All helper methods
called by these are also moved & renamed to match

* src/Makefile.am: Add qemu_process.c/.h
* src/qemu/qemu_command.c: Add qemuDomainAssignPCIAddresses
* src/qemu/qemu_command.h: Add VNC port min/max
* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
  domain event queue helpers
* src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
  all QEMU process startup/shutdown functions
* src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add
  all QEMU process startup/shutdown functions

14 years agostorage: Allow to delete device mapper disk partition
Osier Yang [Thu, 17 Feb 2011 07:29:07 +0000 (15:29 +0800)]
storage: Allow to delete device mapper disk partition

The name convention of device mapper disk is different, and 'parted'
can't be used to delete a device mapper disk partition. e.g.

Name                 Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

Error: Expecting a partition number.

This patch introduces 'dmsetup' to fix it.

Changes:
  - New function "virIsDevMapperDevice" in "src/utils/utils.c"
  - remove "is_dm_device" in "src/storage/parthelper.c", use
    "virIsDevMapperDevice" instead.
  - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in"
  - Check "dmsetup" in 'configure.ac' for "with-storage-disk"
  - Changes on "src/Makefile.am" to link against libdevmapper
  - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms"

Changes from v1 to v3:
  - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g
  - replace "virRun" with "virCommand"
  - sort the list of util functions in "libvirt_private.syms"
  - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration.

e.g.

Name                 Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted

Name                 Path
-----------------------------------------

14 years agoRelease of libvirt-0.8.8
Daniel Veillard [Thu, 17 Feb 2011 04:11:03 +0000 (12:11 +0800)]
Release of libvirt-0.8.8

* configure.ac docs/news.html.in libvirt.spec.in: bump version and add docs
* po/*.po*: updated Gujarati, Polish and Dutch localisations and regenerated

14 years agoqemu: Error prompt when saving a shutoff domain
Osier Yang [Thu, 17 Feb 2011 03:18:47 +0000 (11:18 +0800)]
qemu: Error prompt when saving a shutoff domain

"qemudDomainSaveFlag" goto wrong label "endjob", which will cause
error when security manager trying to restore label (regression).

As it's more reasonable to check if vm is shutoff immediately, and
return right away if it is, remove the checking in "qemudDomainSaveFlag",
and add checking in "qemudDomainSave".

* src/qemu/qemu_driver.c

14 years agomaint: delete unused 'make install' step
Eric Blake [Wed, 16 Feb 2011 17:21:21 +0000 (10:21 -0700)]
maint: delete unused 'make install' step

Libxml2-Logo-90x34.gif was removed from the repository in Sep 2009
(commit d6d528c) because our docs no longer reference it.

* docs/Makefile.am (install-data-local): Don't install missing file.

14 years agocgroup: preserve correct errno on failure
Eric Blake [Tue, 15 Feb 2011 23:50:34 +0000 (16:50 -0700)]
cgroup: preserve correct errno on failure

* src/util/cgroup.c (virCgroupSetValueStr, virCgroupGetValueStr)
(virCgroupRemoveRecursively): VIR_DEBUG can clobber errno.
(virCgroupRemove): Use VIR_DEBUG rather than DEBUG.

14 years agoUpdate czech localization
Zdenek Styblik [Wed, 16 Feb 2011 13:40:44 +0000 (21:40 +0800)]
Update czech localization

14 years agoqemu: Fix command line generation with faked host CPU
Jiri Denemark [Tue, 15 Feb 2011 14:23:17 +0000 (15:23 +0100)]
qemu: Fix command line generation with faked host CPU

The code expected that host CPU architecture matches the architecture on
which libvirt runs. This is normally true but not in tests, where host
CPU is faked to produce consistent results.

14 years agotests: Fake host capabilities properly
Jiri Denemark [Tue, 15 Feb 2011 14:24:39 +0000 (15:24 +0100)]
tests: Fake host capabilities properly

Since we fake host CPU we should also fake host arch instead of taking
the real architecture tests are running on.

14 years agodocs: fix typos
Eric Blake [Tue, 15 Feb 2011 20:50:28 +0000 (13:50 -0700)]
docs: fix typos

* docs/drvopenvz.html.in: Spell administrator correctly.
* docs/drvuml.html.in: Likewise.
* src/qemu/qemu.conf: Likewise.  Fix other typos, too.

14 years agoAvoid empty strings when --with-packager(-version) is not specified
Matthias Bolte [Tue, 15 Feb 2011 18:48:44 +0000 (19:48 +0100)]
Avoid empty strings when --with-packager(-version) is not specified

Make with_packager and with_packager_version default to "no". This way
--without-packager-version (as shorthand for --with-packager(-version)=no)
works correctly too.

Prior to this patch libvirt outputs a line like this when
--with-packager(-version) was not specified

# ./daemon/libvirtd
14:11:15.018: 31796: info : libvirt version: 0.8.8, package:  ()

Now the unspecified parts are correctly omitted.

Reported by Osier Yang.

14 years agobuild: address clang reports about virCommand
Eric Blake [Mon, 14 Feb 2011 22:24:08 +0000 (15:24 -0700)]
build: address clang reports about virCommand

clang had 5 reports against virCommand; three were false positives
(a NULL deref in ProcessIO solved by sa_assert, and two uninitialized
memory operations solved by adding an initializer), but two were real.

* src/util/command.c (virCommandProcessIO): Fix real bug of
possible NULL dereference.  Teach clang that buf is never NULL.
(virCommandRun): Teach clang that infd is only ever accessed when
initialized.

14 years agobuild: silence some clang warnings
Eric Blake [Mon, 14 Feb 2011 23:06:31 +0000 (16:06 -0700)]
build: silence some clang warnings

* tools/virsh.c (cmdHelp): Kill dead variables.

14 years agoqemu: don't mask real error with oom report
Eric Blake [Tue, 15 Feb 2011 16:31:39 +0000 (09:31 -0700)]
qemu: don't mask real error with oom report

* src/qemu/qemu_command.c (qemuBuildCommandLine): Don't report oom
after qemuBuildControllerDevStr, which reported its own errors.

14 years agoqemu: avoid NULL derefs
Eric Blake [Mon, 14 Feb 2011 23:51:59 +0000 (16:51 -0700)]
qemu: avoid NULL derefs

The processWatchdogEvent fix is real, although it can only trigger
on OOM, since bad things happen if doCoreDump is called with a NULL
pathname argument.  The other fixes silence clang, but aren't a real
bug because virReportErrorHelper tolerates a NULL format string even
though *printf does not.

* src/qemu/qemu_driver.c (processWatchdogEvent): Exit on OOM.
(qemuDomainIsActive, qemuDomainIsPersistent, qemuDomainIsUpdated):
Provide valid message.

14 years agovirDomainMemoryStats: avoid null dereference
Eric Blake [Mon, 14 Feb 2011 23:20:39 +0000 (16:20 -0700)]
virDomainMemoryStats: avoid null dereference

* src/libvirt.c (virDomainMemoryStats): Check domain before flags.

14 years agodocs: added link for nimbus to apps page
Justin Clift [Mon, 14 Feb 2011 15:12:56 +0000 (02:12 +1100)]
docs: added link for nimbus to apps page