|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
# HG changeset patch
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
# User "Cole Robinson <crobinso@redhat.com>"
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
# Date 1224005406 14400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
# Node ID f117c8243aa5a616f2112f9906e3fa3330e08f32
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
# Parent 3e2e7db24cb57416eee6f520a691ffe3abd86050
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
Refresh storage pool if trying to lookup a volume.
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
diff -r 3e2e7db24cb5 -r f117c8243aa5 virtinst/VirtualDisk.py
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
--- a/virtinst/VirtualDisk.py Thu Oct 09 12:35:25 2008 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+++ b/virtinst/VirtualDisk.py Tue Oct 14 13:30:06 2008 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
@@ -300,6 +300,56 @@
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
"""
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
return (self.vol_object != None or self.vol_install != None)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ def __check_if_path_managed(self):
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ vol = None
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ err = None
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ pool = util.lookup_pool_by_path(self.conn,
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ os.path.dirname(self.path))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ if pool:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ try:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ vol = self.conn.storageVolLookupByPath(self.path)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ except Exception, e:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ # Pool may need to be refreshed
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ pool.refresh(0)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ try:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ vol = self.conn.storageVolLookupByPath(self.path)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ except Exception, e:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ verr = str(e)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ if not vol:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ # Path wasn't a volume. See if base of path is a managed
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ # pool, and if so, setup a StorageVolume object
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ if pool:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ if self.size == None:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ raise ValueError(_("Size must be specified for non "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ "existent volume path '%s'" % \
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ self.path))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ logging.debug("Path '%s' is target for pool '%s'. "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ "Creating volume '%s'." % \
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ (os.path.dirname(self.path), pool.name(),
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ os.path.basename(self.path)))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ volclass = Storage.StorageVolume.get_volume_for_pool(pool_object=pool)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ cap = (self.size * 1024 * 1024 * 1024)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ if self.sparse:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ alloc = 0
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ #alloc = cap
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ # XXX: disable setting managed storage as nonsparse
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ # XXX: since it hoses libvirtd (for now)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ alloc = 0
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ vol = volclass(name=os.path.basename(self.path),
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ capacity=cap, allocation=alloc, pool=pool)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ self._set_vol_install(vol, validate=False)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ elif self._is_remote():
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ raise ValueError(_("'%s' is not managed on remote "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ "host: %s" % (self.path, verr)))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ logging.debug("Didn't find path '%s' managed on "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ "connection: %s" % (self.path, verr))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ self._set_vol_object(vol, validate=False)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
def __validate_params(self):
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
"""
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
function to validate all the complex interaction between the various
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
@@ -314,51 +364,9 @@
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
if not storage_capable and self._is_remote():
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
raise ValueError, _("Connection doesn't support remote storage.")
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
-
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
if storage_capable and self.path is not None \
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
and not self.__storage_specified():
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- vol = None
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- verr = None
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- try:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- vol = self.conn.storageVolLookupByPath(self.path)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- except Exception, e:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- verr = str(e)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
-
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- if not vol:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- # Path wasn't a volume. See if base of path is a managed
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- # pool, and if so, setup a StorageVolume object
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- pool = util.lookup_pool_by_path(self.conn,
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- os.path.dirname(self.path))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- if pool:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- if self.size == None:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- raise ValueError(_("Size must be specified for non "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- "existent path '%s'" % self.path))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- logging.debug("Path '%s' is target for pool '%s'. "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- "Creating volume '%s'." % \
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- (os.path.dirname(self.path), pool.name(),
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- os.path.basename(self.path)))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- volclass = Storage.StorageVolume.get_volume_for_pool(pool_object=pool)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- cap = (self.size * 1024 * 1024 * 1024)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- if self.sparse:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- alloc = 0
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- #alloc = cap
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- # XXX: disable setting managed storage as nonsparse
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- # XXX: since it hoses libvirtd (for now)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- alloc = 0
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- vol = volclass(name=os.path.basename(self.path),
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- capacity=cap, allocation=alloc,
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- pool=pool)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- self._set_vol_install(vol, validate=False)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- elif self._is_remote():
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- raise ValueError(_("'%s' is not managed on remote "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- "host: %s" % (self.path, verr)))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- logging.debug("Didn't find path '%s' managed on "
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- "connection: %s" % (self.path, verr))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- else:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
- self._set_vol_object(vol, validate=False)
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
-
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
+ self.__check_if_path_managed()
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
if self._is_remote() and not self.__storage_specified():
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
37b7231 |
raise ValueError, _("Must specify libvirt managed storage if on "
|