[virt-tools-list] [virt-manager PATCH] virtManager: clone: check which storage pools supports volume cloning
Pavel Hrdina
phrdina at redhat.com
Mon Mar 4 12:16:15 UTC 2019
On Sat, Mar 02, 2019 at 07:01:35PM -0500, Cole Robinson wrote:
> On 3/1/19 6:18 AM, Pavel Hrdina wrote:
> > When cloning a guest in virt-manager the GUI shows a list of disks and
> > select default cloning policy for every disk. For storage pools where
> > we know that cloning is not possible we should not select that option
> > as default one.
> >
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1463066
> >
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> > virtManager/clone.py | 11 ++++++-----
> > virtManager/storagepool.py | 4 ++--
> > virtinst/storage.py | 24 ++++++++++++++++++------
> > 3 files changed, 26 insertions(+), 13 deletions(-)
> >
> > diff --git a/virtManager/clone.py b/virtManager/clone.py
> > index 895d258a..cd991f6b 100644
> > --- a/virtManager/clone.py
> > +++ b/virtManager/clone.py
> > @@ -64,6 +64,11 @@ def can_we_clone(conn, vol, path):
> > elif not os.path.exists(path):
> > msg = _("Path does not exist.")
> >
> > + else:
> > + pool = vol.get_parent_pool()
> > + if not pool.supports_volume_creation(clone=True):
> > + msg = _("Cannot clone {} storage pool.".format(pool.get_type()))
> > +
>
> Ugh I know this is what the python world is pushing these days but I
> personally find that format to be ugly and far less readable. Please use
> the traditional format for this patch. If you feel strongly about using
> that format in the code base let's have a top level thread about it.
OK, I'll change the formatting back to the old style before pushing.
> Otherwise:
>
> Reviewed-by: Cole Robinson <crobinso at redhat.com>
Thanks,
Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20190304/7493afdd/attachment.sig>
More information about the virt-tools-list
mailing list