don't need to check if pv driver is updated, old pv driver should work

This commit is contained in:
Anthony Xu 2014-10-30 10:27:34 -07:00
parent 779cd60a70
commit b8d6396409

View File

@ -84,7 +84,6 @@ import com.xensource.xenapi.Types.XenAPIException;
import com.xensource.xenapi.VBD;
import com.xensource.xenapi.VDI;
import com.xensource.xenapi.VM;
import com.xensource.xenapi.VMGuestMetrics;
public class XenServerStorageProcessor implements StorageProcessor {
private static final Logger s_logger = Logger.getLogger(XenServerStorageProcessor.class);
@ -269,22 +268,6 @@ public class XenServerStorageProcessor implements StorageProcessor {
vdi = hypervisorResource.mount(conn, null, null, data.getPath());
}
/* For HVM guest, if no pv driver installed, no attach/detach */
boolean isHVM = vm.getPVBootloader(conn).equalsIgnoreCase("");
VMGuestMetrics vgm = vm.getGuestMetrics(conn);
boolean pvDrvInstalled = false;
if (!this.hypervisorResource.isRefNull(vgm) && vgm.getPVDriversUpToDate(conn)) {
pvDrvInstalled = true;
}
if (isHVM && !pvDrvInstalled) {
s_logger.warn(": You attempted an operation on a VM which requires PV drivers to be installed but the drivers were not detected");
return new AttachAnswer("You attempted an operation that requires PV drivers to be installed on the VM. Please install them by inserting xen-pv-drv.iso.");
}
// Figure out the disk number to attach the VM to
String diskNumber = null;
Long deviceId = disk.getDiskSeq();
@ -432,21 +415,6 @@ public class XenServerStorageProcessor implements StorageProcessor {
}
if (!vmNotRunning) {
/* For HVM guest, if no pv driver installed, no attach/detach */
boolean isHVM = vm.getPVBootloader(conn).equalsIgnoreCase("");
VMGuestMetrics vgm = vm.getGuestMetrics(conn);
boolean pvDrvInstalled = false;
if (!this.hypervisorResource.isRefNull(vgm) && vgm.getPVDriversUpToDate(conn)) {
pvDrvInstalled = true;
}
if (isHVM && !pvDrvInstalled) {
s_logger.warn(": You attempted an operation on a VM which requires PV drivers to be installed but the drivers were not detected");
return new DettachAnswer("You attempted an operation that requires PV drivers to be installed on the VM. Please install them by inserting xen-pv-drv.iso.");
}
VDI vdi = this.hypervisorResource.mount(conn, null, null, data.getPath());
// Look up all VBDs for this VDI