/**
   * This method checks if we are stopping a VM that was started by run-once In such case we will
   * may have 2 devices, one managed and one unmanaged for CD or Floppy This is not supported
   * currently by libvirt that allows only one CD/Floppy This code should be removed if libvirt will
   * support in future multiple CD/Floppy
   */
  private boolean isRunOnce() {
    List<VmDevice> cdList =
        DbFacade.getInstance()
            .getVmDeviceDao()
            .getVmDeviceByVmIdTypeAndDevice(
                getVmId(), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName());
    List<VmDevice> floppyList =
        DbFacade.getInstance()
            .getVmDeviceDao()
            .getVmDeviceByVmIdTypeAndDevice(
                getVmId(), VmDeviceGeneralType.DISK, VmDeviceType.FLOPPY.getName());

    return (cdList.size() > 1 || floppyList.size() > 1);
  }
Exemple #2
0
 private boolean shouldLogDeviceDetails(String deviceType) {
   return !StringUtils.equalsIgnoreCase(deviceType, VmDeviceType.FLOPPY.getName());
 }