CLOUDSTACK-2067: Throw LibvirtException so that VM start failures are

noticed, fix related NPE that can happen when VM starts fail

Signed-off-by: Chip Childers <chip.childers@gmail.com>
This commit is contained in:
Marcus Sorensen 2013-04-17 20:09:13 +01:00 committed by Chip Childers
parent 9b15a47195
commit 0c4048cbbc
1 changed files with 6 additions and 5 deletions

View File

@ -985,8 +985,7 @@ ServerResource {
*/
dm = conn.domainCreateXML(domainXML, 0);
} catch (final LibvirtException e) {
s_logger.warn("Failed to start domain " + vmName + ": "
+ e.getMessage());
throw e;
}
return null;
@ -4234,9 +4233,11 @@ ServerResource {
}
private void cleanupVMNetworks(Connect conn, List<InterfaceDef> nics) {
for (InterfaceDef nic : nics) {
if (nic.getHostNetType() == hostNicType.VNET) {
cleanupVnet(conn, getVnetIdFromBrName(nic.getBrName()));
if (nics != null) {
for (InterfaceDef nic : nics) {
if (nic.getHostNetType() == hostNicType.VNET) {
cleanupVnet(conn, getVnetIdFromBrName(nic.getBrName()));
}
}
}
}