]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
9 years agoqemu: mandate QEMU version 0.12.0 or newer
Daniel P. Berrange [Thu, 5 Nov 2015 10:51:48 +0000 (10:51 +0000)]
qemu: mandate QEMU version 0.12.0 or newer

Check the QEMU version and refuse to work with QEMU versions
older than 0.12.0. This is approximately the vintage of QEMU
that is available in RHEL-6 era distros.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails
Peter Krempa [Mon, 9 Nov 2015 12:44:29 +0000 (13:44 +0100)]
qemu: hotplug: Reject VFIO hotplug if setting RLIMIT_MEMLOCK fails

Check the return value of virCommandSetMaxMemLock when hotplugging VFIO
PCI hostdevs and reject the hotplug if the memory limit can't be set.

9 years agoqemu: hotplug: Fix mlock limit handling on memory hotplug
Peter Krempa [Fri, 6 Nov 2015 15:39:31 +0000 (16:39 +0100)]
qemu: hotplug: Fix mlock limit handling on memory hotplug

If mlock is required either due to use of VFIO hostdevs or due to the
fact that it's enabled it needs to be tweaked prior to adding new memory
or after removing a module. Add a helper to determine when it's
necessary and reuse it both on hotplug and hotunplug.

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

9 years agoqemu: Extract logic to determine the mlock limit size for VFIO
Peter Krempa [Fri, 6 Nov 2015 14:51:33 +0000 (15:51 +0100)]
qemu: Extract logic to determine the mlock limit size for VFIO

New function qemuDomainGetMlockLimitBytes will now handle the
calculation so that it unifies the logic to one place and allows later
reuse.

9 years agoconf: Make @def const in virDomainDefGetMemoryInitial
Peter Krempa [Thu, 8 Oct 2015 04:44:30 +0000 (06:44 +0200)]
conf: Make @def const in virDomainDefGetMemoryInitial

Keep const correctness and allow to use this function in cases where
@def is const in the caller.

9 years agotests: redo test argv file line wrapping
Daniel P. Berrange [Fri, 6 Nov 2015 13:20:06 +0000 (13:20 +0000)]
tests: redo test argv file line wrapping

Back in

  commit bd6c46fa0cfe275c24debc1152cfc5206c04b59b
  Author: Juerg Haefliger <juerg.haefliger@hp.com>
  Date:   Mon Jan 31 06:42:57 2011 -0500

    tests: handle backspace-newline pairs in test input files

all the test argv files were line wrapped so that the args
were less than 80 characters.

The way the line wrapping was done turns out to be quite
undesirable, because it often leaves multiple parameters
on the same line. If we later need to add or remove
individual parameters, then it leaves us having to redo
line wrapping.

This commit changes the line wrapping so that every
single "-param value" is one its own new line. If the
"value" is still too long, then we break on ',' or ':'
or ' ' as needed.

This means that when we come to add / remove parameters
from the test files line, the patch diffs will only
ever show a single line added/removed which will greatly
simplify review work.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agovirnetdev: Use virNetDevSetupControl in virNetDevSendEthtoolIoctl
John Ferlan [Wed, 4 Nov 2015 15:48:24 +0000 (10:48 -0500)]
virnetdev: Use virNetDevSetupControl in virNetDevSendEthtoolIoctl

Use virNetDevSetupControl instead of open coding using socket(AF_LOCAL...)
and clearing virIfreq.

By using virNetDevSetupControl, the socket is then opened using
AF_PACKET which requires being privileged (effectively root) in
order to complete successfully.  Since that's now a requirement,
then the ioctl(SIOCETHTOOL) should not fail with EPERM, thus it
is removed from the filtered listed of failure codes.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirnetdev: Check for root in virNetDevGetFeatures
John Ferlan [Wed, 4 Nov 2015 15:26:16 +0000 (10:26 -0500)]
virnetdev: Check for root in virNetDevGetFeatures

Since the SIOCETHTOOL ioctl only works for privileged daemons, if called
when not root, then virNetDevGetFeatures will VIR_DEBUG a message and
return 0 as if the functions were not available for the architecture.
This effectively returns an empty bitmap indicating no features available.

Introduced by commit id 'c9027d8f4'

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirnetdev: Fix function comments for virNetDevGetFeatures
John Ferlan [Fri, 6 Nov 2015 14:44:37 +0000 (09:44 -0500)]
virnetdev: Fix function comments for virNetDevGetFeatures

In commit id 'c9027d8f4' when updating the posted patch to generate
a bitmap instead of an array of named feature bits, adjustment of
the args was missed

9 years agovirnetdev: Document reasons for ignoring some SIOCETHTOOL errno values
John Ferlan [Fri, 6 Nov 2015 15:06:11 +0000 (10:06 -0500)]
virnetdev: Document reasons for ignoring some SIOCETHTOOL errno values

Recently reverted commit id '6f2a0198' showed a need to add extra
comments when dealing with filtering of potential "non-issues".

Scanning through upstream patch postings indicates early on the
reasons for the filtering of specific ioctl failures were provided;
however, when converted from causing an error to VIR_DEBUG's the
reasons were missing. A future read/change of the code incorrectly
assumed they could or should be removed.

9 years agoRevert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl"
Daniel P. Berrange [Tue, 3 Nov 2015 14:17:42 +0000 (14:17 +0000)]
Revert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl"

This reverts commit 6f2a0198e913c91a2ef8b99db79b7d3cc5396957.

This commit removed error reporting from virNetDevSendEthtoolIoctl
pushing responsibility onto the callers. This is wrong, however,
since virNetDevSendEthtoolIoctl calls virNetDevSetupControl
which can still report errors. So as a result virNetDevSendEthtoolIoctl
may or may not report errors depending on which bit of it fails, and as
a result callers now overwrite some errors.

It also introduced a regression causing unprivileged libvirtd to
spew error messages to the console due to inability to query the
NIC features, an error which was previously ignored.

virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted

Looking back at the original posting I see no explanation of why
thsi refactoring was needed, so reverting the clearly broken
error reporting logic looks like the best option.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agoqemu: migration: Actually error out on unsupported migration flag
Peter Krempa [Thu, 5 Nov 2015 14:23:37 +0000 (15:23 +0100)]
qemu: migration: Actually error out on unsupported migration flag

The code reported that a migration flag is unsupported but didn't jump
to the error label. Probably an oversight in commit f88af9dc that
introduced the flag checking.

9 years agoqemu: migration: Properly parse memory hotplug migration flag
Peter Krempa [Thu, 5 Nov 2015 14:20:21 +0000 (15:20 +0100)]
qemu: migration: Properly parse memory hotplug migration flag

Since the flag was not enabled when 'eating' the migration cookie,
libvirt reported a bogus error when memory hotplug was enabled:

 unsupported migration cookie feature memory-hotplug

The error was ignored though due to a bug in the code so it slipped
through testing.

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

9 years agonetwork: Remove extraneous ATTRIBUTE_NONNULL for virNetDevWaitDadFinish
John Ferlan [Wed, 4 Nov 2015 22:47:42 +0000 (17:47 -0500)]
network: Remove extraneous ATTRIBUTE_NONNULL for virNetDevWaitDadFinish

Commit id '0f7436ca' added virNetDevWaitDadFinish using ATTRIBUTE_NONNULL
for both arguments, although one is a non-null argument. A Coverity build
balks at that.

9 years agovirnetdev: Check correct return value for virNetDevFeatureAvailable
John Ferlan [Tue, 3 Nov 2015 22:01:25 +0000 (17:01 -0500)]
virnetdev: Check correct return value for virNetDevFeatureAvailable

Rather than "if (virNetDevFeatureAvailable(ifname, &cmd))" change the
success criteria to "if (virNetDevFeatureAvailable(ifname, &cmd) == 1)".

The called helper returns -1 on failure, 0 on not found, and 1 on found.
Thus a failure was setting bits.

Introduced by commit ac3ed20 which changed the helper's return
values without adjusting its callers

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: add /usr/lib to AC_PATH_PROG for qemu-bridge-helper
Michel Normand [Wed, 4 Nov 2015 09:01:24 +0000 (10:01 +0100)]
qemu: add /usr/lib to AC_PATH_PROG for qemu-bridge-helper

For openSUSE the qemu-bridge-helper is installed in /usr/lib
So libvirt has to search it in this directory.

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
9 years agostorage: On 'buildVol' failure don't delete the volume
John Ferlan [Thu, 8 Oct 2015 20:44:02 +0000 (16:44 -0400)]
storage: On 'buildVol' failure don't delete the volume

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

Commit id 'fdda3760' only managed a symptom where it was possible to
create a file in a pool without libvirt's knowledge, so it was reverted.

The real fix is to have all the createVol API's which actually create
a volume (disk, logical, zfs) and the buildVol API's which handle the
real creation of some volume file (fs, rbd, sheepdog) manage deleting
any volume which they create when there is some sort of error in
processing the volume.

This way the onus isn't left up to the storage_driver to determine whether
the buildVol failure was due to some failure as a result of adjustments
made to the volume after creation such as getting sizes, changing ownership,
changing volume protections, etc. or simple a failure in creation.

Without needing to consider that the volume has to be removed, the
buildVol failure path only needs to remove the volume from the pool.
This way if a creation failed due to duplicate name, libvirt wouldn't
remove a volume that it didn't create in the pool target.

9 years agoRevert "storage: Prior to creating a volume, refresh the pool"
John Ferlan [Thu, 8 Oct 2015 20:47:30 +0000 (16:47 -0400)]
Revert "storage: Prior to creating a volume, refresh the pool"

This reverts commit fdda37608a6e22406fbdfe4ac0c573a96a8d0417.

This commit only manages a symptom of finding a buildRet failure
where a volume was not listed in the pool, but someone created the
volume outside of libvirt in the pool being managed by libvirt.

9 years agostorage: Pull volume removal from pool in storageVolDeleteInternal
John Ferlan [Thu, 8 Oct 2015 20:33:16 +0000 (16:33 -0400)]
storage: Pull volume removal from pool in storageVolDeleteInternal

Create a helper function to remove volume from the pool.

9 years agostorage: Cleanup failures in virStorageBackendCreateRaw
John Ferlan [Thu, 8 Oct 2015 20:00:41 +0000 (16:00 -0400)]
storage: Cleanup failures in virStorageBackendCreateRaw

After successfully returning from virFileOpenAs, if subsequent calls fail,
then we need to remove the file since our caller expects that failures after
creation will remove the created file.

9 years agostorage: Cleanup failures virStorageBackendCreateExecCommand
John Ferlan [Tue, 3 Nov 2015 16:30:23 +0000 (11:30 -0500)]
storage: Cleanup failures virStorageBackendCreateExecCommand

After a successful qemu-img/qcow-create of the backing file, if we
fail to stat the file, change it owner/group, or mode, then the
cleanup path should remove the file.

9 years agostorage: Fix setting mode in virStorageBackendCreateExecCommand
John Ferlan [Wed, 14 Oct 2015 13:56:14 +0000 (09:56 -0400)]
storage: Fix setting mode in virStorageBackendCreateExecCommand

Currently the code does not handle the NFS root squash environment
properly since if the file gets created, then the subsequent chmod
will fail in a root squash environment where we're creating a file
in the pool with qemu tools, such as seen via:

   $ virsh vol-create-from $pool $file.xml file.img --inputpool $pool

assuming $file.xml is creating a file of "<format type='qcow2'"> from
an existing file.img in the pool of "<format type='raw'>".

This patch will utilize the virCommandSetUmask when creating the file
in the NETFS pool. The virCommandSetUmask API was added in commit id
'0e1a1a8c4', which was after the original code was developed in commit
id 'e1f27784' to attempt to handle the root squash environment.

Also, rather than blindly attempting to chmod, check to see if the
st_mode bits from the stat match what we're trying to set and only
make the chmod if they don't.

Also, a slight adjustment to the fallback algorithm to move the
virCommandSetUID/virCommandSetGID inside the if (!filecreated) since
they're only useful if we need to attempt to create the file again.

9 years agoRemove new lines from log messages
Jiri Denemark [Tue, 27 Oct 2015 18:14:01 +0000 (19:14 +0100)]
Remove new lines from log messages

VIR_DEBUG and VIR_WARN will automatically add a new line to the message,
having "\n" at the end or at the beginning of the message results in
empty lines.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Fix memory leak in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:40:42 +0000 (14:40 +0200)]
qemu: Fix memory leak in qemuProcessStart

nodeset should be freed in both success and failure paths.

While tmppath is freed immediately after it's consumed, moving it from
error to cleanup label is a bit more consistent and robust.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Introduce cleanup label in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:30:52 +0000 (14:30 +0200)]
qemu: Introduce cleanup label in qemuProcessStart

Remove code duplication by moving common cleanup code in a dedicated
label.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Rename ret variable in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:26:46 +0000 (14:26 +0200)]
qemu: Rename ret variable in qemuProcessStart

Generally, we use "ret" variable for storing the value we are going to
return at the and of a function, but this is not the case in
qemuProcessStart. Let's rename "ret" as "rv".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Rename cleanup label in qemuProcessStart
Jiri Denemark [Tue, 20 Oct 2015 12:24:51 +0000 (14:24 +0200)]
qemu: Rename cleanup label in qemuProcessStart

Current "cleanup" label is only used in error path, thus it should
rather be called "error".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Use correct type when calling qemuPrepareNVRAM
Jiri Denemark [Tue, 20 Oct 2015 08:11:26 +0000 (10:11 +0200)]
qemu: Use correct type when calling qemuPrepareNVRAM

qemuProcessStart was passing char * migrateFrom as the third argument to
qemuPrepareNVRAM. We should explicitly convert the pointer to bool which
is what the function expects.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoPost-release version bump to 1.2.22
Jiri Denemark [Wed, 4 Nov 2015 12:09:03 +0000 (13:09 +0100)]
Post-release version bump to 1.2.22

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoRelease of libvirt-1.2.21
Daniel Veillard [Wed, 4 Nov 2015 02:59:12 +0000 (10:59 +0800)]
Release of libvirt-1.2.21

* docs/news.html.in libvirt.spec.in: Updated for the release
* po/*.po*: regenerated

9 years agoutil: set max wait for IPv6 DAD to 20 seconds
Laine Stump [Thu, 29 Oct 2015 18:09:59 +0000 (14:09 -0400)]
util: set max wait for IPv6 DAD to 20 seconds

This was originally set to 5 seconds, but times of 5.5 to 7 seconds
were experienced. Since it's an arbitrary number intended to prevent
an infinite hang, having it a bit too high won't hurt anything, and 20
seconds looks to be adequate (i.e. I think/hope we don't need to make
it tunable in libvirtd.conf)

9 years agoutil: set error if DAD is not finished
Luyao Huang [Thu, 29 Oct 2015 09:47:33 +0000 (17:47 +0800)]
util: set error if DAD is not finished

If DAD not finished in 5 seconds, user will get an
unknown error like this:

 # virsh net-start ipv6
 error: Failed to start network ipv6
 error: An error occurred, but the cause is unknown

Call virReportError to set an error.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agowireshark: Install to generic plugin directory
Michal Privoznik [Tue, 27 Oct 2015 13:02:19 +0000 (14:02 +0100)]
wireshark: Install to generic plugin directory

There has been a report on the list [1] that we are not
installing the wireshark dissector into the correct plugin
directory. And in fact we are not. The problem is, the plugin
directory path is constructed at compile time. However, it's
dependent on the wireshark version, e.g.

  /usr/lib/wireshark/plugins/1.12.6

This is rather unfortunate, because if libvirt RPMs were built
with one version, but installed on a system with newer one, the
plugins are not really loaded. This problem lead fedora packagers
to unify plugin path to:

  /usr/lib/wireshark/plugins/

Cool! But this was enabled just in wireshark-1.12.6-4. Therefore,
we must require at least that version.

And while at it, on some distributions, the wireshark.pc file
already has a variable that defines where plugin dir is. Use that
if possible.

1: https://www.redhat.com/archives/libvirt-users/2015-October/msg00063.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoFix virNetDevWaitDadFinish stub
Roman Bogorodskiy [Thu, 29 Oct 2015 04:20:16 +0000 (07:20 +0300)]
Fix virNetDevWaitDadFinish stub

Build on non-Linux fails because the virNetDevWaitDadFinish() stub
has unused parameters. Fix by adding appropriate ATTRIBUTE_UNUSED
for these parameters.

Pushing under build-breaker rule.

9 years agonetwork: wait for DAD to finish for bridge IPv6 addresses
Maxim Perevedentsev [Tue, 20 Oct 2015 15:44:18 +0000 (18:44 +0300)]
network: wait for DAD to finish for bridge IPv6 addresses

commit db488c79 assumed that dnsmasq would complete IPv6 DAD before
daemonizing, but in reality it doesn't wait, which creates problems
when libvirt's bridge driver sets the matching "dummy tap device" to
IFF_DOWN prior to DAD completing.

This patch waits for DAD completion by periodically polling the kernel
using netlink to check whether there are any IPv6 addresses assigned
to bridge which have a 'tentative' state (if there are any in this
state, then DAD hasn't yet finished). After DAD is finished, execution
continues. To avoid an endless hang in case something was wrong with
the kernel's DAD, we wait a maximum of 5 seconds.

9 years agonetlink: add support for multi-part netlink messages.
Maxim Perevedentsev [Tue, 20 Oct 2015 15:44:19 +0000 (18:44 +0300)]
netlink: add support for multi-part netlink messages.

Such messages do not have NLMSG_ERROR or NLMSG_DONE type
but they are valid responses. We test 'multi-partness'
by looking for NLM_F_MULTI flag.

9 years agoqemu: Use live autoNodeset when numatune placement is auto
Luyao Huang [Mon, 12 Oct 2015 09:28:15 +0000 (17:28 +0800)]
qemu: Use live autoNodeset when numatune placement is auto

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

Commit id '9deb96f' removed the code to fetch the nodeset from the
CpusetMems cgroup for a running vm in favor of using the return from
virDomainNumatuneFormatNodeset introduced by commit id '43b67f2e7'.
However, that API will return the value of the passed 'auto_nodeset'
when placement is VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO, which happens
to be NULL.

Since commit id 'c74d58ad' started using priv->autoNodeset in order
to manage the auto placement value during qemuProcessStart, it should
be passed along in order to return the correct value if the domain
requests the auto placement.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agorbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided
Wido den Hollander [Tue, 27 Oct 2015 14:16:34 +0000 (15:16 +0100)]
rbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided

When a RBD volume has snapshots it can not be removed.

This patch introduces a new flag to force volume removal,
VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS.

With this flag any existing snapshots will be removed prior to
removing the volume.

No existing mechanism in libvirt allowed us to pass such information,
so that's why a new flag was introduced.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
9 years agoutil: implement virProcessGetStartTime on GNU/kFreeBSD
Pino Toscano [Thu, 15 Oct 2015 11:50:42 +0000 (13:50 +0200)]
util: implement virProcessGetStartTime on GNU/kFreeBSD

Use the virProcessGetStartTime implementation also when only the kernel
is FreeBSD, such as on GNU/kFreeBSD.

9 years agobhyve: implement domainGetOSType
Roman Bogorodskiy [Tue, 20 Oct 2015 17:32:42 +0000 (20:32 +0300)]
bhyve: implement domainGetOSType

9 years agovirsh-domain: use correct base for virStrToLong_ui
Pavel Hrdina [Wed, 21 Oct 2015 10:43:29 +0000 (12:43 +0200)]
virsh-domain: use correct base for virStrToLong_ui

While parsing device addresses we should use correct base and don't
count on auto-detect.  For example, PCI address uses hex numbers, but
each number starting with 0 will be auto-detected as octal number and
that's wrong.  Another wrong use-case is for PCI address if for example
bus is 10, than it's incorrectly parsed as decimal number.

PCI and CCW addresses have all values as hex numbers, IDE and SCSI
addresses are in decimal numbers.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agolibvirt-domain: fix the error reporting when use the localhost as target uri
Luyao Huang [Tue, 27 Oct 2015 08:54:01 +0000 (16:54 +0800)]
libvirt-domain: fix the error reporting when use the localhost as target uri

Remove the extra %s in error message when call virReportInvalidArg().

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolibvirt-domain: fix no error report when p2p migrate fail
Luyao Huang [Tue, 27 Oct 2015 08:54:00 +0000 (16:54 +0800)]
libvirt-domain: fix no error report when p2p migrate fail

After commit a26669d7, we only jump to error when
virDomainMigrateUnmanagedParams return a value less than -1.
this will make the migrate result always be success even we
meet some problem.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: fix migration flags undefinesource cannot work
Luyao Huang [Tue, 27 Oct 2015 08:53:59 +0000 (16:53 +0800)]
qemu: fix migration flags undefinesource cannot work

In commit f41be296, we moved vm->persistent check into
qemuDomainRemoveInactive, but we didn't change the vm->persistent
before call qemuDomainRemoveInactive in some place before and just
call it to remove the inactive vm.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Add serial target type to ABI stability check
Luyao Huang [Wed, 21 Oct 2015 07:14:03 +0000 (15:14 +0800)]
conf: Add serial target type to ABI stability check

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

There is no ABI check for serial target type attribute, just
add it.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolock_daemon: Switch to wrapper locking functions
Michal Privoznik [Wed, 7 Oct 2015 11:36:43 +0000 (13:36 +0200)]
lock_daemon: Switch to wrapper locking functions

Lets use wrapper functions virLockDaemonLock and
virLockDaemonUnlock instead of virMutexLock and virMutexUnlock.
This has no functional impact, but it's easier to read (at least
for me).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()
Andrea Bolognani [Mon, 26 Oct 2015 11:09:33 +0000 (12:09 +0100)]
qemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()

This calls the PCI-, USB- and SCSI-specific functions just
like qemuHostdev{Prepare,ReAttach}DomainDevices() already do,
and was the missing piece for the qemuHostdev API to nicely
mirror the virHostdev API.

Update qemuProcessReconnect() to use the new function.

9 years agoqemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:26:30 +0000 (14:26 +0200)]
qemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()

Adopt the same names used for virHostdevUpdateActive*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:12:48 +0000 (14:12 +0200)]
qemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()

Adopt the same names used for virHostdevReAttach*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:10:16 +0000 (14:10 +0200)]
qemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()

Adopt the same names used for virHostdevPrepare*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agohostdev: Rename virHostdevUpdateDomainActiveDevices()
Andrea Bolognani [Mon, 26 Oct 2015 10:59:41 +0000 (11:59 +0100)]
hostdev: Rename virHostdevUpdateDomainActiveDevices()

The new name, virHostdevUpdateActiveDomainDevices(), follows the
same naming conventions used by the rest of the module.

No functional changes.

9 years agotests: Remove unused nodeinfo test data
Andrea Bolognani [Wed, 7 Oct 2015 12:04:53 +0000 (14:04 +0200)]
tests: Remove unused nodeinfo test data

A bunch of files that we don't currently parse, and are very
unlikely to ever start parsing, made their way into the nodeinfo
test data. Get rid of them.

9 years agovirsh: Display an error when passing count <= 0 to setvcpus
Luyao Huang [Thu, 22 Oct 2015 03:27:35 +0000 (11:27 +0800)]
virsh: Display an error when passing count <= 0 to setvcpus

The number of vCPUs for a guest must be between 1 and the
maximum value configured in the domain XML. This commit
introduces checks to make sure that passing count <= 0
results in an error.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Fix error message to use correct parameter
John Ferlan [Tue, 20 Oct 2015 17:16:16 +0000 (13:16 -0400)]
conf: Fix error message to use correct parameter

Fix a cut-n-paste error from commit id '35eecdde' where the previous
check for max_sectors seems to have been copied, but the error message
parameter not updated to be ioeventfd

9 years agoutil: Produce friendlier error message to user
Luyao Huang [Wed, 21 Oct 2015 04:13:41 +0000 (12:13 +0800)]
util: Produce friendlier error message to user

Commit id '1c24cfe9' added error messages for virNumaSetPagePoolSize;
however, virNumaGetHugePageInfo also uses virNumaGetHugePageInfoPath
in order to build the path, but it never checked upon return if
the built path exists which could lead to an error message as follows:

$ virsh freepages 0 1
error: Failed to open file
    '/sys/devices/system/node/node0/hugepages/hugepages-1kB/free_hugepages':
    No such file or directory

Rather than add the same message for the other two callers, adjust
the virNumaGetHugePageInfoPath in order not only build the path, but
also check if the built path exists.  If the path does not exist,
then generate the error message and return failure.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: Adjust error paths for virNumaSetPagePoolSize
Luyao Huang [Wed, 21 Oct 2015 04:13:40 +0000 (12:13 +0800)]
util: Adjust error paths for virNumaSetPagePoolSize

Commit id '1c24cfe9' added new checks and error messaes for failure
scenarios. Let's adjust those error messages to after the call to
virNumaGetHugePageInfoPath in order to provide a more specific error
message depending on node and page_size

After this patch:
 # virsh allocpages --pagesize 2047 --pagecount 1 --cellno 0
 error: operation failed: page size 2047 is not available on node 0

 # virsh allocpages --pagesize 2047 --pagecount 1
 error: operation failed: page size 2047 is not available

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: split the virNumaGetHugePageInfoPath into separate function
Luyao Huang [Wed, 21 Oct 2015 04:13:39 +0000 (12:13 +0800)]
util: split the virNumaGetHugePageInfoPath into separate function

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

Refactor helper virNumaGetHugePageInfoPath to handle returning a directory
path when passed a page_size of 0 and suffix == NULL into a new helper
virNumaGetHugePageInfoDir which will only be called when a directory
path is expected to be returned. This solves the issue where the helper
was called with page_size == 0 expecting a file path in return, but
instead got a directory path and failed in virFileReadAll with:

    error : virFileReadAll:1358 : Failed to read file
                '/sys/devices/system/node/node0/hugepages/': Is a directory

Since virNumaGetPages API expects to return a directory by passing
page_size == 0 and suffix == NULL, it will now call the new helper.
Callers to virNumaGetHugePageInfoPath expect to return a file path
which could then be used in the call to virFileReadAll.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoAvoid using !STREQ and !STRNEQ
Ishmanpreet Kaur Khera [Tue, 20 Oct 2015 16:15:12 +0000 (21:45 +0530)]
Avoid using !STREQ and !STRNEQ

We have macros for both positive and negative string matching.
Therefore there is no need to use !STREQ or !STRNEQ. At the same
time as we are dropping this, new syntax-check rule is
introduced to make sure we won't introduce it again.

Signed-off-by: Ishmanpreet Kaur Khera <khera.ishman@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoNEWS: Fix XSLT stylesheet
Andrea Bolognani [Tue, 13 Oct 2015 07:44:13 +0000 (09:44 +0200)]
NEWS: Fix XSLT stylesheet

This has been broken for a looong time - in fact, we've been
shipping a mostly-empty NEWS file for at least the past two years.

Including the html namespace and using it for matching elements,
like hacking1.xsl and hacking2.xsl were already doing, makes the
NEWS file useful again.

Add a note explaining that the release list has been split up
by year as well.

9 years agoNEWS: Split releases by year
Andrea Bolognani [Thu, 15 Oct 2015 09:19:28 +0000 (11:19 +0200)]
NEWS: Split releases by year

Update cfg.mk to ignore the split files during
syntax-check (thanks Martin).

9 years agovz: implement some domain API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement some domain API calls

The following functions are implemented:

vzDomainIsUpdated, vzDomainGetVcpusFlags and vzDomainGetMaxVcpus.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement API calls of nodeGetxxx family
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement API calls of nodeGetxxx family

The following functions were implemented:

 vzNodeGetCPUStats, vzNodeGetMemoryStats,
 vzNodeGetCellsFreeMemory and vzNodeGetFreeMemory.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement connectGetMaxVcpus API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement connectGetMaxVcpus API calls

Because we have no limitation for maximal number of vcpus in containers
we report as maximum 1028 just for the sake of common sence.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agosecurity_dac: Introduce remember/recall APIs
Michal Privoznik [Wed, 7 Oct 2015 09:38:23 +0000 (11:38 +0200)]
security_dac: Introduce remember/recall APIs

Even though the APIs are not implemented yet, they create a
skeleton that can be filled in later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agosecurity_dac: Limit usage of virSecurityDACSetOwnershipInternal
Michal Privoznik [Wed, 7 Oct 2015 09:08:55 +0000 (11:08 +0200)]
security_dac: Limit usage of virSecurityDACSetOwnershipInternal

This function should really be called only when we want to change
ownership of a file (or disk source). Lets switch to calling a
wrapper function which will eventually record the current owner
of the file and call virSecurityDACSetOwnershipInternal
subsequently.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACRestoreSecurityFileLabel: Pass virSecurityDACDataPtr
Michal Privoznik [Wed, 7 Oct 2015 08:57:18 +0000 (10:57 +0200)]
virSecurityDACRestoreSecurityFileLabel: Pass virSecurityDACDataPtr

This is pure code adjustment. The structure is going to be needed
later as it will hold a reference that will be used to talk to
virtlockd. However, so far this is no functional change just code
preparation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACSetOwnership: Pass virSecurityDACDataPtr
Michal Privoznik [Wed, 7 Oct 2015 08:51:04 +0000 (10:51 +0200)]
virSecurityDACSetOwnership: Pass virSecurityDACDataPtr

This is pure code adjustment. The structure is going to be needed
later as it will hold a reference that will be used to talk to
virtlockd. However, so far this is no functional change just code
preparation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACSetOwnershipInternal: Don't chown so often
Michal Privoznik [Wed, 7 Oct 2015 08:39:17 +0000 (10:39 +0200)]
virSecurityDACSetOwnershipInternal: Don't chown so often

It's better if we stat() file that we are about to chown() at
first and check if there's something we need to change. Not that
it would make much difference, but for the upcoming patches we
need to be doing stat() anyway. Moreover, if we do things this
way, we can drop @chown_errno variable which will become
redundant.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agosecurity_dac: Fix TODO marks
Michal Privoznik [Wed, 7 Oct 2015 09:16:08 +0000 (11:16 +0200)]
security_dac: Fix TODO marks

Correctly mark the places where we need to remember and recall
file ownership. We don't want to mislead any potential developer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirtlockd: Don't SIGSEGV on SIGUSR1
Michal Privoznik [Mon, 12 Oct 2015 07:58:05 +0000 (09:58 +0200)]
virtlockd: Don't SIGSEGV on SIGUSR1

So we have this mechanism that on SIGUSR1 the virtlockd dumps its
internal state into a JSON file, reexec itself and the reloads
the internal state back. However, there's a bug in our
implementation:

  (gdb) signal SIGUSR1
  Continuing with signal SIGUSR1.
  [Thread 0x7fd094f7b700 (LWP 10602) exited]
  process 10600 is executing new program: /home/zippy/work/libvirt/libvirt.git/src/virtlockd
  warning: Could not load shared library symbols for linux-vdso.so.1.
  Do you need "set solib-search-path" or "set sysroot"?
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib64/libthread_db.so.1".
  [New Thread 0x7fb28bc3c700 (LWP 14501)]

  Program received signal SIGSEGV, Segmentation fault.
  0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
  288         if (*countptr + add < *countptr) {
  (gdb) bt
  #0  0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
  #1  0x00007fb29132a267 in virNetServerAddProgram (srv=0x0, prog=0x7fb2915d08b0) at rpc/virnetserver.c:661
  #2  0x00007fb29131f27f in main (argc=1, argv=0x7fff8f771298) at locking/lock_daemon.c:1445

Notice the NULL @srv passed to frame 2? Usually, the @srv
variable is initialized on fresh start. However, in case of
daemon reload, the code path that is responsible for initializing
the value was not triggered and therefore we crashed immediately.
Fix this by always setting the variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoClose the source fd if the destination qemu exits during tunnelled migration
Shivaprasad G Bhat [Thu, 8 Oct 2015 12:29:07 +0000 (17:59 +0530)]
Close the source fd if the destination qemu exits during tunnelled migration

Tunnelled migration can hang if the destination qemu exits despite all the
ABI checks. This happens whenever the destination qemu exits before the
complete transfer is noticed by source qemu. The savevm state checks at
runtime can fail at destination and cause qemu to error out.
The source qemu cant notice it as the EPIPE is not propogated to it.
The qemuMigrationIOFunc() notices the stream being broken from virStreamSend()
and it cleans up the stream alone. The qemuMigrationWaitForCompletion() would
never get to 100% transfer completion.
The qemuMigrationWaitForCompletion() never breaks out as well since
the ssh connection to destination is healthy, and the source qemu also thinks
the migration is ongoing as the Fd to which it transfers, is never
closed or broken. So, the migration will hang forever. Even Ctrl-C on the
virsh migrate wouldn't be honoured. Close the source side FD when there is
an error in the stream. That way, the source qemu updates itself and
qemuMigrationWaitForCompletion() notices the failure.

Close the FD for all kinds of errors to be sure. The error message is not
copied for EPIPE so that the destination error is copied instead later.

Note:
Reproducible with repeated migrations between Power hosts running in different
subcores-per-core modes.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
9 years agoconf: Optimize the iothreadid initialization
John Ferlan [Tue, 13 Oct 2015 12:26:27 +0000 (08:26 -0400)]
conf: Optimize the iothreadid initialization

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

The existing algorithm assumed that someone was making small, incremental
changes; however, it is possible to change iothreads from 0 (or relatively
small number) to some really large number and the algorithm would possibly
spin its wheels doing unnecessary searches.

So, optimize the algorithm using a bitmap to find available iothread_id's
starting at 1 that aren't already defined by a "<thread id='#'>" and
filling in the iothreadids array with those iothread_id values.

9 years agoqemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD
John Ferlan [Thu, 15 Oct 2015 16:30:40 +0000 (12:30 -0400)]
qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD

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

When qemuDomainPinIOThread was added in commit id 'fb562614', a check
for the IOThread capability was not needed since a check for iothreadpids
covered the condition where the support for IOThreads was not present.
The iothreadpids array was only created if qemuProcessDetectIOThreadPIDs
was able to query the monitor for IOThreads. It would only do that if
the QEMU_CAPS_OBJECT_IOTHREAD capability was set.

However, when iothreadids were added in commit id '8d4614a5' and the
check for iothreadpids was replaced by a search through the iothreadids[]
array for the matching iothread_id that left open the possibility that
an iothreadids[] array was defined, but the entries essentially pointed
to elements with only the 'iothread_id' defined leaving the 'thread_id'
value of 0 and eventually the cpumap entry of NULL.

This was because, the original IOThreads commit id '72edaae7' only
checked if IOThreads were defined and if the emulator had the IOThreads
capability, then IOThread objects were added at startup. The "capability
failure" check was only done when a disk was assigned to an IOThread in
qemuCheckIOThreads. This was because the initial implementation had no way
to dynamically add IOThreads, but it was possible to dynamically add a
disk to the domain. So the decision was if the domain supported it, then
add the IOThread objects. Then if a disk with an IOThread defined was
added, it could check the capability and fail to add if not there. This
just meant the 'iothreads' value was essentially ignored.

Eventually commit id 'a27ed6e7' allowed for the dynamic addition and
deletion of IOThread objects. So it was no longer necessary to generate
IOThread objects to dynamically attach a disk to. However, the startup
and disk check code was not modified to reflect this.

This patch will move the capability failure check to when IOThread
objects are being added to the command line. Thus a domain that has
IOThreads defined will not be started if the emulator doesn't support
the capability. This means when qemuCheckIOThreads is called to add
a disk, it's no longer necessary to check the capability. Instead the
code can use the IOThreadFind call to indicate that the IOThread
doesn't exist.

Finally because it could be possible to have a domain running with the
iothreadids[] defined prior to this change if libvirtd is restarted each
having mostly empty elements, qemuProcessDetectIOThreadPIDs will check
if there are niothreadids when the QEMU_CAPS_OBJECT_IOTHREAD capability
check fails and remove the elements and array if it exists.

With these changes in place, it turns out the cputune-numatune test
was failing because the right bit wasn't set in the test. So used the
opportunity to fix that and create a test that would expect to fail
with some sort of iothreads defined and used, but not having the
correct capability.

9 years agoqemu: Check for niothreads == 0 in qemuSetupCgroupForIOThreads
John Ferlan [Thu, 15 Oct 2015 20:05:52 +0000 (16:05 -0400)]
qemu: Check for niothreads == 0 in qemuSetupCgroupForIOThreads

If there are no IOThreads defined, no sense making other checks

9 years agoqemu: Use 'niothreadids' instead of 'iothreads'
John Ferlan [Thu, 15 Oct 2015 14:26:26 +0000 (10:26 -0400)]
qemu: Use 'niothreadids' instead of 'iothreads'

Although theoretically both should be the same value, the niothreadids
should be used in favor of iothreads when performing comparisons. This
leaves the iothreads as a purely numeric value to be saved in the config
file.  The one exception to the rule is virDomainIOThreadIDDefArrayInit
where the iothreadids are being generated from the iothreads count since
iothreadids were added after initial iothreads support.

9 years agovirsh: Use 'format' argument only when specified
Peter Krempa [Fri, 16 Oct 2015 07:01:17 +0000 (09:01 +0200)]
virsh: Use 'format' argument only when specified

The condition checking whether --format was specified was incorrect.
virsh crashed if the following format was used:

 virsh dump VM dump --format '' --memory-only

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

9 years agodocs: event impl. registration before hypervisor connection
Dominik Perpeet [Fri, 25 Sep 2015 08:54:21 +0000 (10:54 +0200)]
docs: event impl. registration before hypervisor connection

Event implementations need to be registered before a connection to the
Hypervisor is opened, otherwise event handling can be impaired (e.g.
delayed messages). This fact is referenced in an e-mail [1], but should
also be noted in the documentation of the registration functions.

[1] https://www.redhat.com/archives/libvirt-users/2014-April/msg00011.html

9 years agoFix conficts with HACKING doc
Wei Jiangang [Thu, 15 Oct 2015 09:12:20 +0000 (17:12 +0800)]
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>
9 years agolibvirt-secret: Fix typo
Wei Jiangang [Thu, 15 Oct 2015 09:12:19 +0000 (17:12 +0800)]
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>
9 years agoconf: Refactor the iothreadid initialization
John Ferlan [Tue, 13 Oct 2015 12:22:14 +0000 (08:22 -0400)]
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>
9 years agoNEWS: Unify date format
Andrea Bolognani [Wed, 14 Oct 2015 07:54:58 +0000 (09:54 +0200)]
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.

9 years agoNEWS: Unify section titles
Andrea Bolognani [Wed, 14 Oct 2015 07:46:51 +0000 (09:46 +0200)]
NEWS: Unify section titles

There were some inconsistencies; now the section title is always
one of Bug Fixes, Cleanups, Documentation, Features, Improvements,
Portability, Security.

9 years agoNEWS: Add empty lines
Andrea Bolognani [Tue, 13 Oct 2015 16:59:20 +0000 (18:59 +0200)]
NEWS: Add empty lines

Make sure there is always an empty line between sections.

9 years agoNEWS: Fix indentation
Andrea Bolognani [Tue, 13 Oct 2015 16:26:12 +0000 (18:26 +0200)]
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.

9 years agoNEWS: Fix newlines
Andrea Bolognani [Tue, 13 Oct 2015 16:10:03 +0000 (18:10 +0200)]
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.

9 years agoNEWS: Fix whitespace
Andrea Bolognani [Tue, 13 Oct 2015 15:50:57 +0000 (17:50 +0200)]
NEWS: Fix whitespace

Mostly missing space between change description and author name or
spurious space before section title.

Reflow the introductory paragraph as well.

9 years agoNEWS: Organize old entries
Andrea Bolognani [Tue, 13 Oct 2015 14:06:52 +0000 (16:06 +0200)]
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.

9 years agoNEWS: Split old entries (2009)
Andrea Bolognani [Wed, 14 Oct 2015 06:54:51 +0000 (08:54 +0200)]
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.

9 years agoNEWS: Split old entries (2008)
Andrea Bolognani [Wed, 14 Oct 2015 06:55:17 +0000 (08:55 +0200)]
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.

9 years agoNEWS: Split old entries (2006-2007)
Andrea Bolognani [Wed, 14 Oct 2015 06:55:48 +0000 (08:55 +0200)]
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.

9 years agoNEWS: Properly escape > in HTML
Andrea Bolognani [Tue, 13 Oct 2015 15:40:03 +0000 (17:40 +0200)]
NEWS: Properly escape > in HTML

9 years agoNEWS: Split off merged sections
Andrea Bolognani [Tue, 13 Oct 2015 16:07:38 +0000 (18:07 +0200)]
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

9 years agoNEWS: Remove empty sections
Andrea Bolognani [Tue, 13 Oct 2015 15:22:53 +0000 (17:22 +0200)]
NEWS: Remove empty sections

9 years agoNEWS: Include description for release 0.7.3
Andrea Bolognani [Tue, 13 Oct 2015 07:57:47 +0000 (09:57 +0200)]
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.

9 years agotests: make redirects happen in correct order
Wei Jiangang [Wed, 14 Oct 2015 10:39:13 +0000 (18:39 +0800)]
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>
9 years agostorage: Rework error paths for virStorageBackendCreateExecCommand
John Ferlan [Thu, 8 Oct 2015 17:48:14 +0000 (13:48 -0400)]
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>
9 years agostorage: On error rmdir created directory in virDirCreate[NoFork]
John Ferlan [Thu, 8 Oct 2015 12:50:34 +0000 (08:50 -0400)]
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>
9 years agostorage: On error unlink created file in virFileOpen{As|Forked}
John Ferlan [Thu, 8 Oct 2015 12:39:51 +0000 (08:39 -0400)]
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>
9 years agostorage: Track successful creation of LV for removal
John Ferlan [Thu, 8 Oct 2015 21:26:01 +0000 (17:26 -0400)]
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>
9 years agostorage: Fix a resource leak in storageVolCreateXML
John Ferlan [Thu, 8 Oct 2015 20:24:47 +0000 (16:24 -0400)]
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>