coverity 1311706: to generic exeption handling on xapi call

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
This commit is contained in:
Daan Hoogland 2015-07-14 10:41:07 +02:00 committed by Daan Hoogland
parent 03e8176bab
commit e62d952375
2 changed files with 10 additions and 4 deletions

View File

@ -5318,7 +5318,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
public boolean AttachConfigDriveToMigratedVm(Connection conn, String vmName, String ipAddr) {
public boolean attachConfigDriveToMigratedVm(Connection conn, String vmName, String ipAddr) {
// attach the config drive in destination host
@ -5375,8 +5375,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
return true;
}catch (Exception ex) {
s_logger.debug("Failed to attach config drive ISO to the VM "+ vmName + " In host " + ipAddr );
} catch (BadServerResponse e) {
s_logger.warn("Failed to attach config drive ISO to the VM "+ vmName + " In host " + ipAddr + " due to a bad server response.", e);
return false;
} catch (XenAPIException e) {
s_logger.warn("Failed to attach config drive ISO to the VM "+ vmName + " In host " + ipAddr + " due to a xapi problem.", e);
return false;
} catch (XmlRpcException e) {
s_logger.warn("Failed to attach config drive ISO to the VM "+ vmName + " In host " + ipAddr + " due to a problem in a remote call.", e);
return false;
}

View File

@ -85,7 +85,7 @@ public final class CitrixMigrateCommandWrapper extends CommandWrapper<MigrateCom
// The iso can be attached to vm only once the vm is (present in the host) migrated.
// Attach the config drive iso device to VM
if (!citrixResourceBase.AttachConfigDriveToMigratedVm(conn, vmName, dstHostIpAddr)) {
if (!citrixResourceBase.attachConfigDriveToMigratedVm(conn, vmName, dstHostIpAddr)) {
s_logger.debug("Config drive ISO attach failed after migration for vm "+vmName);
}