qubesvm: improve error message about same-pool requirement

Make it clear that volume creation fails because it needs to be in the
same pool as its parent. This message is shown in context of `qvm-create
-p root=MyPool` for example and the previous message didn't make sense
at all.

Fixes QubesOS/qubes-issues#3438
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-18 00:03:05 +02:00
parent ba210c41ee
commit 58bcec2a64
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1990,7 +1990,9 @@ def _patch_pool_config(config, pool=None, pools=None):
if not is_snapshot:
config['pool'] = str(pools[name])
else:
msg = "Can't clone a snapshot volume {!s} to pool {!s} " \
msg = "Snapshot volume {0!s} must be in the same pool as its " \
"origin ({0!s} volume of template)," \
"cannot move to pool {1!s} " \
.format(name, pools[name])
raise qubes.exc.QubesException(msg)
return config