From 8f09b85515f78b8e73e71abcd8f0a61cbab7d7ff Mon Sep 17 00:00:00 2001 Message-Id: <8f09b85515f78b8e73e71abcd8f0a61cbab7d7ff@dist-git> From: Pavel Hrdina Date: Wed, 15 May 2019 08:06:09 -0400 Subject: [PATCH] cli: Fix pool=default when path belongs to another pool (bz 1692489) From: Cole Robinson Using 'virt-install --disk size=X' implicitly uses pool=default. If a pool named 'default' exists we use that; if not, and a pool using the default path exists under a different name, we attempt to use that as well, and if that doesn't exist, we create pool=default The second case is broken, so if there's no pool=default and eg. pool=FOO points to /var/lib/libvirt/images, we still attempt to look up pool=default which understandably fails https://bugzilla.redhat.com/show_bug.cgi?id=1692489 (cherry picked from commit a0ca387aad0fde19683aa8b5b5636add6455b8b4) Signed-off-by: Cole Robinson Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1714752 --- virtinst/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virtinst/cli.py b/virtinst/cli.py index 21467a4d..63acb642 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2029,7 +2029,9 @@ class ParserDisk(VirtCLIParser): poolobj = None if poolname: if poolname == "default": - StoragePool.build_default_pool(self.guest.conn) + poolxml = StoragePool.build_default_pool(self.guest.conn) + if poolxml: + poolname = poolxml.name poolobj = self.guest.conn.storagePoolLookupByName(poolname) if volname: -- 2.21.0