Commit Graph

20639 Commits

Author SHA1 Message Date
Wei Jiangang
c3d4eb124c Fix conficts with HACKING doc
Don't compare a bool variable against the literal, "true".

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2015-10-15 11:31:27 +02:00
Wei Jiangang
3bbaf7b86f libvirt-secret: Fix typo
seclets ==> selects
qualfied ==> qualified

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2015-10-15 11:31:27 +02:00
John Ferlan
897c972a96 conf: Refactor the iothreadid initialization
Create a separate local API that will fill in the iothreadid array
entries that were not defined by <iothread id='#'> entries in the XML.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-14 20:33:29 -04:00
Andrea Bolognani
0331da65ed NEWS: Unify date format
There were some inconsistencies, eg. the number of digits used for
the day. The month name was also spelled out instead of abbreviated
in some instances.
2015-10-14 18:18:03 +02:00
Andrea Bolognani
f84fc5a557 NEWS: Unify section titles
There were some inconsistencies; now the section title is always
one of Bug Fixes, Cleanups, Documentation, Features, Improvements,
Portability, Security.
2015-10-14 18:17:33 +02:00
Andrea Bolognani
149cd07446 NEWS: Add empty lines
Make sure there is always an empty line between sections.
2015-10-14 18:17:15 +02:00
Andrea Bolognani
ccc969762f NEWS: Fix indentation
Some of the paragraphs were not properly indented: while this was
not a problem in the HTML version, you could tell the difference
in the plain text version.
2015-10-14 18:16:19 +02:00
Andrea Bolognani
a7a0eb531d NEWS: Fix newlines
Some <br/> tags were missing from the end of the corresponding
line, some of there were in the middle of the line instead.
2015-10-14 18:12:04 +02:00
Andrea Bolognani
7b45172a06 NEWS: Fix whitespace
Mostly missing space between change description and author name or
spurious space before section title.

Reflow the introductory paragraph as well.
2015-10-14 18:11:02 +02:00
Andrea Bolognani
348bb33701 NEWS: Organize old entries
Sort all items into the standard categories: Features, Bug Fixes,
Improvements, Cleanups, etc.

The sorting is somewhat arbitrary in certain instances.
2015-10-14 18:04:21 +02:00
Andrea Bolognani
bb91111ce2 NEWS: Split old entries (2009)
The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.
2015-10-14 17:50:59 +02:00
Andrea Bolognani
36c4066590 NEWS: Split old entries (2008)
The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.
2015-10-14 17:49:26 +02:00
Andrea Bolognani
b8515b4e3a NEWS: Split old entries (2006-2007)
The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.
2015-10-14 17:48:57 +02:00
Andrea Bolognani
5ab0598479 NEWS: Properly escape > in HTML 2015-10-14 17:44:16 +02:00
Andrea Bolognani
33a6a8a95e NEWS: Split off merged sections
Portability and Bug Fixes for release 0.7.3 were merged together;
same for Features and Security for release 1.1.3. Split them off
2015-10-14 17:43:54 +02:00
Andrea Bolognani
4155e5300e NEWS: Remove empty sections 2015-10-14 17:43:46 +02:00
Andrea Bolognani
be153a721b NEWS: Include description for release 0.7.3
The description for this release, unlike all other descriptions,
was inside a <p> element; however, the XSLT stylesheet contains a
template that drops all <p> elements from the output file, so it
never made it to the generated NEWS file.

Use a <li> element, same as all other releases, instead.
2015-10-14 17:43:20 +02:00
Wei Jiangang
28a72d65ca tests: make redirects happen in correct order
It should redirect stdout to /dev/null first,
then redirect stderr to whatever stdout currently points at.

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
2015-10-14 13:10:38 +02:00
John Ferlan
1059c48180 storage: Rework error paths for virStorageBackendCreateExecCommand
Rework the code in order to use the "ret = -1;" and goto cleanup;
coding style.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
21eb897241 storage: On error rmdir created directory in virDirCreate[NoFork]
After a successful creation of a directory, if some other call results
in returning a failure, let's remove the directory we created to
prevent another round trip or confusion in the caller. In particular, this
function can be called during a storage backend buildVol, so in order
to ensure that caller doesn't need to distinguish between failed create
or some other failure after create, just remove the directory we created.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
695562154f storage: On error unlink created file in virFileOpen{As|Forked}
After a successful creation of a file, if some other call results
in returning a failure, let's unlink the file we created to prevent
another round trip or confusion in the caller. In particular, this
function can be called during a storage backend buildVol, so in order
to ensure that caller doesn't need to distinguish between failed create
or some other failure after create, just remove the volume we created.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
c4dd2a1faf storage: Track successful creation of LV for removal
https://bugzilla.redhat.com/show_bug.cgi?id=1233003

Track when the logical volume was successfully created in order to
properly handle the call to virStorageBackendLogicalDeleteVol. It's
possible that the failure to create was because someone created an
LV in the pool outside of libvirt's knowledge. In this case, we don't
want to delete that LV.  A subsequent or future refresh of the pool
will find the volume and cause an earlier failure

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
27d2d99fe7 storage: Fix a resource leak in storageVolCreateXML
Commit id '1b5685da' refactored the code to move buildvoldef inside
the buildVol conditional; however, the VIR_FREE of the memory was
left only when 'buildret' failed, thus we're leaking memory.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
6ab98a68b7 storage: Remove duplicitous refreshVol in Sheepdog buildVol
As of commit id '155ca616' a 'refreshVol' is called after a buildVol
succeeds in storageVolCreateXML, thus a volStorageBackendSheepdogRefreshVolInfo
call in virStorageBackendSheepdogBuildVol is no longer necessary.

Additionally, the 'conn' parameter becomes unused.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
John Ferlan
9cb36def82 storage: Remove duplicitous refreshVol in RBD buildVol
As of commit id '155ca616' a 'refreshVol' is called after the buildVol
succeeds in storageVolCreateXML, thus the volStorageBackendRBDRefreshVolInfo
call in virStorageBackendRBDBuildVol is no longer necessary.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-13 18:03:55 -04:00
Eric Blake
4117e80332 build: include xdr cflags for libvirt-admin
Without this, building on cygwin fails with:

  CC       libvirt_admin_la-libvirt-admin.lo
libvirt-admin.c:25:21: fatal error: rpc/rpc.h: No such file or directory
 #include <rpc/rpc.h>
                     ^

Reported-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2015-10-13 14:39:08 -06:00
Daniel P. Berrange
9139b46a6b virt-host-validate: check for IOMMU support
This looks for existance of DMAR (Intel) and IVRS (AMD)
files under /sys/firmware/acpi/tables/, as a sign that
the platform has IOMMU present & enabled in the BIOS.

If these are present and /sys/kernel/iommu_groups does
not contain any entries this is taken as a sign that
the kernel has not enabled the IOMMU currently.

If no ACPI tables are found we can't distinguish between
disabled in BIOS and not present in the hardware, so we
have to give the user a generic hint.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-10-13 10:54:09 +01:00
Michal Privoznik
179d92c848 libvirt-domain: Drop virDomainMigrateCheckNotLocal attribute
Our apibuild.py script does not cope with ATTRIBUTE_NONNULL:

Parse Error: parsing function type, ')' expected
Got token  ('name', 'char')
Last token:  ('name', 'char')
Token queue:  [('op', '*'), ('name', 'dconnuri'), ('sep', ')')]
Line 3297 end:
Makefile:2441: recipe for target '../../docs/apibuild.py.stamp' failed

Let's drop it. Moreover, up until e17ae3ccc2 where it was
introduced we did not really care about NULL-ity of dconnuri. And
moreover the ATTRIBUTE_NONNULL merely checks for static calls
over NULL, it won't catch the dynamic ones, where a NULL is
passed by a variable at runtime.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-10-12 16:37:15 +02:00
John Ferlan
5275c0f4a1 storage: Fix incorrect format for <disk> <auth> XML
https://bugzilla.redhat.com/show_bug.cgi?id=1256999

After creating a copy of the 'authdef' in a pool -> disk translation,
unconditionally clear the 'authType' in the resulting disk auth def
structure since that's used for a storage pool and not a disk.  This
ensures virStorageAuthDefFormat will properly format the <auth> XML
for a <disk> (e.g. it won't have a <auth type='%s'.../>).
2015-10-12 09:46:59 -04:00
Daniel P. Berrange
09a7a34076 virt-host-validate: disable mntent code on Win32
Win32 does not have support for mntent.h header, so the
method which uses this must be stubbed out.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-10-12 14:37:37 +01:00
Daniel P. Berrange
9bf595b172 virt-host-validate: check for required cgroups
Extend the virt-host-validate checks to see if the required
cgroups are compiled into the kernel and that they are
mounted on the system. The cgroups are all optional except
for 3 that LXC mandates

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-10-12 13:15:00 +01:00
Daniel P. Berrange
fd6d506c50 virt-host-validate: distinguish exists vs accessible for devices
Currently we just check that various devices are accessible.
This leads to inaccurate errors reported for /dev/kvm and
/dev/vhost-net if they exist but an unprivileged user lacks
access. Switch existing checks to look for file existance,
and add a separate check for accessibility of /dev/kvm
since some distros don't grant users access by default.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-10-12 13:15:00 +01:00
Daniel P. Berrange
8a6b6037f8 virt-host-validate.c: check for kernel namespaces
The LXC driver requires the uts, mnt, pid & ipc
namespaces, while net & user namespaces are
optional. Validate all these are present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-10-12 13:15:00 +01:00
Nikolay Shirokovskiy
44a96fe914 migration: check dconnuri in p2p mode
Check dconnuri is not null or we will catch nullpointer later.
I hope this makes Coverity happy.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:36 +02:00
Nikolay Shirokovskiy
a26669d753 migration: refactor: introduce parameter checking function
virDomainMigrateUnmanagedParams is not a good candidate for this functionality
as it is used by migrate family functions too and its have its own checks that
are superset of extracted and we don't need to check twice.

Actually name of the function is slightly misleading as there is also a check
for consistensy of flags parameter alone. So it could be refactored further and
reused by all migrate functions but for now let it be a matter of a different
patchset.

It is *not* a pure refactoring patch as it introduces offline check for older
versions. Looks like it must be done that way and no one will be broken too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:32 +02:00
Nikolay Shirokovskiy
06c910eadf migration: merge all proto branches into single function
Finally on this step we get what we were aimed for - toURI{1, 2} (and
migration{*} APIs too) now can work thru V3_PARAMS protocol. Execution path
goes thru unchanged virDomainMigrateUnmanaged adapter function which is called
by all target places.

Note that we keep the fact that direct migration never works
thru V3_PARAMS proto. We can't change this aspect without
further investigation.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:28 +02:00
Nikolay Shirokovskiy
dce0162b9a migration: refactor: refactor parameter compatibility checks
Move virDomainMigrateUnmanagedProto* expected params list check into
function itself and use common virTypedParamsCheck for this purpose.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:26 +02:00
Nikolay Shirokovskiy
813355e256 migration: refactor: extract parameter adaption functions
Extract parameter adaptation and checking which is protocol dependent into
designated functions. Leave only branching and common checks in
virDomainMigrateUnmanagedParams.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:23 +02:00
Nikolay Shirokovskiy
8db77b372e migration: refactor: introduce params version of unmanaged
Let's put main functionality into params version of virDomainMigrateUnmanaged
as a preparation step for merging it with virDomainMigratePeer2PeerParams.
virDomainMigrateUnmanaged then does nothing more then just adapting arguments.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:18 +02:00
Nikolay Shirokovskiy
323ba66eaa migration: refactor: merge direct and p2p into unmanaged
p2p plain and direct function are good candidates for code reuse. Their main
function is same - to branch among different versions of migration protocol and
implementation of this function is also same. Also they have other common
functionality in lesser aspects. So let's merge them.

But as they have different signatures we have to get to convention on how to
pass direct migration 'uri' in 'dconnuri' and 'miguri'. Fortunately we alreay
have such convention in parameters passed to toURI2 function, just let's follow
it. 'uri' is passed in miguri and dconnuri is ignored.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:14 +02:00
Nikolay Shirokovskiy
5c239b3a2f migration: refactor: rename uri parameter to miguri
We use miguri name for this parameter in other places. So
make naming more consitent.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:31:11 +02:00
Michal Privoznik
cba522caf7 migration: remove direct migration dependency on version1 of driver
Direct migration should work if *perform3 is present but *perform
is not. This is situation when driver migration is implemented
after new version of driver function is introduced. We should not
be forced to support old version too as its parameter space is
subspace of newer one.
2015-10-12 13:30:58 +02:00
Nikolay Shirokovskiy
341216a0af migration: move implementation check to branches in p2p
This is more structured code so it will be easier to add branch for _PARAMS
protocol here. It is not a pure refactoring strictly speaking as we remove
scenarios for broken cases when driver defines V3 feature and implements
perform function. So it is additionally a more solid code.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:30:55 +02:00
Nikolay Shirokovskiy
e17ae3ccc2 migration: refactor: reuse p2p url check
Refactor dconnuri local server URI check to common API.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:30:53 +02:00
Nikolay Shirokovskiy
4a2409252e migration: refactor: get rid of use_params p2p_full
'useParams' parameter usage is an example of control coupling. Most of the work
inside the function is done differently except for the uri check. Lets split
this function into two, one with extensible parameters set and one with hardcoded
parameter set.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-10-12 13:30:49 +02:00
Michal Privoznik
4f77c48cba virJSONValueArraySize: return ssize_t
The internal representation of a JSON array counts the items in
size_t. However, for some reason, when asking for the count it's
reported as int. Firstly, we need the function to return a signed
type as it's returning -1 on an error. But, not every system has
integer the same size as size_t. Therefore, lets return ssize_t.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-10-09 15:25:08 +02:00
Andrea Bolognani
6c928996e6 src: Remove $(builddir) usage
Commit 4e8032272f used $(builddir) in the header search
path to fix a build issue; however, $(builddir) is not defined
by old autoconf versions such as the one available in CentOS 5,
resulting in the following error:

  cc1: error: /util: No such file or directory
  make[3]: *** [libvirt_driver_la-fdstream.lo] Error 1

Since $(builddir) is defined to always be '.', just use that
value directly instead.
2015-10-09 13:04:56 +02:00
Andrea Bolognani
4e8032272f src: Include $(builddir)/util in the header search path
Since a9fe620372, we are generating virkeymaps.h at build
time; however, we are not including $(builddir)/util in the
header search path, so when doing a VPATH build the compiler
is unable to locate the file.

make[2]: Entering directory
`/home/jenkins/libvirt/systems/libvirt-fedora-20/build/src'
  GEN      util/virkeymaps.h
  ...
  CC       util/libvirt_util_la-virkeycode.lo
  CC       util/libvirt_util_la-virkeyfile.lo
  CC       util/libvirt_util_la-virlockspace.lo
  CC       util/libvirt_util_la-virlog.lo
../../src/util/virkeycode.c:27:24: fatal error: virkeymaps.h: No such file or directory
 #include "virkeymaps.h"
                        ^
compilation terminated.
2015-10-09 09:40:37 +02:00
Maxim Nestratov
04a39574a8 vz: cleanup
Remove unused definitions, functions and structure fields.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2015-10-08 16:44:48 +03:00
John Ferlan
4ee3d4c285 storage: Perform some cleanup of calls
Cleanup calls to virStorageBackendCopyToFD a bit.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-10-08 07:06:51 -04:00