Java 类com.vmware.vim25.VirtualFloppyDeviceBackingInfo 实例源码

项目:photon-model    文件:ClientUtils.java   
public static VirtualDeviceConfigSpec createFloppy(VirtualDevice sioController, int unitNumber) {
    VirtualFloppy floppy = new VirtualFloppy();

    floppy.setControllerKey(sioController.getKey());
    floppy.setUnitNumber(unitNumber);

    VirtualDeviceConnectInfo info = new VirtualDeviceConnectInfo();
    info.setAllowGuestControl(true);
    info.setConnected(true);
    info.setStartConnected(true);
    floppy.setConnectable(info);

    VirtualFloppyDeviceBackingInfo backing = new VirtualFloppyDeviceBackingInfo();
    backing.setDeviceName(String.format("floppy-%d", unitNumber));
    floppy.setBacking(backing);

    VirtualDeviceConfigSpec spec = new VirtualDeviceConfigSpec();
    spec.setDevice(floppy);
    spec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
    return spec;
}