final PowerState state = convertToPowerState(ps);
s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps
+ "; vm state=" + state.toString());
String vmName = dm.getName();
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
} catch (final LibvirtException e) {
s_logger.warn("Unable to get vms", e);
} finally {
try {
if (dm != null) {
dm.free();
}
} catch (LibvirtException e) {
s_logger.trace("Ignoring libvirt error.", e);
}
}
}
for (int i = 0; i < vms.length; i++) {
try {
dm = conn.domainLookupByName(vms[i]);
DomainInfo.DomainState ps = dm.getInfo().state;
final PowerState state = convertToPowerState(ps);
String vmName = dm.getName();
s_logger.trace("VM " + vmName + ": powerstate = " + ps
+ "; vm state=" + state.toString());
vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
} catch (final LibvirtException e) {
s_logger.warn("Unable to get vms", e);
} finally {
try {
if (dm != null) {