> -----Original Message----- > From: virt-tools-list-bounces@xxxxxxxxxx > [mailto:virt-tools-list-bounces@xxxxxxxxxx] On Behalf Of Chunyan Liu > Sent: Friday, December 05, 2014 4:40 PM > To: virt-tools-list@xxxxxxxxxx > Subject: [PATCH] virtinst: refresh pools status before > fetch_pools > > Currently, when connecting to hypervisor, if there are pools active > but in fact target path already deleted (or for other reasons the > pool is not working), libvirtd not refresh status yet, fetch_pools > will fail, that will cause "connecting to hypervisor" process > reporting error and exit. The whole connection work failed. > > With the patch, always refresh pool status before fetch pools. Let > the libvirtd pool status reflect the reality, avoid the non-synced > status affects the hypervisor connection. > > Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx> > --- > virtinst/pollhelpers.py | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/virtinst/pollhelpers.py b/virtinst/pollhelpers.py > index a9b1527..e8702f0 100644 > --- a/virtinst/pollhelpers.py > +++ b/virtinst/pollhelpers.py > @@ -133,6 +133,19 @@ def fetch_pools(backend, origmap, build_func): > > if backend.check_support( > backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not _force_old_poll: > + > + # Refresh pools before poll_helper. For those > + # 'active' but target path not exist (or other reasons > + # causing the pool not working), but libvirtd not > + # refresh the status, this will make it refreshed > + # and mark that pool as 'inactive'. > + objs = backend.listAllStoragePools() > + for obj in objs: > + try: > + obj.refresh(0) > + except Exception, e: > + pass > + > return _new_poll_helper(origmap, name, > backend.listAllStoragePools, build_func) > else: > -- > 1.8.4.5 ACK. Thanks, - Chen _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list