mpath: Don't allow more than one mpath pool at a time

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

Since an mpath pool contains all the Multipath devices on a host, allowing
more than one defined on a host at a time should be disallowed under the
policy of disallowing duplicate source pools for the host.

Adjust to docs to clarify the Multipath target path value usage for both
the storage driver (only 1 pool per host) and formatstorage references
(ignore the target element in favor of the default target mapping of
/dev/mapper).
This commit is contained in:
John Ferlan 2015-06-24 08:45:24 -04:00
parent dbad001899
commit a77056bdb5
3 changed files with 7 additions and 1 deletions

View File

@ -401,6 +401,8 @@
guaranteed stable across reboots, since they are allocated on
demand. It is preferable to use a stable location such as one
of the <code>/dev/disk/by-{path|id|uuid|label}</code> locations.
For a Multipath pool (type <code>mpath</code>), the provided
value is ignored and the default value of "/dev/mapper" is used.
<span class="since">Since 0.4.1</span>
</dd>
<dt><code>permissions</code></dt>

View File

@ -505,7 +505,8 @@
<h2><a name="StorageBackendMultipath">Multipath pools</a></h2>
<p>
This provides a pool that contains all the multipath devices on the
host. Volume creating is not supported via the libvirt APIs.
host. Therefore, only one Multipath pool may be configured per host.
Volume creating is not supported via the libvirt APIs.
The target element is actually ignored, but one is required to appease
the libvirt XML parser.<br/>
<br/>

View File

@ -2569,6 +2569,9 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn,
matchpool = pool;
break;
case VIR_STORAGE_POOL_MPATH:
/* Only one mpath pool is valid per host */
matchpool = pool;
break;
case VIR_STORAGE_POOL_RBD:
case VIR_STORAGE_POOL_LAST:
break;