-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: Move VmDeviceCommonUtils.isSpecialDevice to ovf package
It’s not used elsewhere.
- Loading branch information
Showing
5 changed files
with
44 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ger/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReaderWriterUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.ovirt.engine.core.utils.ovf; | ||
|
||
import org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType; | ||
import org.ovirt.engine.core.common.utils.VmDeviceType; | ||
|
||
public abstract class OvfReaderWriterUtils { | ||
|
||
/** | ||
* is special device - device which is managed, but contains the general properties | ||
*/ | ||
protected static boolean isSpecialDevice(String device, VmDeviceGeneralType type, boolean includeHostDev) { | ||
if (VmDeviceType.USB.getName().equals(device)) { | ||
return true; | ||
} | ||
|
||
switch(type) { | ||
case MDEV: | ||
case SOUND: | ||
return true; | ||
case CONSOLE: | ||
return VmDeviceType.CONSOLE.getName().equals(device); | ||
case SMARTCARD: | ||
return VmDeviceType.SMARTCARD.getName().equals(device); | ||
case REDIR: | ||
return VmDeviceType.SPICEVMC.getName().equals(device); | ||
case BALLOON: | ||
return VmDeviceType.MEMBALLOON.getName().equals(device); | ||
case WATCHDOG: | ||
return VmDeviceType.WATCHDOG.getName().equals(device); | ||
case RNG: | ||
return VmDeviceType.VIRTIO.getName().equals(device); | ||
case CONTROLLER: | ||
return VmDeviceType.VIRTIOSERIAL.getName().equals(device) | ||
|| VmDeviceType.VIRTIOSCSI.getName().equals(device); | ||
case HOSTDEV: | ||
return includeHostDev; | ||
default: | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters