[virt-tools-list] [virt-manager PATCH] virtinst.storage: check _pool_xml before using it
Pavel Hrdina
phrdina at redhat.com
Wed May 17 07:16:01 UTC 2017
On Tue, May 16, 2017 at 05:37:31PM -0400, Cole Robinson wrote:
> On 05/16/2017 10:59 AM, Pavel Hrdina wrote:
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450311
> >
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> > virtinst/storage.py | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/virtinst/storage.py b/virtinst/storage.py
> > index a6963d50..66201efc 100644
> > --- a/virtinst/storage.py
> > +++ b/virtinst/storage.py
> > @@ -698,7 +698,9 @@ class StorageVolume(_StorageObject):
> > return self.TYPE_DIR
> > elif self.type == "network":
> > return self.TYPE_NETWORK
> > - return self._pool_xml.get_disk_type()
> > + if self._pool_xml:
> > + return self._pool_xml.get_disk_type()
> > + return None
> > file_type = property(_get_vol_type)
> >
> >
> >
>
> There's a couple other places in the StorageVolume code that seem to depend on
> self._pool_xml being populated, so I don't think this is a complete fix. I
> think we need to figure out what the root cause is and then add a test case to
> trigger it. I've asked for more info in the bug
The root cause for this bug is code in virtinst/diskbackend.py:546,
we creates a StorageVolume object without setting pool, I'll send
v2.
Thanks
Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20170517/786f1948/attachment.sig>
More information about the virt-tools-list
mailing list