Refuse invalid qcow2 backing files

Don't allow qcow2 files that are pointing to backing files outside of:

volume-<id>
volume-<id>.<snap-id>
volume-<id>.tmp-snap-<snap-id>

(optionally prefixed with /mnt/path)

Closes-Bug: #1350504

Change-Id: Ic89cffc93940b7b119cfcde3362f304c9f2875df
(cherry picked from commit dca3c8323cf8cf12aa8ce4ba21f647ce631e8153)
Windows SMBFS: Handle volume_name in _qemu_img_info

The volume_name is now parsed to the _qemu_img_info wrapper. As
this method is not prone to security issues because this driver
does not support raw images (at least not yet), we don't have to
perform any checks on the backing image file path.

Thus, this method simply ignores this argument that will be parsed
by the base class methods.

Related-Bug: #1350504

Change-Id: I801a6338250ec2dc631c4058543f7d0088b3e4d4
(cherry picked from commit 5e0ce63d6df39dcad5a0ef35553369e49c67dfb8)
Updated from global requirements

Change-Id: I116f04494e596e470f8fec242466ac5fe21b222c
Sync latest processutils from oslo-incubator

An earlier commit (Ia92aab76fa83d01c5fbf6f9d31df2463fc26ba5c) failed
to address ssh_execute(). This change set addresses ssh_execute.

------------------------------------------------

oslo-incubator head:

commit 4990535fb5f3e2dc9b397e1a18c1b5dda94ef1c4
Merge: 9f5c700 2a130bf
Author: Jenkins <jenkins@review.openstack.org>
Date:   Mon Sep 29 23:12:14 2014 +0000

    Merge "Script to list unreleased changes in all oslo projects"

-----------------------------------------------

The sync pulls in the following changes (newest to oldest):

6a60f842 - Mask passwords in exceptions and error messages (SSH)

-----------------------------------------------

Change-Id: Ie0caf32469126dd9feb44867adf27acb6e383958
Closes-Bug: #1377981
(cherry picked from commit 5e4e1f7ea71f9b4c7bd15809c58bc7a1838ed567)
Merge "Refuse invalid qcow2 backing files" into proposed/juno
Merge "Windows SMBFS: Handle volume_name in _qemu_img_info" into proposed/juno
IBM Storwize driver: Retype the volume with correct empty QoS

* Currently for Storwzie driver, if the new type does not have QoS
configurations, the old QoS configurations remain in the volume after
retyping it. It should be retyped into a volume with empty QoS for the
Storwize driver.
* Refactor three dicts into one for better maintainance of the QoS keys
for Storwize driver.

DocImpact

Change-Id: I2b2801a4ef72ef02c11392ed00b56f5263a8a7e4
Closes-Bug: #1368595
(cherry picked from commit 26de1b1d829849665dae921b8be739194b84515d)
Deprecate / obsolete NetApp volume extra specs

The NetApp Data ONTAP (Cluster-mode) NFS & iSCSI drivers for Juno support
the Cinder pools feature, but the drivers are reporting two qualified
extra specs that must be converted to unqualified extra specs in order to
be used by the Cinder scheduler's capability filter. Furthermore, there
are four extra specs that must be deprecated due to having the pools
feature.  Warnings will be logged during volume creation if any of the
obsolete or deprecated extra specs are seen in the volume type.

Change-Id: I4dbd667610e481356304a12b8dae84cff61aa9d9
Closes-bug: 1374630
(cherry picked from commit 4cb4be4122a44dc99d6f29f065cdd32ae86273ce)
Fix race condition in ISCSIConnector _disconnect_volume_multipath_iscsi

This is a similar issue as seen in
https://bugs.launchpad.net/cinder/+bug/1375382

The list of devices returned by driver.get_all_block_devices() in
_disconnect_volume_multipath_iscsi will potentially contain broken
symlinks as the SCSI devices have been deleted from calling
self._linuxscsi.remove_multipath_device(device_realpath) right before
_disconnect_volume_multipath_iscsi but the udev rule for the symlink
may not yet have completed.

Adding in a check to os.path.exists() will ensure that we will not
consider the broken symlinks as an “in use” device.

Change-Id: I79c9627e9b47127d3765fcec5b7e3bacef179630
Closes-Bug: #1375946
(cherry picked from commit 4541521de576297d9b7d4115b040ff54773d9d50)
ZFSSA iSCSI driver cannot add multple initiators to a group

All initiators defined in zfssa_initiator property would be
added to the group.
Also fixed some typos related to initiators error messages.

Change-Id: Iec6c90702e5aafa153b4a7f1e429974ac450afc0
Closes-Bug: #1369750
(cherry picked from commit f94d671e627dd7b5143422ffe739418fcfb51a70)
Handle eqlx SSH connection close on abort.

EqualLogic array CLI operation timeout causes the
SSH thread to be aborted. This would cause SSH
sessions to be orphaned and hit a max connection
limit on the array. This fix catches these aborts
and makes sure the connection is closed.

Change-Id: I9392fd5dd79eb44f252bf50217f17cc473e6f2f0
Closes-Bug: 1374613
(cherry picked from commit 5cb23b67c53437fc51a6b37acac477fba4d6a7ab)
ZFSSA iSCSI vol create fails with vol type option

Vol create with volume-type option is not working since
volume_backend_name contains the class name as
predefined string. No matter what was specified in cinder.conf
as volume_backend_name, volume creation failed.
Multi-backend option and using extra specs to create custom volumes
won't work.
The fix is to look whether volume_backend_name is part of the
configuration or falls into the class name in case there is
no backend name.

Closes-Bug: 1373621
DocImpact

(cherry picked from commit 5c61d57d3693523e9cbf11bf0b5b09bafe699247)

Change-Id: I1bc501dd4c5689d96c7beb720b64112df1770232
Merge "Deprecate / obsolete NetApp volume extra specs" into proposed/juno
Merge "Fix race condition in ISCSIConnector _disconnect_volume_multipath_iscsi" into proposed/juno
Merge "ZFSSA iSCSI driver cannot add multple initiators to a group" into proposed/juno
Merge "IBM Storwize driver: Retype the volume with correct empty QoS" into proposed/juno
Merge "Handle eqlx SSH connection close on abort." into proposed/juno
Make sure device support Direct before setting

We added '-t none' option to the qemu-img convert operation
in image_utils.py a while back to accomodate a couple of
backend devices that didn't flush writes on disconnect.
(Change: I7a04f683add8c23b9125fe837c4048ccc3ac224d)

The only problem here is that some backend devices don't
support Direct mode and raise an exception and fail when
setting this option.

This patch adds a simple check using dd to see if the dest
supports the Direct flag and only sets '-t none' if the device
does in fact support it.

Additionally it was brought up that even yet other backends
are using file devices not blk devices.  In their case setting
Direct will still work, however it's sub-optimal as qemu-convert
has internal mechanisms to make sure flushing etc are done
correctly and efficiently for those devices.  So to accomodate
that particular use case I'm also adding a check if blk dev
that can be used for determining whether to set Direct for the
qemu-convert process.

Change-Id: I34127ac373ceadcfb6fc2662628b1a91eb7b0046
Closes-Bug: 1375487
(cherry picked from commit c42273fbc1983b146180c82b8a34b0d832a6f431)
Merge "Updated from global requirements" into proposed/juno
NetApp fix eseries unit test mock clean

This patch fixes the issue of mock not getting
cleaned for requests in unit tests.

Closes-Bug: #1353506

Change-Id: Iab401021d7f180ff1f2bf3ed79166699112cc367
(cherry picked from commit 140956515327494a53de6ad09c35690624248f0a)