]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 years agosmartcard: turn on qemu support
Eric Blake [Thu, 13 Jan 2011 00:09:45 +0000 (17:09 -0700)]
smartcard: turn on qemu support

* src/qemu/qemu_command.c (qemuBuildCommandLine): Emit smartcard
options.
(qemuAssignDeviceAliases): Assign an alias for smartcards.
(qemuBuildControllerDevStr): Manage the usb-ccid controller.
* tests/qemuxml2argvtest.c (mymain): Add new tests.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.args: New
file.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.args:
Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough.args:
Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.args:
Likewise.

14 years agosmartcard: enable SELinux support
Eric Blake [Fri, 14 Jan 2011 19:17:17 +0000 (12:17 -0700)]
smartcard: enable SELinux support

* src/security/security_selinux.c
(SELinuxRestoreSecuritySmartcardCallback)
(SELinuxSetSecuritySmartcardCallback): New helper functions.
(SELinuxRestoreSecurityAllLabel, SELinuxSetSecurityAllLabel): Use
them.

14 years agosmartcard: check for qemu capability
Eric Blake [Thu, 13 Jan 2011 15:54:33 +0000 (08:54 -0700)]
smartcard: check for qemu capability

Qemu smartcard/spicevmc support exists on branches (such as
http://cgit.freedesktop.org/~alon/qemu/commit/?h=usb_ccid.v15&id=024a37b)
but is not yet upstream.  The added -help output matches a scratch build
that will be close to the RHEL 6.1 qemu-kvm.

* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_CCID_EMULATED)
(QEMUD_CMD_FLAG_CCID_PASSTHRU, QEMUD_CMD_FLAG_CHARDEV_SPICEVMC):
New flags.
* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags)
(qemuCapsParseDeviceStr): Check for smartcard capabilities.
(qemuCapsExtractVersionInfo): Tweak comment.
* tests/qemuhelptest.c (mymain): New test.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61: New file.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61-device: Likewise.

14 years agosmartcard: add domain conf support
Eric Blake [Mon, 10 Jan 2011 16:41:33 +0000 (09:41 -0700)]
smartcard: add domain conf support

* src/conf/domain_conf.h (virDomainSmartcardType): New enum.
(virDomainSmartcardDef, virDomainDeviceCcidAddress): New structs.
(virDomainDef): Include smartcards.
(virDomainSmartcardDefIterator): New typedef.
(virDomainSmartcardDefFree, virDomainSmartcardDefForeach): New
prototypes.
(virDomainControllerType, virDomainDeviceAddressType): Add ccid
enum values.
(virDomainDeviceInfo): Add ccid address type.
* src/conf/domain_conf.c (virDomainSmartcard): Convert between
enum and string.
(virDomainSmartcardDefParseXML, virDomainSmartcardDefFormat)
(virDomainSmartcardDefFree, virDomainDeviceCcidAddressParseXML)
(virDomainDefMaybeAddSmartcardController): New functions.
(virDomainDefParseXML): Parse the new XML.
(virDomainDefFormat): Convert back to XML.
(virDomainDefFree): Clean up.
(virDomainDeviceInfoIterate): Iterate over passthrough aliases.
(virDomainController, virDomainDeviceAddress)
(virDomainDeviceInfoParseXML, virDomainDeviceInfoFormat)
(virDomainDefAddImplicitControllers): Support new values.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): List new function.

14 years agosmartcard: add XML support for <smartcard> device
Eric Blake [Thu, 6 Jan 2011 01:02:20 +0000 (18:02 -0700)]
smartcard: add XML support for <smartcard> device

Assuming a hypervisor that supports multiple smartcard devices in the
guest, this would be a valid XML description:

<devices>
  <smartcard mode='host'/>
  <smartcard mode='host-certificates'>
    <certificate>/path/to/cert1</certificate>
    <certificate>/path/to/cert2</certificate>
    <certificate>/path/to/cert3</certificate>
  </smartcard>
  <smartcard mode='passthrough' type='tcp'>
    <source mode='bind' host='127.0.0.1' service='2001'/>
    <protocol type='raw'/>
  </smartcard>
</devices>

(As of this commit, the qemu hypervisor will be the first
implementation, but it only supports one smartcard.)

* docs/formatdomain.html.in (Smartcard devices): New section.
* docs/schemas/domain.rng (smartcard): New define, used in
devices.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.xml: New file
to test schema.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.xml:
Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-tcp.xml:
Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.xml:
Likewise.

14 years agodocs/index.html.in: update QEMU url
Alon Levy [Thu, 3 Feb 2011 23:40:46 +0000 (01:40 +0200)]
docs/index.html.in: update QEMU url

14 years agoqemu: Support booting from hostdev PCI devices
Jiri Denemark [Thu, 3 Feb 2011 14:09:17 +0000 (15:09 +0100)]
qemu: Support booting from hostdev PCI devices

14 years agoSupport booting from hostdev devices
Jiri Denemark [Thu, 3 Feb 2011 12:06:21 +0000 (13:06 +0100)]
Support booting from hostdev devices

14 years agoqemu: Add shortcut for HMP pass through
Jiri Denemark [Wed, 2 Feb 2011 15:37:10 +0000 (16:37 +0100)]
qemu: Add shortcut for HMP pass through

Currently users who want to use virDomainQemuMonitorCommand() API or
it's virsh equivalent has to use the same protocol as libvirt uses for
communication to qemu. Since the protocol is QMP with current qemu and
HMP much more usable for humans, one ends up typing something like the
following:

    virsh qemu-monitor-command DOM \
'{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'

which is not a very convenient way of debugging qemu.

This patch introduces --hmp option to qemu-monitor-command, which says
that the provided command is in HMP. If libvirt uses QMP to talk with
qemu, the command will automatically be converted into QMP. So the
example above is simplified to just

    virsh qemu-monitor-command --hmp DOM "info kvm"

Also the result is converted from

    {"return":"kvm support: enabled\r\n"}

to just plain HMP:

    kvm support: enabled

If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.

14 years agomacvtap: fix 2 nla_put expressions (non-serious bug)
Stefan Berger [Thu, 3 Feb 2011 19:36:27 +0000 (14:36 -0500)]
macvtap: fix 2 nla_put expressions (non-serious bug)

This patch fixes 2 occurrences of nla_put expression with a '!' in
front of them that basically prevented the detection that the buffer
is too small. However, code further below would then detect that the
buffer is too small when further parts are added to the netlink message.

14 years agoqemu: avoid double shutdown
Eric Blake [Wed, 2 Feb 2011 18:16:41 +0000 (11:16 -0700)]
qemu: avoid double shutdown

* src/qemu/qemu_driver.c (qemudShutdownVMDaemon): Check that vm is
still active.
Reported by Wen Congyang as follows:

Steps to reproduce this bug:

1. use gdb to debug libvirtd, and set breakpoint in the function
   qemuConnectMonitor()
2. start a vm, and the libvirtd will be stopped in qemuConnectMonitor()
3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
4. continue to run libvirtd in gdb, and libvirtd will be blocked in the
   function qemuMonitorSetCapabilities()
5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)

Here is log of the qemu:
=========
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin ...
char device redirected to /dev/pts/3
2011-01-27 09:38:48.101: shutting down
2011-01-27 09:41:26.401: shutting down
=========

The vm is shut down twice. I do not know whether this behavior has
side effect, but I think we should shutdown the vm only once.

14 years agoFix conflicts with glibc globals
Davidlohr Bueso [Thu, 3 Feb 2011 15:09:00 +0000 (12:09 -0300)]
Fix conflicts with glibc globals

When compiling libvirt with GCC 3.4.6 the following warning is being triggered quite a lot:

util/memory.h:60: warning: declaration of 'remove' shadows a global declaration
/usr/include/stdio.h:175: warning: shadowed declaration is here

Fix this by renaming the parameter to 'toremove'.

14 years agoFix compilation when building without sasl
Daniel Veillard [Thu, 3 Feb 2011 14:13:24 +0000 (22:13 +0800)]
Fix compilation when building without sasl

Use of saslDecoded field need to be guarded by #if HAVE_SASL/endif
* src/remote/remote_driver.c: fix remoteIOEventLoop accordingly

14 years agodocs: more on qemu locking patterns
Eric Blake [Wed, 2 Feb 2011 00:28:55 +0000 (17:28 -0700)]
docs: more on qemu locking patterns

* src/qemu/THREADS.txt: Improve documentation.

14 years agoqemuBuildDeviceAddressStr() checks for QEMUD_CMD_FLAG_PCI_MULTIBUS
Niels de Vos [Tue, 1 Feb 2011 16:22:01 +0000 (16:22 +0000)]
qemuBuildDeviceAddressStr() checks for QEMUD_CMD_FLAG_PCI_MULTIBUS

Depending if the qemu binary supports multiple pci-busses, the device
options will contain "bus=pci" or "bus=pci.0".

Only x86_64 and i686 seem to have support for multiple PCI-busses. When
a guest of these architectures is started, set the
QEMUD_CMD_FLAG_PCI_MULTIBUS flag.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
14 years agoDon't sleep in poll() if there is existing SASL decoded data
Daniel P. Berrange [Tue, 1 Feb 2011 16:00:32 +0000 (16:00 +0000)]
Don't sleep in poll() if there is existing SASL decoded data

In the SASL codepath we typically read far more data off the
wire than we immediately need. When using a connection from a
single thread this isn't a problem, since only our reply will
be pending (or an event we can handle directly). When using a
connection from multiple threads though, we may read the data
from replies from other threads. If those replies occur after
our own reply, they'll not be processed. The other thread will
then go into poll() and wait for its reply which has already
been received and decoded. The solution is to set poll() timeout
to 0 if there is pending SASL data.

* src/remote/remote_driver.c: Don't sleep in poll() if SASL
  data exists

14 years agodocs: renamed hudson project link to jenkins, matching project rename
Justin Clift [Tue, 1 Feb 2011 21:35:45 +0000 (08:35 +1100)]
docs: renamed hudson project link to jenkins, matching project rename

14 years agomacvtap: fix variable in debugging output
Stefan Berger [Tue, 1 Feb 2011 17:02:01 +0000 (12:02 -0500)]
macvtap: fix variable in debugging output

This patch fixes a variable in the debugging output.

14 years agobuild: fix parted detection at configure time
Eric Blake [Mon, 31 Jan 2011 22:08:26 +0000 (15:08 -0700)]
build: fix parted detection at configure time

* configure.ac (PARTED_FOUND): Issue configure error if
--with-storage-disk=yes but no parted is found.

14 years agodocs: Update docs for cpu_shares setting
Osier Yang [Tue, 1 Feb 2011 08:46:17 +0000 (16:46 +0800)]
docs: Update docs for cpu_shares setting

* tools/virsh.pod

14 years agoqemu: Build command line for incoming tunneled migration
Osier Yang [Tue, 1 Feb 2011 08:33:34 +0000 (16:33 +0800)]
qemu: Build command line for incoming tunneled migration

Command line building for incoming tunneled migration is missed,
as a result, all the tunneled migration will fail with "unknown
migration protocol".

* src/qemu/qemu_command.c

14 years agobridge_driver: handle DNS over IPv6
Paweł Krześniak [Mon, 31 Jan 2011 20:31:57 +0000 (21:31 +0100)]
bridge_driver: handle DNS over IPv6

* dnsmasq listens on all defined IPv[46] addresses for network
* Add ip6tables rules to allow DNS traffic to host

14 years agotests: handle backspace-newline pairs in test input files
Juerg Haefliger [Mon, 31 Jan 2011 11:42:57 +0000 (06:42 -0500)]
tests: handle backspace-newline pairs in test input files

This patch teaches testutil how to read multi-line input files with
backspace-newline line continuation markers.

The patch also breaks up all the single-line arguments test input files into
multi-line files with lines shorter than 80 characters.

14 years agoqemu: More clear error parsing domain def failure of tunneled migration
Osier Yang [Mon, 31 Jan 2011 09:12:46 +0000 (17:12 +0800)]
qemu: More clear error parsing domain def failure of tunneled migration

* src/qemu/qemu_driver.c

14 years agoInitialization error of controller in QEmu SCSI hotplug
Wen Congyang [Mon, 31 Jan 2011 07:55:40 +0000 (15:55 +0800)]
Initialization error of controller in QEmu SCSI hotplug

Bug manifests itself by:

1. # virsh attach-disk --target sdb ...
2. # virsh attach-disk --target sdh ...
   error: Failed to attach disk
   error: operation failed: target scsi:0 already exists

sdh uses scsi:1, rather than scsi:0.

* src/qemu/qemu_hotplug.c: properly set controller idx in
  qemuDomainFindOrCreateSCSIDiskController()

14 years agoOsier get commit rights
Daniel Veillard [Mon, 31 Jan 2011 01:31:33 +0000 (09:31 +0800)]
Osier get commit rights

14 years agomaint: reject raw close, popen in 'make syntax-check'
Eric Blake [Thu, 27 Jan 2011 22:16:14 +0000 (15:16 -0700)]
maint: reject raw close, popen in 'make syntax-check'

commit f1fe9671e was supposed to make sure we use files.h
macros to avoid double close, but it didn't work.

Meanwhile, virCommand is vastly superior to system(), fork(),
and popen() (also to virExec, but we haven't completed that
conversion), so enforce that, too.

* cfg.mk (sc_prohibit_close): Fix typo that excluded close, and
add pclose.
(sc_prohibit_fork_wrappers): New rule, for fork, system, and popen.
* .x-sc_prohibit_close: More exemptions.
* .x-sc_prohibit_fork_wrappers: New file.
* Makefile.am (syntax_check_exceptions): Ship new file.
* src/datatypes.c (virReleaseConnect): Tweak comment to avoid
false positive.
* src/util/files.h (VIR_CLOSE): Likewise.

14 years agobuild: avoid close, system
Eric Blake [Fri, 28 Jan 2011 21:22:39 +0000 (14:22 -0700)]
build: avoid close, system

* src/fdstream.c (virFDStreamOpenFile, virFDStreamCreateFile):
Use VIR_FORCE_CLOSE instead of close.
* tests/commandtest.c (mymain): Likewise.
* tools/virsh.c (editFile): Use virCommand instead of system.
* src/util/util.c (__virExec): Special case preservation of std
file descriptors to child.

14 years agoPrefer C style comments over C++ ones
Matthias Bolte [Fri, 28 Jan 2011 21:38:06 +0000 (22:38 +0100)]
Prefer C style comments over C++ ones

Pure cosmetic change.

14 years agoesx: Ensure max-memory has 4 megabyte granularity
Matthias Bolte [Fri, 28 Jan 2011 20:19:59 +0000 (21:19 +0100)]
esx: Ensure max-memory has 4 megabyte granularity

14 years agoAdd VIR_DIV_UP to divide memory or storage request sizes with round up
Matthias Bolte [Fri, 28 Jan 2011 21:03:24 +0000 (22:03 +0100)]
Add VIR_DIV_UP to divide memory or storage request sizes with round up

Use it in all places where a memory or storage request size is converted
to a larger granularity. This avoids requesting too small memory or storage
sizes that could result from the truncation done by a simple division.

This extends the round up fix in 6002e0406c338668ea0ecbfeb6c1ef20a8b67efe
to the whole codebase.

Instead of reporting errors for odd values in the VMX code round them up.

Update the QEMU Argv tests accordingly as the original memory size 219200
isn't a even multiple of 1024 and is rounded up to 215 megabyte now. Change
it to 219100 and 219136. Use two different values intentionally to make
sure that rounding up works.

Update virsh.pod accordingly, as rounding down and rejecting are replaced
by rounding up.

14 years agoqemu: fix augeas support for vnc_auto_unix_socket
Eric Blake [Fri, 28 Jan 2011 20:52:20 +0000 (13:52 -0700)]
qemu: fix augeas support for vnc_auto_unix_socket

Fixes test failure that was overlooked after commit 1e1f7a8950.

* daemon/Makefile.am (check-local): Let 'make check' fail on error.
* daemon/test_libvirtd.aug: Move qemu-specific option...
* src/qemu/test_libvirtd_qemu.aug: ...into correct test.
* src/qemu/libvirtd_qemu.aug: Parse new option.

14 years agovirsh: added --all flag to freecell command
Michal Privoznik [Fri, 28 Jan 2011 18:21:57 +0000 (19:21 +0100)]
virsh: added --all flag to freecell command

This will iterate over all NUMA nodes, showing
free memory for each and sum at the end.
Existing default behavior is not changed.

14 years agoesx: Don't try to change max-memory of an active domain
Matthias Bolte [Thu, 27 Jan 2011 21:01:43 +0000 (22:01 +0100)]
esx: Don't try to change max-memory of an active domain

Report an VIR_ERR_OPERATION_INVALID error in that case instead of letting
the SOAP call fail with an VIR_ERR_INTERNAL_ERROR error.

14 years agoqemu aio: enable support
Eric Blake [Wed, 21 Apr 2010 14:28:21 +0000 (16:28 +0200)]
qemu aio: enable support

qemu allows the user to choose what io storage api should be used,
either the default (threads) or native (linux aio) which in the latter
case can result in better performance.

Based on a patch originally by Matthias Dahl.

Red Hat Bugzilla #591703
Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoqemu aio: parse aio support from qemu -help
Matthias Dahl [Wed, 21 Apr 2010 14:28:21 +0000 (16:28 +0200)]
qemu aio: parse aio support from qemu -help

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoqemu aio: add XML parsing
Matthias Dahl [Wed, 21 Apr 2010 14:28:21 +0000 (16:28 +0200)]
qemu aio: add XML parsing

Allows io={threads|native} as an optional attribute to <driver>.

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agodocs: replace CRLF with LF
Juerg Haefliger [Fri, 28 Jan 2011 12:52:18 +0000 (13:52 +0100)]
docs: replace CRLF with LF

14 years agoRemove bogus log warning lines when launching QEMU
Daniel P. Berrange [Thu, 27 Jan 2011 18:39:53 +0000 (18:39 +0000)]
Remove bogus log warning lines when launching QEMU

The refactoring of QEMU command startup was comitted with
a couple of VIR_WARN lines left in from debugging.

* src/qemu/qemu_driver.c: Remove log warning lines

14 years agoRemove double close of qemu monitor
Daniel P. Berrange [Thu, 27 Jan 2011 18:28:15 +0000 (18:28 +0000)]
Remove double close of qemu monitor

When qemuMonitorSetCapabilities() fails, there is no need to
call qemuMonitorClose(), because the caller will already see
the error code and tear down the entire VM. The extra call to
qemuMonitorClose resulted in a double-free due to it removing
a ref count prematurely.

* src/qemu/qemu_driver.c: Remove premature close of monitor

14 years agoPrevent overfilling of self-pipe in python event loop
Daniel P. Berrange [Thu, 27 Jan 2011 12:54:27 +0000 (12:54 +0000)]
Prevent overfilling of self-pipe in python event loop

If the event loop takes a very long time todo something, it is
possible for the 'self pipe' buffer to become full at which
point the entire event loop + remote driver deadlock. Use a
boolean flag to ensure we have strict one-in, one-out behaviour
on writes/reads of the 'self pipe'

14 years agodocs: Add docs for new extra parameter pkipath
Osier Yang [Thu, 27 Jan 2011 14:08:25 +0000 (22:08 +0800)]
docs: Add docs for new extra parameter pkipath

* docs/remote.html.in

14 years agoqemu: fix error messages
Eric Blake [Fri, 28 Jan 2011 03:39:44 +0000 (20:39 -0700)]
qemu: fix error messages

Regression in commit caa805ea let a lot of bad messages slip in.

* cfg.mk (msg_gen_function): Fix function name.
* src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
'make syntax-check'.
* src/qemu/qemu_driver.c (qemudDomainGetInfo)
(qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
(qemudDomainSaveFlag, qemudDomainAttachDevice)
(qemuDomainUpdateDeviceFlags): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
(qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
Likewise.

14 years agoqemu: Report more accurate error on failure to attach device.
Hu Tao [Thu, 27 Jan 2011 07:21:42 +0000 (15:21 +0800)]
qemu: Report more accurate error on failure to attach device.

When attaching device from a xml file and the device is mis-configured,
virsh gives mis-leading message "out of memory". This patch fixes this.

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoForce guest suspend at timeout
Wen Congyang [Tue, 25 Jan 2011 10:14:45 +0000 (18:14 +0800)]
Force guest suspend at timeout

If the memory of guest OS is changed constantly, the live migration
can not be ended ever for ever.

We can use the command 'virsh migrate-setmaxdowntime' to control the
live migration. But the value of maxdowntime is diffcult to calculate
because it depends on the transfer speed of network and constantly
changing memroy size. We need a easy way to control the live migration.

This patch adds the support of forcing guest to suspend at timeout.
With this patch, when we migrate the guest OS, we can specify a
timeout. If the live migration timeouts, auto-suspend the guest OS,
where the migration will complete offline.

14 years agoShow migration progress.
Wen Congyang [Tue, 25 Jan 2011 10:33:06 +0000 (18:33 +0800)]
Show migration progress.

Show migration progress if `migrate --verbose'.

14 years agoCancel migration if user presses Ctrl-C when migration is in progress
Hu Tao [Tue, 25 Jan 2011 10:14:28 +0000 (18:14 +0800)]
Cancel migration if user presses Ctrl-C when migration is in progress

While migration is in progress and virsh is waiting for its
completion, user may want to terminate the progress by pressing
Ctrl-C. But virsh just exits on user's Ctrl-C leaving migration
in background that user isn't even aware of. It's not reasonable.

This patch changes the behaviour for migration. For other
commands Ctrl-C still terminates virsh itself.

14 years agoqemu: use separate alias for chardev and associated device
Eric Blake [Tue, 25 Jan 2011 21:59:50 +0000 (14:59 -0700)]
qemu: use separate alias for chardev and associated device

* src/qemu/qemu_command.c (qemuBuildChrChardevStr): Alter the
chardev alias.
(qemuBuildCommandLine): Output an id for the chardev counterpart.
* tests/qemuxml2argvdata/*: Update tests to match.
Reported by Daniel P. Berrange.

14 years agoavoid vm to be deleted if qemuConnectMonitor failed
Wen Congyang [Tue, 25 Jan 2011 06:43:43 +0000 (14:43 +0800)]
avoid vm to be deleted if qemuConnectMonitor failed

Steps to reproduce this bug:
1. service libvirtd start
2. virsh start <domain>
3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
4. service libvirtd restart
5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)

Then libvirtd will core dump or be in deadlock state.

Make sure that json is built into libvirt and the version
of qemu is newer than 0.13.0.

The reason of libvirtd cores dump is that:
We add vm->refs when we alloc the memory, and decrease it
in the function qemuHandleMonitorEOF() in other thread.

We add vm->refs in the function qemuConnectMonitor() and
decrease it when the vm is inactive.

The libvirtd will block in the function qemuMonitorSetCapabilities()
because the vm is stopped by signal SIGSTOP. Now the vm->refs is 2.

Then we kill the vm by signal SIGKILL. The function
qemuMonitorSetCapabilities() failed, and then we will decrease vm->refs
in the function qemuMonitorClose().
In another thread, mon->fd is broken and the function
qemuHandleMonitorEOF() is called.

If qemuHandleMonitorEOF() decreases vm->refs before qemuConnectMonitor()
returns, vm->refs will be decrease to 0 and the memory is freed.

We will call qemudShutdownVMDaemon() as qemuConnectMonitor() failed.
The memory has been freed, so qemudShutdownVMDaemon() is too dangerous.

We will reference NULL pointer in the function virDomainConfVMNWFilterTeardown():
=============
void
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
    int i;

    if (nwfilterDriver != NULL) {
        for (i = 0; i < vm->def->nnets; i++)
            virDomainConfNWFilterTeardown(vm->def->nets[i]);
    }
}
============
vm->def->nnets is not 0 but vm->def->nets is NULL(We don't set vm->def->nnets
to 0 when we free vm).

We should add an extra reference of vm to avoid vm to be deleted if
qemuConnectMonitor() failed.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agotests: Fix virtio channel tests
Jiri Denemark [Thu, 27 Jan 2011 18:00:36 +0000 (19:00 +0100)]
tests: Fix virtio channel tests

As noticed by Eric, commit 8e28c5d40200b4c5d483bd585d237b9d870372e5,
which fixed generation of virtio-serial port numbers, forgot to adjust
test files which resulted in make check failure.

14 years agodocs: expand the man page text for virsh setmaxmem
Justin Clift [Thu, 27 Jan 2011 16:29:26 +0000 (03:29 +1100)]
docs: expand the man page text for virsh setmaxmem

Addresses BZ # 622534:

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

14 years agoevent: fix event-handling allocation crash
Eric Blake [Fri, 21 Jan 2011 19:57:03 +0000 (12:57 -0700)]
event: fix event-handling allocation crash

Regression introduced in commit e6b68d7 (Nov 2010).

Prior to that point, handlesAlloc was always a multiple of
EVENT_ALLOC_EXTENT (10), and was an int (so even if the subtraction
had been able to wrap, a negative value would be less than the count
not try to free the handles array).  But after that point,
VIR_RESIZE_N made handlesAlloc grow geometrically (with a pattern of
10, 20, 30, 45 for the handles array) but still freed in multiples of
EVENT_ALLOC_EXTENT; and the count changed to size_t.  Which means that
after 31 handles have been created, then 30 handles destroyed,
handlesAlloc is 5 while handlesCount is 1, and since (size_t)(1 - 5)
is indeed greater than 1, this then tried to free 10 elements, which
had the awful effect of nuking the handles array while there were
still live handles.

Nuking live handles puts libvirtd in an inconsistent state, and was
easily reproducible by starting and then stopping 60 faqemu guests.

* daemon/event.c (virEventCleanupTimeouts, virEventCleanupHandles):
Avoid integer wrap-around causing us to delete the entire array
while entries are still active.
* tests/eventtest.c (mymain): Expose the bug.

14 years agodocs: fix incorrect XML element mentioned by setmem text
Justin Clift [Thu, 27 Jan 2011 11:57:18 +0000 (22:57 +1100)]
docs: fix incorrect XML element mentioned by setmem text

14 years agoremote: Add extra parameter pkipath for URI
Osier Yang [Thu, 27 Jan 2011 08:34:54 +0000 (16:34 +0800)]
remote: Add extra parameter pkipath for URI

This new parameter allows user specifies where the client
cerficate, client key, CA certificate of x509 is, instead of
hardcoding it. If 'pkipath' is not specified, and the user
is not root, try to find files in $HOME/.pki/libvirt, as long
as one of client cerficate, client key, CA certificate can
not be found, use default global location (LIBVIRT_CACERT,
LIBVIRT_CLIENTCERT, LIBVIRT_CLIENTKEY, see
src/remote/remote_driver.h)

Example of use:

[root@Osier client]# virsh -c qemu+tls://10.66.93.111/system?pkipath=/tmp/pki/client
error: Cannot access CA certificate '/tmp/pki/client/cacert.pem': No such file
or directory
error: failed to connect to the hypervisor
[root@Osier client]# ls -l
total 24
-rwxrwxr-x. 1 root root 6424 Jan 24 21:35 a.out
-rw-r--r--. 1 root root 1245 Jan 23 19:04 clientcert.pem
-rw-r--r--. 1 root root  132 Jan 23 19:04 client.info
-rw-r--r--. 1 root root 1679 Jan 23 19:04 clientkey.pem

[root@Osier client]# cp /tmp/cacert.pem .
[root@Osier client]# virsh -c qemu+tls://10.66.93.111/system?pkipath=/tmp/pki/client
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
'quit' to quit

virsh #

* src/remote/remote_driver.c: adds support for the new pkipath URI parameter

14 years agostorage: Round up capacity for LVM volume creation
Osier Yang [Thu, 27 Jan 2011 08:28:19 +0000 (16:28 +0800)]
storage: Round up capacity for LVM volume creation

If vol->capacity is odd, the capacity will be rounded down
by devision, this patch is to round it up instead of rounding
down, to be safer in case of one writes to the volume with the
size he used to create.

- src/storage/storage_backend_logical.c: make sure size is not rounded down

14 years agoUpdate localization files from Fedora i10n
Daniel Veillard [Thu, 27 Jan 2011 05:33:45 +0000 (13:33 +0800)]
Update localization files from Fedora i10n

14 years agoDo not use virtio-serial port 0 for generic ports
David Allan [Mon, 24 Jan 2011 20:47:52 +0000 (15:47 -0500)]
Do not use virtio-serial port 0 for generic ports

Per the discussion in:

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

The port numbering should start from 1, not 0.  We assign maxport + 1,
so start maxport at 0.

14 years agoManually kill gzip if restore fails before starting qemu
Laine Stump [Mon, 24 Jan 2011 16:58:15 +0000 (11:58 -0500)]
Manually kill gzip if restore fails before starting qemu

If a guest image is saved in compressed format, and the restore fails
in some way after the intermediate process used to uncompress the
image has been started, but before qemu has been started to hook up to
the uncompressor, libvirt will endlessly wait for the uncompressor to
finish, but it never will because it's still waiting to have something
hooked up to drain its output.

The solution is to close the pipes on both sides of the uncompressor,
then send a SIGTERM before calling waitpid on it (only if the restore
has failed, of course).

14 years agoFix setup of lib directory with autogen.sh --system
Daniel P. Berrange [Wed, 19 Jan 2011 12:24:26 +0000 (12:24 +0000)]
Fix setup of lib directory with autogen.sh --system

On x86_64 hosts, /usr/lib64 must be used instead of /usr/lib
Rather than attempt to whitelist architectures, just check
for existance of /usr/lib64

* autogen.sh: Fix to use /usr/lib64 if it exists

14 years agoAdd check for poll error events in monitor
Daniel P. Berrange [Mon, 13 Dec 2010 16:05:41 +0000 (16:05 +0000)]
Add check for poll error events in monitor

Handle poll errors in the same way as hangup event

* src/qemu/qemu_monitor.c: Handle error events

14 years agoFilter out certain expected error messages from libvirtd
Daniel P. Berrange [Fri, 21 Jan 2011 17:25:01 +0000 (17:25 +0000)]
Filter out certain expected error messages from libvirtd

Add a hook to the error reporting APIs to allow specific
error messages to be filtered out. Wire up libvirtd to
remove VIR_ERR_NO_DOMAIN & similar error codes from the
logs. They are still logged at DEBUG level.

* daemon/libvirtd.c: Filter VIR_ERR_NO_DOMAIN and friends
* src/libvirt_private.syms, src/util/virterror.c,
  src/util/virterror_internal.h: Hook for changing error
  reporting level

14 years agoRevert all previous error log priority hacks
Daniel P. Berrange [Fri, 21 Jan 2011 16:46:16 +0000 (16:46 +0000)]
Revert all previous error log priority hacks

This reverts the additions in commit

  abff683f78ffd01df5005fb7a457c0b38b8eb6e1

taking us back to state where all errors are fully logged
in both libvirtd and normal clients.

THe intent was to stop VIR_ERR_NO_DOMAIN (No such domain
with UUID XXXX) messages from client apps polluting syslog
The change affected all error codes, but more seriously,
it also impacted errors from internal libvirtd infrastructure
For example guest autostart no longer logged errors. The
libvirtd network code no longer logged some errors. This
makes debugging incredibly hard

* daemon/libvirtd.c: Remove error log priority filter
* src/util/virterror.c, src/util/virterror_internal.h: Remove
  callback for overriding log priority

14 years agoCleanup code style in logging APIs
Daniel P. Berrange [Fri, 21 Jan 2011 16:30:17 +0000 (16:30 +0000)]
Cleanup code style in logging APIs

Remove use of brackets around following return statement.
Fix indentation of two switch statements

14 years agoSet SELinux context label of pipes used for qemu migration
Laine Stump [Sun, 23 Jan 2011 21:09:40 +0000 (16:09 -0500)]
Set SELinux context label of pipes used for qemu migration

This patch is a partial resolution to the following bug:

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

(to complete the fix, an updated selinux-policy package is required,
to add the policy that allows libvirt to set the context of a fifo,
which was previously not allowed).

Explanation : When an incoming migration is over a pipe (for example,
if the image was compressed and is being fed through gzip, or was on a
root-squash nfs server, so needed to be opened by a child process
running as a different uid), qemu cannot read it unless the selinux
context label for the pipe has been set properly.

The solution is to check the fd used as the source of the migration
just before passing it to qemu; if it's a fifo (implying that it's a
pipe), we call the newly added virSecurityManagerSetFDLabel() function
to set the context properly.

14 years agoAdd a function to the security driver API that sets the label of an open fd.
Laine Stump [Sun, 23 Jan 2011 21:02:42 +0000 (16:02 -0500)]
Add a function to the security driver API that sets the label of an open fd.

A need was found to set the SELinux context label on an open fd (a
pipe, as a matter of fact). This patch adds a function to the security
driver API that will set the label on an open fd to secdef.label. For
all drivers other than the SELinux driver, it's a NOP. For the SElinux
driver, it calls fsetfilecon().

If the return is a failure, it only returns error up to the caller if
1) the desired label is different from the existing label, 2) the
destination fd is of a type that supports setting the selinux context,
and 3) selinux is in enforcing mode. Otherwise it will return
success. This follows the pattern of the existing function
SELinuxSetFilecon().

14 years agodocs: add a link to the bindings page under the downloads menu item
Justin Clift [Wed, 26 Jan 2011 05:00:33 +0000 (16:00 +1100)]
docs: add a link to the bindings page under the downloads menu item

So people looking to download the language bindings, but don't know
they're under the "Docs" area.

14 years agovirsh: require --mac to avoid detach-interface ambiguity
Michal Privoznik [Tue, 25 Jan 2011 17:31:00 +0000 (18:31 +0100)]
virsh: require --mac to avoid detach-interface ambiguity

bugfix for https://bugzilla.redhat.com/show_bug.cgi?id=671050

virsh simply refutes to detach-interface in case when multiple
interfaces are attached and --mac is not specified.

14 years agodispatch error before return
Wen Congyang [Tue, 25 Jan 2011 09:56:39 +0000 (17:56 +0800)]
dispatch error before return

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agoqemu: Error prompt when managed save a shutoff domain
Osier Yang [Tue, 25 Jan 2011 07:49:51 +0000 (15:49 +0800)]
qemu: Error prompt when managed save a shutoff domain

The problem was introduced by commit 4303c91, which removed the checking
of domain state, this patch is to fix it.

Otherwise, improper error will be thrown, e.g.

error: Failed to save domain rhel6 state
error: cannot resolve symlink /var/lib/libvirt/qemu/save/rhel6.save: No such
file or directory

14 years agobuild: avoid corrupted gnulib/tests/Makefile
Eric Blake [Tue, 25 Jan 2011 00:14:19 +0000 (17:14 -0700)]
build: avoid corrupted gnulib/tests/Makefile

Running 'make check' can sometimes fail in the gnulib/tests
subdirectory, when doing an incremental build, because
./bootstrap generates a Makefile.am that tries to refer to
../../.. instead of ../.., and gets lost.

This may be an upstream gnulib bug, where a more elegant
solution will present itself in the future:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24898

But in the meantime, I was able to reproduce both the issue,
and this solution to work around it.

* bootstrap.conf (bootstrap_epilogue): Ensure that no stray
../../.. components remain in gnulib/tests/Makefile.in.
Reported by Serge Hallyn.

14 years agoqemu: sound: Support intel 'ich6' model
Cole Robinson [Thu, 13 Jan 2011 14:15:11 +0000 (09:15 -0500)]
qemu: sound: Support intel 'ich6' model

In QEMU, the card itself is a PCI device, but it requires a codec
(either -device hda-output or -device hda-duplex) to actually output
sound. Specifying <sound model='ich6'/> gives us -device intel-hda
-device hda-duplex I think it's important that a simple <sound model='ich6'/>
sets up a useful codec, to have consistent behavior with all other sound cards.

This is basically Dan's proposal of

    <sound model='ich6'>
        <codec type='output' slot='0'/>
        <codec type='duplex' slot='3'/>
    </sound>

without the codec bits implemented.

The important thing is to keep a consistent API here, we don't want some
<sound> devs require tweaking codecs but not others. Steps I see to
accomplishing this:

    - every <sound> device has a <codec type='default'/> (unless codecs are
        manually specified)
    - <codec type='none'/> is required to specify 'no codecs'
    - new audio settings like mic=on|off could then be exposed in
        <sound> or <codec> in a consistent manner for all sound models

v2:
    Use model='ich6'

v3:
    Use feature detection, from eblake
    Set codec id, bus, and cad values

v4:
    intel-hda isn't supported if -device isn't available

v5:
    Comment spelling fixes

14 years agovmx: Use VIR_ERR_CONFIG_UNSUPPORTED when appropriated
Matthias Bolte [Fri, 21 Jan 2011 08:15:43 +0000 (09:15 +0100)]
vmx: Use VIR_ERR_CONFIG_UNSUPPORTED when appropriated

14 years agoevent: fix event-handling data race
Eric Blake [Fri, 21 Jan 2011 19:57:03 +0000 (12:57 -0700)]
event: fix event-handling data race

This bug has been present since before the time that commit
f8a519 (Dec 2008) tried to make the dispatch loop re-entrant.

Dereferencing eventLoop.handles outside the lock risks crashing, since
any other thread could have reallocated the array in the meantime.
It's a narrow race window, however, and one that would have most
likely resulted in passing bogus data to the callback rather than
actually causing a segv, which is probably why it has gone undetected
this long.

* daemon/event.c (virEventDispatchHandles): Cache data while
inside the lock, as the array might be reallocated once outside.

14 years agobuild: fix 'make check' with older git
Eric Blake [Fri, 21 Jan 2011 22:40:46 +0000 (15:40 -0700)]
build: fix 'make check' with older git

* .gnulib: Update to latest, for maintainer-makefile fix.
Reported by Matthias Bolte.

14 years agoPush unapplied fixups for previous patch
Cole Robinson [Fri, 21 Jan 2011 21:18:54 +0000 (16:18 -0500)]
Push unapplied fixups for previous patch

- Add augeas tests
- Clarify vnc_auto_unix_socket precedence in qemu.conf

14 years agoqemu: Add conf option to auto setup VNC unix sockets
Cole Robinson [Wed, 12 Jan 2011 04:44:11 +0000 (23:44 -0500)]
qemu: Add conf option to auto setup VNC unix sockets

If vnc_auto_unix_socket is enabled, any VNC devices without a hardcoded
listen or socket value will be setup to serve over a unix socket in
/var/lib/libvirt/qemu/$vmname.vnc.

We store the generated socket path in the transient VM definition at
CLI build time.

14 years agoqemu: Allow serving VNC over a unix domain socket
Cole Robinson [Fri, 7 Jan 2011 21:03:07 +0000 (16:03 -0500)]
qemu: Allow serving VNC over a unix domain socket

QEMU supports serving VNC over a unix domain socket rather than traditional
TCP host/port. This is specified with:

<graphics type='vnc' socket='/foo/bar/baz'/>

This provides better security access control than VNC listening on
127.0.0.1, but will cause issues with tools that rely on the lax security
(virt-manager in fedora runs as regular user by default, and wouldn't be
able to access a socket owned by 'qemu' or 'root').

Also not currently supported by any clients, though I have patches for
virt-manager, and virt-viewer should be simple to update.

v2:
    schema: Make listen vs. socket a <choice>

14 years agoqemu: Set domain def transient at beginning of startup process
Cole Robinson [Wed, 12 Jan 2011 06:04:33 +0000 (01:04 -0500)]
qemu: Set domain def transient at beginning of startup process

This will allow us to record transient runtime state in vm->def, like
default VNC parameters. Accomplish this by adding an extra 'live' parameter
to SetDefTransient, with similar semantics to the 'live' flag for
AssignDef.

14 years agomaint: support --no-git option during autogen.sh
Eric Blake [Fri, 21 Jan 2011 16:34:35 +0000 (09:34 -0700)]
maint: support --no-git option during autogen.sh

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

Also, fixes gnulib bug in dealing with strerror_r from glibc 2.13.

* .gnulib: Update to latest, for improved bootstrap.
* bootstrap: Resync from gnulib.
* autogen.sh (bootstrap): Add --bootstrap-sync, to make it easier
to keep bootstrap up-to-date.  Pass optional --no-git through.
Reported by Aleksey Avdeev.

14 years ago[v2] qemu: Retry JSON monitor cont cmd on MigrationExpected error
Jim Fehlig [Thu, 13 Jan 2011 19:52:23 +0000 (12:52 -0700)]
[v2] qemu: Retry JSON monitor cont cmd on MigrationExpected error

When restoring a saved qemu instance via JSON monitor, the vm is
left in a paused state.  Turns out the 'cont' cmd was failing with
"MigrationExpected" error class and "An incoming migration is
expected before this command can be executed" error description
due to migration (restore) not yet complete.

Detect if 'cont' cmd fails with "MigrationExpecte" error class and
retry 'cont' cmd.

V2: Fix potential double-free noted by Laine Stump

14 years agoqemu: report more proper error for unsupported graphics
Osier Yang [Fri, 21 Jan 2011 07:20:50 +0000 (15:20 +0800)]
qemu: report more proper error for unsupported graphics

Report VIR_ERR_CONFIG_UNSUPPORTED instead of VIR_ERR_INTERNAL_ERROR,
as it's valid in our domain schema, just unsupported by hypervisor
here.

* src/qemu/qemu_command.c

14 years agoFix startup with VNC password expiry on old QEMU
Daniel P. Berrange [Tue, 18 Jan 2011 18:37:45 +0000 (18:37 +0000)]
Fix startup with VNC password expiry on old QEMU

The code which set VNC passwords correctly had fallback for
the set_password command, but was lacking it for the
expire_password command. This made it impossible to start
a guest. It also failed to check whether QEMU was still
running after the initial 'set_password' command completed

* src/qemu/qemu_hotplug.c: Fix error handling when
  password expiry fails
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Fix
  return code for missing expire_password command

14 years agoFix error reporting when machine type probe fails
Daniel P. Berrange [Tue, 18 Jan 2011 18:00:31 +0000 (18:00 +0000)]
Fix error reporting when machine type probe fails

Avoid overwriting the real error message with a generic
OOM failure message, when machine type probe fails

* src/qemu/qemu_driver.c: Don't overwrite error

14 years agoAvoid crash in security driver if model is NULL
Daniel P. Berrange [Tue, 18 Jan 2011 18:01:10 +0000 (18:01 +0000)]
Avoid crash in security driver if model is NULL

If the XML security model is NULL, it is assumed that the current
model will be used with dynamic labelling. The verify step is
meaningless and potentially crashes if dereferencing NULL

* src/security/security_manager.c: Skip NULL model on verify

14 years agoqemu: Fix a possible deadlock in p2p migration
Wen Congyang [Fri, 21 Jan 2011 08:28:07 +0000 (16:28 +0800)]
qemu: Fix a possible deadlock in p2p migration

The function virUnrefConnect() may call virReleaseConnect() to release
the dest connection, and the function virReleaseConnect() will call
conn->driver->close().

So the function virUnrefConnect() should be surrounded by
qemuDomainObjEnterRemoteWithDriver() and
qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
two communicating libvirt daemons.

See commit f0c8e1cb3774d6f09e2681ca1988bf235a343007 for further details.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agodocs: document <controller> element
Eric Blake [Mon, 17 Jan 2011 21:33:00 +0000 (14:33 -0700)]
docs: document <controller> element

* docs/formatdomain.html.in: Talk about <controller> and <address>
throughout.

14 years agodocs: move the apps page to the top level as its good promo
Justin Clift [Thu, 20 Jan 2011 06:17:41 +0000 (17:17 +1100)]
docs: move the apps page to the top level as its good promo

14 years agodocs: added new entries to apps page, plus adjusted a few existing
Justin Clift [Thu, 20 Jan 2011 01:52:21 +0000 (12:52 +1100)]
docs: added new entries to apps page, plus adjusted a few existing

Added new entries for Hudson, LCFG, Tivoli Provisioning Manager,
virt-what, and Zenoss.  Adjusted the existing entries for BuildBot
and vmware2libvirt.

14 years agoqemu: Avoid sending STOPPED event twice
Jiri Denemark [Tue, 18 Jan 2011 11:07:13 +0000 (12:07 +0100)]
qemu: Avoid sending STOPPED event twice

In some circumstances, libvirtd would issue two STOPPED events after it
stopped a domain. This was because an EOF event can arrive after a qemu
process is killed but before qemuMonitorClose() is called.

qemuHandleMonitorEOF() should ignore EOF when the domain is not running.

I wasn't able to reproduce this bug directly, only after adding an
artificial sleep() into qemudShutdownVMDaemon().

14 years agoqemu: Fail if per-device boot is used but deviceboot is not supported
Jiri Denemark [Tue, 18 Jan 2011 09:04:21 +0000 (10:04 +0100)]
qemu: Fail if per-device boot is used but deviceboot is not supported

14 years agospec: Start libvirt-guests only if it's on in current runlevel
Jiri Denemark [Tue, 18 Jan 2011 08:49:10 +0000 (09:49 +0100)]
spec: Start libvirt-guests only if it's on in current runlevel

14 years agoRemove redundant brackets around return values
Daniel P. Berrange [Fri, 7 Jan 2011 17:39:43 +0000 (17:39 +0000)]
Remove redundant brackets around return values

A large number of return values used 'return (0)' instead
of simply 'return 0'. Remove all these redundant brackets
so the style is consistent throughout the file

* src/libvirt.c: Remove redundant brackets

14 years agoIncrease size of driver table to make UML work again
Daniel P. Berrange [Fri, 7 Jan 2011 17:36:33 +0000 (17:36 +0000)]
Increase size of driver table to make UML work again

The driver table only has 10 slots, but there are potentially
11 drivers that need activating. Improve the error message
when driver registration fails

* src/libvirt.c: Increase driver table size & improve errors

14 years agoTurn libvirt.c error reporting functions into macros
Daniel P. Berrange [Fri, 7 Jan 2011 17:31:36 +0000 (17:31 +0000)]
Turn libvirt.c error reporting functions into macros

The virLibConnError() function (and related ones) do not correctly
report line number info. Turn them all into macros so line numbers
are reported correctly. Drop the connection object in all of them
since it is no longer used.

Also from the virLibConnWarning() equivalents completely. Now
that the Xen driver is running 100% inside libvirtd, those
codepaths for secondary drivers cannot be reached.

* src/libvirt.c: Replace error functions with macros

14 years agodocs: document <sysinfo> and <smbios> elements
Eric Blake [Tue, 18 Jan 2011 20:41:55 +0000 (13:41 -0700)]
docs: document <sysinfo> and <smbios> elements

* docs/formatdomain.html.in: Talk about <sysinfo> throughout.

14 years agobuild: use more gnulib modules for simpler code
Eric Blake [Fri, 24 Dec 2010 02:26:15 +0000 (19:26 -0700)]
build: use more gnulib modules for simpler code

* .gnulib: Update to latest, for sigpipe and sigaction modules.
* bootstrap.conf (gnulib_modules): Add siaction, sigpipe, strerror_r.
* tools/virsh.c (vshSetupSignals) [!SIGPIPE]: Delete, now that
gnulib guarantees it.
(SA_SIGINFO): Define for mingw fallback.
* src/util/virterror.c (virStrerror): Simplify, now that gnulib
guarantees the POSIX interface.
* configure.ac (AC_CHECK_FUNCS_ONCE): Drop redundant check.
(AM_PROG_CC_STDC): Move earlier, to keep autoconf happy.

14 years agoRemove two unused PATH_MAX-sized char arrays from the stack
Matthias Bolte [Sat, 15 Jan 2011 16:38:57 +0000 (17:38 +0100)]
Remove two unused PATH_MAX-sized char arrays from the stack

14 years agoUse VIR_ERR_OPERATION_INVALID when appropriated
Matthias Bolte [Sat, 15 Jan 2011 15:57:33 +0000 (16:57 +0100)]
Use VIR_ERR_OPERATION_INVALID when appropriated

VIR_ERR_OPERATION_INVALID means that the operation is not valid
for the current state of the involved object.

14 years agoFix misuse of VIR_ERR_INVALID_* error code
Matthias Bolte [Sat, 15 Jan 2011 15:31:29 +0000 (16:31 +0100)]
Fix misuse of VIR_ERR_INVALID_* error code

VIR_ERR_INVALID_* is meant for invalid pointers only.

14 years agoSimplify "NWFilterPool" to "NWFilter"
Matthias Bolte [Sat, 15 Jan 2011 15:06:52 +0000 (16:06 +0100)]
Simplify "NWFilterPool" to "NWFilter"

The public object is called NWFilter but the corresponding private
object is called NWFilterPool. I don't see compelling reasons for this
Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc.

Remove the Pool suffix from NWFilterPool. No functional change included.