]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
12 years agovirfile: Need to initialize 'looppath'
John Ferlan [Tue, 22 Jan 2013 14:15:43 +0000 (09:15 -0500)]
virfile: Need to initialize 'looppath'

It was possible to call VIR_FREE in cleanup prior to initialization.

12 years agocommandtest: Need to initialize 'errbuf'
John Ferlan [Tue, 22 Jan 2013 14:15:42 +0000 (09:15 -0500)]
commandtest: Need to initialize 'errbuf'

It was possible to call VIR_FREE in cleanup prior to initialization

12 years agovirnetdev: Need to initialize 'pciConfigAddr'
John Ferlan [Tue, 22 Jan 2013 14:15:41 +0000 (09:15 -0500)]
virnetdev: Need to initialize 'pciConfigAddr'

It was possible to call VIR_FREE in cleanup prior to initialization

12 years agovirnetsockettest: Need to initialize 'path'
John Ferlan [Tue, 22 Jan 2013 14:15:40 +0000 (09:15 -0500)]
virnetsockettest: Need to initialize 'path'

It was possible to call VIR_FREE in cleanup prior to initialization

12 years agovirnetserver: Need to initialize 'sigdata'
John Ferlan [Tue, 22 Jan 2013 14:15:39 +0000 (09:15 -0500)]
virnetserver: Need to initialize 'sigdata'

It was possible to call VIR_FREE in error prior to initialization

12 years agoconf: Need to initialize variables before VIR_FREE
John Ferlan [Tue, 22 Jan 2013 14:15:38 +0000 (09:15 -0500)]
conf: Need to initialize variables before VIR_FREE

Resolve a couple of instances where variables were not initialized
prior to potential VIR_FREE call in cleanup path.

12 years agouml: Avoid resource leak of event in umlInofityEvent
John Ferlan [Tue, 22 Jan 2013 14:20:06 +0000 (09:20 -0500)]
uml: Avoid resource leak of event in umlInofityEvent

If there was more than one inotify_event found in the read/while loop,
then only the last event found would have been queued.

12 years agofix typos in comments for VIR_DOMAIN_PROCESS_SIGNAL_{PWR,SYS}
Claudio Bley [Tue, 22 Jan 2013 15:55:35 +0000 (16:55 +0100)]
fix typos in comments for VIR_DOMAIN_PROCESS_SIGNAL_{PWR,SYS}

12 years agostorage: Add coverity[dead_error_condition] to avoid error
John Ferlan [Tue, 22 Jan 2013 14:41:04 +0000 (09:41 -0500)]
storage: Add coverity[dead_error_condition] to avoid error

The local redefinition of PED_PARTITION_PROTECTED results in the error
but is not a problem especially if the built code doesn't have the latest
definitions.

12 years agonetwork: Add coverity[leaked_handle] to ignore error
John Ferlan [Tue, 22 Jan 2013 14:41:03 +0000 (09:41 -0500)]
network: Add coverity[leaked_handle] to ignore error

On error, the 'tapfd' in networkStartNetworkVirtual() is synonymous
with 'macTapIfName' and will be closed in the appropriate error path.

12 years agoremote: Avoid coverity[leaked_storage] message.
John Ferlan [Tue, 22 Jan 2013 14:41:02 +0000 (09:41 -0500)]
remote: Avoid coverity[leaked_storage] message.

Upon successful return of virNetClientStreamEventAddCallback() the
allocated cbdata field will be freed by virNetClientStreamEventRemoveCallback()
as cbOpaque using the free function remoteStreamCallbackFree().

12 years agoqemu: Add coverity[negative_returns] tag
John Ferlan [Tue, 22 Jan 2013 14:41:01 +0000 (09:41 -0500)]
qemu: Add coverity[negative_returns] tag

This avoids "Event negative_returns: A negative constant "-1" is passed as
an argument to a parameter that cannot be negative.".  The called function
uses -1 to determine whether it needs to traverse all the hostdevs.

12 years agorpc: Add coverity[dead_error_begin] tag
John Ferlan [Tue, 22 Jan 2013 14:41:00 +0000 (09:41 -0500)]
rpc: Add coverity[dead_error_begin] tag

Coverity misses the nuance of VIR_FREE(privkey) setting privkey = NULL when
if (!(virFileExists(privkey))) is true and thus declares the code dead.

12 years agoxen: Add coverity[ptr_arith] and [sign_extension] tags
John Ferlan [Tue, 22 Jan 2013 14:40:59 +0000 (09:40 -0500)]
xen: Add coverity[ptr_arith] and [sign_extension] tags

The old cpu bitmap setting algorithm causes a couple of complaints which
have been tagged.

12 years agonodeinfo: Add coverity[dead_error_begin] and [returned_null] tags
John Ferlan [Tue, 22 Jan 2013 14:40:58 +0000 (09:40 -0500)]
nodeinfo: Add coverity[dead_error_begin] and [returned_null] tags

The use of switch statements inside a bounded for loop resulted in some
false positives regarding the "default:" label which cannot be reached
since each of the other case statements use the possible for loop values.
A [dead_error_begin] was added before the default label.

Commit id ebdbe25a adjusted the algorithm and the caller guarantees that
the 'params' will have a '_' in the name being searched. Add the [returned_null]
tag to the two instances.

12 years agolxc: Add coverity[dead_error_begin] tag in switch stmts
John Ferlan [Tue, 22 Jan 2013 14:40:57 +0000 (09:40 -0500)]
lxc: Add coverity[dead_error_begin] tag in switch stmts

The use of switch statements inside a bounded for loop resulted in some
false positives regarding the "default:" label which cannot be reached
since each of the other case statements use the possible for loop values.

12 years agoxend: Address some Coverity false positives
John Ferlan [Tue, 22 Jan 2013 14:40:56 +0000 (09:40 -0500)]
xend: Address some Coverity false positives

The various _for_i loops with both u.s.car and u.s.cdr were being reported
as COPY_PASTE errors by Coverity.  This just quiets those messages.

12 years agoselinux: Resolve resource leak using the default disk label
John Ferlan [Fri, 18 Jan 2013 14:34:13 +0000 (09:34 -0500)]
selinux: Resolve resource leak using the default disk label

Commit id a994ef2d1 changed the mechanism to store/update the default
security label from using disk->seclabels[0] to allocating one on the
fly. That change allocated the label, but never saved it.  This patch
will save the label. The new virDomainDiskDefAddSecurityLabelDef() is
a copy of the virDomainDefAddSecurityLabelDef().

12 years agoutil: Need to check child JSON allocation before use
John Ferlan [Fri, 18 Jan 2013 14:31:53 +0000 (09:31 -0500)]
util: Need to check child JSON allocation before use

12 years agoparallels: Need to handle virJSONValueObjectGetString error
John Ferlan [Fri, 18 Jan 2013 14:30:40 +0000 (09:30 -0500)]
parallels: Need to handle virJSONValueObjectGetString error

12 years agorpc: Remove unnecessary calls
John Ferlan [Fri, 18 Jan 2013 14:29:05 +0000 (09:29 -0500)]
rpc: Remove unnecessary calls

The code is not reachable as of commit id: bb85f229. Removed
virKeepAliveStop() and virObjectUnref() because 'ka' cannot be
anything but NULL at the cleanup label.

12 years agosecurity: Use virStrcpy to move the label
John Ferlan [Fri, 18 Jan 2013 14:27:05 +0000 (09:27 -0500)]
security: Use virStrcpy to move the label

12 years agoqemu: Forbid snapshot names starting with '.'
Peter Krempa [Mon, 21 Jan 2013 21:09:33 +0000 (22:09 +0100)]
qemu: Forbid snapshot names starting with '.'

Forbid the names to match the loading procedure of snapshots.

12 years agosafe{read,write}: Document usage with nonblocking FD
Michal Privoznik [Thu, 17 Jan 2013 07:35:53 +0000 (08:35 +0100)]
safe{read,write}: Document usage with nonblocking FD

Currently, whenever somebody calls saferead() on nonblocking FD
(safewrite() is totally interchangeable for purpose of this message)
he might get wrong return value. For instance, in the first iteration
some data is read. The number of bytes read is stored into local
variable 'nread'. However, in next iterations we can get -1 from
read() with errno == EAGAIN, in which case the -1 is returned despite
fact some data has already been read. So the caller gets confused.
Bare read() should be used for nonblocking FD.

12 years agodocs: Generate documentation for virTypedParams* APIs
Jiri Denemark [Mon, 21 Jan 2013 17:41:26 +0000 (18:41 +0100)]
docs: Generate documentation for virTypedParams* APIs

12 years agodocs: event.c source file was renamed as virevent.c
Jiri Denemark [Mon, 21 Jan 2013 17:40:28 +0000 (18:40 +0100)]
docs: event.c source file was renamed as virevent.c

12 years agospec: indent %if to make it easier to see conditions
Eric Blake [Wed, 9 Jan 2013 20:50:03 +0000 (13:50 -0700)]
spec: indent %if to make it easier to see conditions

Nested conditionals are hard to read if they are not indented.
We can't add arbitrary whitespace to everything in spec files,
but we CAN add spaces before %if and %define.  Use this trick,
plus a fancy sed script that rewrites a spec file into a C
file, so we can use cppi to keep our spec file nice.

For reference, the sed script converts code like:

|# RHEL-5 builds are client-only for s390, ppc
|%if 0%{?rhel} == 5
|    %ifnarch %{ix86} x86_64 ia64
|        %define client_only        1
|    %endif
|%endif

into the following for cppi:

|// # RHEL-5 builds are client-only for s390, ppc
|#if a // 0%{?rhel} == 5
|# if a // %{ix86} x86_64 ia64
|#  define client_only        1
|# endif
|#endif

and errors from 'make syntax-check' look like:
spec_indentation
cppi: mingw-libvirt.spec.in: line 130: not properly indented
maint.mk: incorrect preprocessor indentation

* libvirt.spec.in: Add some indentation to make it easier to follow
various conditionals.
* mingw-libvirt-spec.in: Likewise.
* cfg.mk (sc_spec_indentation): New syntax check to enforce it.

12 years agoqemu: Reject attempts to create snapshots with names containig '/'
Peter Krempa [Thu, 17 Jan 2013 13:07:10 +0000 (14:07 +0100)]
qemu: Reject attempts to create snapshots with names containig '/'

The snapshot name is used to create path to the definition save file.
When the name contains slashes the creation of the file fails. Reject
such names.

12 years agoqemu: Don't return success if creation of snapshot save file fails
Peter Krempa [Thu, 17 Jan 2013 13:04:01 +0000 (14:04 +0100)]
qemu: Don't return success if creation of snapshot save file fails

When the snapshot definition can't be saved, the
qemuDomainSnapshotCreate function succeeded without filling some of the
fields in the internal definition.

This patch removes the snapshot and returns failure if the XML file
cannot be written.

12 years agoLog flags passed to qemuMigrationPrepare{Tunnel,Direct} APIs
Michal Privoznik [Fri, 18 Jan 2013 17:05:03 +0000 (18:05 +0100)]
Log flags passed to qemuMigrationPrepare{Tunnel,Direct} APIs

We are already logging other arguments passed, however, @flags
were missing there.

12 years agobuild: Fix RPM build errors related to libvirt-lxc API
Viktor Mihajlovski [Fri, 18 Jan 2013 13:55:04 +0000 (14:55 +0100)]
build: Fix RPM build errors related to libvirt-lxc API

Added missing entries to makefile and spec.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agoFix race condition when destroying guests
Daniel P. Berrange [Fri, 18 Jan 2013 14:33:51 +0000 (14:33 +0000)]
Fix race condition when destroying guests

When running virDomainDestroy, we need to make sure that no other
background thread cleans up the domain while we're doing our work.
This can happen if we release the domain object while in the
middle of work, because the monitor might detect EOF in this window.
For this reason we have a 'beingDestroyed' flag to stop the monitor
from doing its normal cleanup. Unfortunately this flag was only
being used to protect qemuDomainBeginJob, and not qemuProcessKill

This left open a race condition where either libvirtd could crash,
or alternatively report bogus error messages about the domain already
having been destroyed to the caller

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agodocs: Add some style and color to the HTML documentation
Claudio Bley [Thu, 17 Jan 2013 15:00:12 +0000 (16:00 +0100)]
docs: Add some style and color to the HTML documentation

Signed-off-by: Claudio Bley <cbley@av-test.de>
12 years agodocs: don't use <i> and <tt> HTML tags
Claudio Bley [Thu, 17 Jan 2013 15:00:11 +0000 (16:00 +0100)]
docs: don't use <i> and <tt> HTML tags

Use of <tt> is discouraged in HTML 4.x and has finally been obsoleted
in HTML 5. Likewise for the <i> tag.

Using tables for layout is (widely) considered bad style, too.

Use defintion lists, definition term and defintion description
elements instead.

Signed-off-by: Claudio Bley <cbley@av-test.de>
12 years agodocs: Assign classes to documentation elements
Claudio Bley [Thu, 17 Jan 2013 15:00:10 +0000 (16:00 +0100)]
docs: Assign classes to documentation elements

In CSS the following class names are available:

* keyword     (keywords like "typedef", "struct")
* type        (types like "int", "void*")
* comment     (comments after members of enums or structs)
* directive   (preprocessor directives, #define)
* undisclosed (text saying that the API is not public)

Additionally, kill all of the left-over "programlisting" class
assignments. There are no CSS rules for them.

Signed-off-by: Claudio Bley <cbley@av-test.de>
12 years agoIntroduce virTypedParamsClear public API
Jiri Denemark [Tue, 15 Jan 2013 23:42:35 +0000 (00:42 +0100)]
Introduce virTypedParamsClear public API

The function is just a renamed public version of former
virTypedParameterArrayClear.

12 years agovirsh: Use virTypedParams* APIs in cpu-stats
Jiri Denemark [Tue, 15 Jan 2013 23:11:46 +0000 (00:11 +0100)]
virsh: Use virTypedParams* APIs in cpu-stats

12 years agovirsh: Use virTypedParams* APIs in node-memory-tune
Jiri Denemark [Tue, 15 Jan 2013 23:10:38 +0000 (00:10 +0100)]
virsh: Use virTypedParams* APIs in node-memory-tune

12 years agovirsh: Use virTypedParams* APIs in numatune
Jiri Denemark [Tue, 15 Jan 2013 23:09:55 +0000 (00:09 +0100)]
virsh: Use virTypedParams* APIs in numatune

12 years agovirsh: Use virTypedParams* APIs in memtune
Jiri Denemark [Tue, 15 Jan 2013 23:09:05 +0000 (00:09 +0100)]
virsh: Use virTypedParams* APIs in memtune

12 years agovirsh: Use virTypedParams* APIs in domblkstat
Jiri Denemark [Tue, 15 Jan 2013 23:08:05 +0000 (00:08 +0100)]
virsh: Use virTypedParams* APIs in domblkstat

12 years agovirsh: Use virTypedParams* APIs in schedinfo
Jiri Denemark [Tue, 15 Jan 2013 23:06:20 +0000 (00:06 +0100)]
virsh: Use virTypedParams* APIs in schedinfo

12 years agovirsh: Use virTypedParams* APIs in domiftune
Jiri Denemark [Tue, 15 Jan 2013 23:04:33 +0000 (00:04 +0100)]
virsh: Use virTypedParams* APIs in domiftune

12 years agovirsh: Use virTypedParams* APIs in blkiotune
Jiri Denemark [Tue, 15 Jan 2013 23:03:07 +0000 (00:03 +0100)]
virsh: Use virTypedParams* APIs in blkiotune

12 years agovirsh: Use virTypedParams* APIs in blkdeviotune
Jiri Denemark [Tue, 15 Jan 2013 23:01:54 +0000 (00:01 +0100)]
virsh: Use virTypedParams* APIs in blkdeviotune

12 years agoAdd virTypedParams* APIs
Jiri Denemark [Tue, 15 Jan 2013 13:51:45 +0000 (14:51 +0100)]
Add virTypedParams* APIs

Working with virTypedParameters in clients written in C is ugly and
requires all clients to duplicate the same code. This set of APIs makes
this code for manipulating with virTypedParameters integral part of
libvirt so that all clients may benefit from it.

12 years agoqemu: Simplify condition with already extracted flag
Peter Krempa [Thu, 17 Jan 2013 12:59:00 +0000 (13:59 +0100)]
qemu: Simplify condition with already extracted flag

12 years agostorage: Fix lvcreate parameter for backingStore.
Atsushi Kumagai [Fri, 18 Jan 2013 07:06:01 +0000 (08:06 +0100)]
storage: Fix lvcreate parameter for backingStore.

When virStorageBackendLogicalCreateVol() creates a snapshot for a
logical volume with backingStore element, it fails with the message
below:

  2013-01-17 03:10:18.869+0000: 1967: error : virCommandWait:2345 :
  internal error Child process (/sbin/lvcreate --name lvm-snapshot -L 51200K
  -s=/dev/lvm-pool/lvm-volume) unexpected exit status 3: /sbin/lvcreate:
  invalid option -- '='  Error during parsing of command line.

This is because virCommandAddArgPair() uses '=' to connect the two
parameters, it's unsuitable for -s option of the lvcreate.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
12 years agobuild: fix build on BSD
Eric Blake [Thu, 17 Jan 2013 23:29:38 +0000 (16:29 -0700)]
build: fix build on BSD

A build on FreeBSD failed with:
util/virportallocator.c:108: error: storage size of 'addr' isn't known
util/virportallocator.c:123: error: 'INADDR_ANY' undeclared (first use in this function)

It turns out that while POSIX allows sockaddr_in to leak in through
<arpa/inet.h> (the way Linux does it), it is not mandatory, and
conforming applications are required to get it through <netinet/in.h>.

* src/util/virportallocator.c: Include header for struct
sockaddr_in.
* tests/virportallocatortest.c: Likewise.

12 years agonetwork: Remove dead code getting, but not using ipdef
John Ferlan [Thu, 17 Jan 2013 19:17:15 +0000 (14:17 -0500)]
network: Remove dead code getting, but not using ipdef

The fetch of 'ipdef' in networkRefreshDhcpDaemon() when the loop to fill
in ipv4def fails to find an ipv4 address with dhcp defined. The filled in
ipdef value was not used.  Code was made unnecessary with commit it 2d5cd1.

12 years agovirobject: Remove the bogus ! from call to virObjectInitialize()
John Ferlan [Thu, 17 Jan 2013 19:17:14 +0000 (14:17 -0500)]
virobject: Remove the bogus ! from call to virObjectInitialize()

12 years agoesx: No need to check for objectSpec
John Ferlan [Thu, 17 Jan 2013 19:17:13 +0000 (14:17 -0500)]
esx: No need to check for objectSpec

Coverity complains that the objectSpec != NULL check was unnecessary because
there was no way to get to the label with objectSpec = NULL.

12 years agoqemu: Check valid activeDev before calling pciDeviceSetUsedBy
John Ferlan [Thu, 17 Jan 2013 19:17:11 +0000 (14:17 -0500)]
qemu: Check valid activeDev before calling pciDeviceSetUsedBy

12 years agoFollowup fix for integer wraparound in port allocator
Daniel P. Berrange [Thu, 17 Jan 2013 19:15:57 +0000 (19:15 +0000)]
Followup fix for integer wraparound in port allocator

Change iterator variable datatype to int

12 years agoqemu: Double mutex unlock in qemuDomainModifyDeviceFlags
Viktor Mihajlovski [Thu, 17 Jan 2013 17:25:28 +0000 (18:25 +0100)]
qemu: Double mutex unlock in qemuDomainModifyDeviceFlags

The driver mutex was unlocked in qemuDomainModifyDeviceFlags before
entering qemuDomainObjBeginJobWithDriver where it will be unlocked once
more leaving it in an undefined state. The result was that two
threads were simultaneously looking up the domain hash table during
multiple parallel device attach/detach operations.
Luckily this triggered a virHashIterationError.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agofixed xt_physdev warning when defining ip(6)tables rules
Reinier Schoof [Thu, 17 Jan 2013 11:24:04 +0000 (12:24 +0100)]
fixed xt_physdev warning when defining ip(6)tables rules

When starting a VM, /var/log/messages was spammed with the following message:
 xt_physdev: using --physdev-out in the OUTPUT, FORWARD and POSTROUTING chains for non-bridged traffic is not supported anymore.

With each extra VM I start, the messages get amplified
exponentially. This results in longer starting times every new VM,
relative the the previously started VM. When I ran a test with
starting 100 equal VM's, the first VM started in about 2 seconds, the
100th VM took 48 seconds to start. I'm running a vanilla 3.7.1 kernel,
but I have the same issue on VM hosts with kernel 3.2.28 or 3.2.0,
running libvirt 0.9.12 and 0.9.8 respectively.

Looking into the warning, it seemed that iptables need an extra argument,
--physdev-is-bridged, in commands like:
 iptables -A libvirt-out -m physdev --physdev-is-bridged --physdev-out vnet99 -g FP-vnet99

With that, the warnings in /var/log/messages are gone and running the
test again proved the 100th VM started in 3.8 seconds.

12 years agoconf: don't fail to parse <boot> when parsing a single device
Laine Stump [Thu, 17 Jan 2013 16:18:21 +0000 (11:18 -0500)]
conf: don't fail to parse <boot> when parsing a single device

This resolves:

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

The symptom was that attempts to modify a network device using
virDomainUpdateDeviceFlags() would fail if the original device had a
<boot> element (e.g. "<boot order='1'/>"), even if the updated device
had the same <boot> element. Instead, the following error would be logged:

  cannot modify network device boot index setting

It's true that it's not possible to change boot order (internally
known as bootIndex) of a live device; qemuDomainChangeNet checks for
that, but the problem was that the information it was checking was
incorrect.

Explanation:

When a complete domain is parsed, a global (to the domain) "bootMap"
is passed down to the parse for each device; the bootMap is used to
make sure that devices don't have conflicting settings for their boot
orders.

When a single device is parsed by itself (as in the case of
virDomainUpdateDeviceFlags), there is no global bootMap that would be
appropriate to send, so NULL is sent instead. However, although the
lowest level function that parses just the boot order *does* simply
skip the sanity check in that case, the next higher level
"virDomainDeviceInfoParseXML" function refuses to call down to the
lower "virDomainDeviceBootParseXML" if bootMap is NULL. So, the boot
order is never set in the "new" device object, and when it is compared
to the original (which does have a boot order), they don't match.

The fix is to patch virDomainDeviceInfoParseXML to not care about
bootMap, and just always call virDomainDeviceInfoBootParseXML whenever
there is a <boot> element. When we are only parsing a single device,
we don't care whether or not any specified boot order is consistent
with the rest of the domain; we will always do this check later (in
the current case, we do it by verifying that the net bootIndex exactly
matches the old bootIndex).

12 years agonetwork: use bandwidth from portgroup when appropriate
Laine Stump [Wed, 16 Jan 2013 17:46:01 +0000 (12:46 -0500)]
network: use bandwidth from portgroup when appropriate

The bandwidth plug and unplug functions were assuming that an
interface's bandwidth setting was always specified directly in the
domain's <interface> definition, but that's not necessarily true - it
could have been obtained from a <portgroup> definition in the network
definition. This patch fixes those functions to use
virDomainNetGetActualBandwidth(), which gets the bandwidth pointer
from iface->data.network.actual if it exists, otherwise returns
iface->bandwidth.

12 years agonetwork: Resolve some issues around vlan copying
John Ferlan [Tue, 15 Jan 2013 18:35:34 +0000 (13:35 -0500)]
network: Resolve some issues around vlan copying

Remove extraneous check for 'netdef' when dereferencing for vlan.nTags.
Prior code would already check if netdef was NULL.

Coverity complained about a path where the 'vlan' was potentially valid,
but a prior checks may not have allocated 'iface->data.network.actual',
so like other paths it needs to be allocated on the fly.

Move the copying of vlan up earlier in networkAllocateActualDevice, so
that actual.type gets properly set.

Since the first assignment to vlan is redundant except in the case of
jumping immediately to validate from the start of the function,
eliminate its initial setting at the top of the function in favor of
calling the helper function virDomainNetGetActualVlan() (which doesn't
depend on the local vlan pointer being initialized) down at validate:

Signed-off-by: Laine Stump <laine@redhat.com>
12 years agoFix inheritance of virNetClient
Daniel P. Berrange [Thu, 17 Jan 2013 17:22:13 +0000 (17:22 +0000)]
Fix inheritance of virNetClient

When creating the virClass object for virNetClient, we specified
virObject as the parent instead of virObjectLockable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agolock_daemon: Simplify error handling
Peter Krempa [Wed, 16 Jan 2013 10:51:21 +0000 (11:51 +0100)]
lock_daemon: Simplify error handling

No need to check the run_dir variable twice for NULL.

12 years agoAvoid integer wrap on remotePortMax in QEMU driver
Daniel P. Berrange [Thu, 17 Jan 2013 12:07:53 +0000 (12:07 +0000)]
Avoid integer wrap on remotePortMax in QEMU driver

The QEMU driver default max port is 65535, but it then increments
this by 1 to 65536. This maps to 0 in an unsigned short :-( This
was apparently done so that for() loops could use "< max" instead
of "<= max". Remove this insanity and just make the loop do the
right thing.

12 years agovirsh-volume.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:48:52 +0000 (15:48 +0100)]
virsh-volume.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-snapshot.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:44:18 +0000 (15:44 +0100)]
virsh-snapshot.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-secret.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:38:52 +0000 (15:38 +0100)]
virsh-secret.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-pool.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:36:53 +0000 (15:36 +0100)]
virsh-pool.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-nwfilter.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:32:22 +0000 (15:32 +0100)]
virsh-nwfilter.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-nodedev.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:30:11 +0000 (15:30 +0100)]
virsh-nodedev.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-network.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:28:17 +0000 (15:28 +0100)]
virsh-network.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-interface.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:24:04 +0000 (15:24 +0100)]
virsh-interface.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-host.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 14:18:32 +0000 (15:18 +0100)]
virsh-host.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-domain-monitor.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 13:03:21 +0000 (14:03 +0100)]
virsh-domain-monitor.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh-domain.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 11:26:54 +0000 (12:26 +0100)]
virsh-domain.c: Switch to C99 initialization of vshCmdOptDef

12 years agovirsh.c: Switch to C99 initialization of vshCmdOptDef
Michal Privoznik [Mon, 14 Jan 2013 11:26:23 +0000 (12:26 +0100)]
virsh.c: Switch to C99 initialization of vshCmdOptDef

12 years agolibvirt.c: fix typo in comment
Claudio Bley [Thu, 17 Jan 2013 12:38:29 +0000 (13:38 +0100)]
libvirt.c: fix typo in comment

12 years agoMove comments after enum members
Claudio Bley [Wed, 9 Jan 2013 13:03:50 +0000 (14:03 +0100)]
Move comments after enum members

The api builder always associates comments to the last member it read,
not to the current member even if there was a comment for the previous
member and a comma was already seen.

This has the effect that the comment for the previous member gets
overwritten and the current member has no comment at all.

12 years agopython: Avoid freeing uninitialized new_params pointer
Jiri Denemark [Tue, 15 Jan 2013 23:44:29 +0000 (00:44 +0100)]
python: Avoid freeing uninitialized new_params pointer

12 years agoinclude virterror_internal.h in threads.h
Hu Tao [Wed, 16 Jan 2013 02:53:05 +0000 (10:53 +0800)]
include virterror_internal.h in threads.h

required by VIR_ONCE_GLOBAL_INIT using virSetError.

12 years agoinclude util.h in cgroup.h
Hu Tao [Wed, 16 Jan 2013 02:53:04 +0000 (10:53 +0800)]
include util.h in cgroup.h

required by VIR_ENUM_DECL.

12 years agocall virstateCleanup to do the cleanup before libvirtd exits
Hu Tao [Wed, 16 Jan 2013 02:53:03 +0000 (10:53 +0800)]
call virstateCleanup to do the cleanup before libvirtd exits

12 years agoFix typo in variable name
Guido Günther [Wed, 16 Jan 2013 19:55:42 +0000 (20:55 +0100)]
Fix typo in variable name

that broke the build like:

  CC     libvirt_conf_la-domain_conf.lo
  conf/domain_conf.c: In function 'virDomainVcpuPinAdd':
  conf/domain_conf.c:11920:29: error: 'vpcupin' undeclared (first use in this function)
  conf/domain_conf.c:11920:29: note: each undeclared identifier is reported only once for each function it appears in
  make[3]: *** [libvirt_conf_la-domain_conf.lo] Error 1

12 years agolibxl: Fix cleanup on domain start error
Jim Fehlig [Tue, 15 Jan 2013 22:56:35 +0000 (15:56 -0700)]
libxl: Fix cleanup on domain start error

If building the libxl domain config fails, cleanup before returning
failure.

12 years agolibxl: Check for libxl_ctx_alloc failure
Jim Fehlig [Tue, 15 Jan 2013 22:54:46 +0000 (15:54 -0700)]
libxl: Check for libxl_ctx_alloc failure

12 years agolibxl: Don't free domain death event
Jim Fehlig [Tue, 15 Jan 2013 22:50:35 +0000 (15:50 -0700)]
libxl: Don't free domain death event

Callers should not free death events provided by libxl_evdisable_FOO().

12 years agolibxl: Use consistent parameter naming scheme
Jim Fehlig [Tue, 15 Jan 2013 22:47:05 +0000 (15:47 -0700)]
libxl: Use consistent parameter naming scheme

Use consistent parameter names throughout the libxl timeout and fd
event functions.

12 years agolibxl: Use consistent style for function definitions
Jim Fehlig [Tue, 15 Jan 2013 22:44:58 +0000 (15:44 -0700)]
libxl: Use consistent style for function definitions

Commit dfa1e1dd added functions whose definitions do not conform
to the style used in the libxl driver.  Change these functions to
be consistent throughout the driver.

12 years agolocking: Resolve resource leaks on non error path
John Ferlan [Tue, 15 Jan 2013 14:23:29 +0000 (09:23 -0500)]
locking: Resolve resource leaks on non error path

Both 'dir' and 'path' were not free'd on successful return

12 years agoconf: fix leak in virDomainVcpuPinAdd
Ján Tomko [Tue, 15 Jan 2013 14:43:08 +0000 (15:43 +0100)]
conf: fix leak in virDomainVcpuPinAdd

Fix the leak of vcpupin on failure to allocate cpumask and the leak of
cpumask if we fail to expand vcpupin_list.

12 years agoconf: fix class_id bitmap leak in virNetworkObj
Ján Tomko [Tue, 15 Jan 2013 14:20:02 +0000 (15:20 +0100)]
conf: fix class_id bitmap leak in virNetworkObj

Commit '07d1b6b' added class_id bitmap to virNetworkObj but never freed
it.

12 years agoqemu: fix QEMU_CAPS_NO_ACPI detection
Ján Tomko [Fri, 21 Dec 2012 13:20:11 +0000 (14:20 +0100)]
qemu: fix QEMU_CAPS_NO_ACPI detection

In commit c4bbaaf8, caps->arch was checked uninitialized, rendering the
whole check useless.

This patch moves the conditional setting of QEMU_CAPS_NO_ACPI to
qemuCapsInitQMP, and removes the no longer needed exception for S390.

It also clears the flag for all non-x86 archs instead of just S390 in
qemuCapsInitHelp.

12 years agoConvert libxl driver over to use virPortAllocator APIs
Daniel P. Berrange [Fri, 11 Jan 2013 12:09:53 +0000 (12:09 +0000)]
Convert libxl driver over to use virPortAllocator APIs

Replace the current libxl driver code for managing port
reservations with the new virPortAllocator APIs.

12 years agoConvert QEMU driver over to use virPortAllocator APIs
Daniel P. Berrange [Wed, 9 Jan 2013 15:28:58 +0000 (15:28 +0000)]
Convert QEMU driver over to use virPortAllocator APIs

Replace the current QEMU driver code for managing port
reservations with the new virPortAllocator APIs.

12 years agoAdd a port allocator class
Daniel P. Berrange [Wed, 9 Jan 2013 15:11:50 +0000 (15:11 +0000)]
Add a port allocator class

Introduce a virPortAllocator for managing TCP port allocations.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConvert all rpc classes over to virObjectLockable
Daniel P. Berrange [Wed, 9 Jan 2013 21:27:28 +0000 (21:27 +0000)]
Convert all rpc classes over to virObjectLockable

12 years agoConvert virDomainObj, qemuAgent, qemuMonitor, lxcMonitor to virObjectLockable
Daniel P. Berrange [Wed, 9 Jan 2013 21:00:32 +0000 (21:00 +0000)]
Convert virDomainObj, qemuAgent, qemuMonitor, lxcMonitor to virObjectLockable

The  virDomainObj, qemuAgent, qemuMonitor, lxcMonitor classes
all require a mutex, so can be switched to use virObjectLockable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoutil: Check for negative indent in virBufferAdd
John Ferlan [Tue, 15 Jan 2013 18:12:59 +0000 (13:12 -0500)]
util: Check for negative indent in virBufferAdd

Since virBufferGetIndent() will check and fail on buf->error, I
removed that check from virBufferAdd() and used the -1 return as the
way to exit.

12 years agotools: Check return status on virBufferTrim()
John Ferlan [Tue, 15 Jan 2013 18:12:57 +0000 (13:12 -0500)]
tools: Check return status on virBufferTrim()

12 years agorpc: Check and message setsockopt()
John Ferlan [Tue, 15 Jan 2013 18:12:56 +0000 (13:12 -0500)]
rpc: Check and message setsockopt()

Check status when attempting to set SO_REUSEADDR flag on outgoing connection
On failure, VIR_WARN(), but continue to connect. This code path is on the
sender side where the setting is just a hint and would only take effect if
the sender is overflowed with TCP connections.  Inability to set doesn't mean
failure to establish a connection.

12 years agoparallels: Remove unused JSON fetch of "OS"
John Ferlan [Tue, 15 Jan 2013 18:38:19 +0000 (13:38 -0500)]
parallels: Remove unused JSON fetch of "OS"

Commit id ac1c77f0 removed the "os" field in "parallelsDomObj" that
commit id aa296e6c had added and the data is not used by the function.

12 years agovirsh: Remove unused setting of 'br_node' and 'if_node'
John Ferlan [Tue, 15 Jan 2013 18:38:18 +0000 (13:38 -0500)]
virsh: Remove unused setting of 'br_node' and 'if_node'