Fix failure to connect to libvirt in keepalive
This should be caught and abort the thread rather than failing and holding up keepalives.
This commit is contained in:
		@@ -361,9 +361,13 @@ def collect_vm_stats(logger, config, zkhandler, this_node, queue):
 | 
				
			|||||||
    libvirt_name = "qemu:///system"
 | 
					    libvirt_name = "qemu:///system"
 | 
				
			||||||
    if debug:
 | 
					    if debug:
 | 
				
			||||||
        logger.out("Connecting to libvirt", state='d', prefix='vm-thread')
 | 
					        logger.out("Connecting to libvirt", state='d', prefix='vm-thread')
 | 
				
			||||||
    lv_conn = libvirt.open(libvirt_name)
 | 
					    try:
 | 
				
			||||||
    if lv_conn is None:
 | 
					        lv_conn = libvirt.open(libvirt_name)
 | 
				
			||||||
 | 
					        if lv_conn is None:
 | 
				
			||||||
 | 
					            raise Exception
 | 
				
			||||||
 | 
					    except Exception:
 | 
				
			||||||
        logger.out('Failed to open connection to "{}"'.format(libvirt_name), state='e')
 | 
					        logger.out('Failed to open connection to "{}"'.format(libvirt_name), state='e')
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    memalloc = 0
 | 
					    memalloc = 0
 | 
				
			||||||
    memprov = 0
 | 
					    memprov = 0
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user