mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
19
vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go
generated
vendored
19
vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go
generated
vendored
@@ -395,9 +395,6 @@ func (vmm *VirtualMachineManager) NewVirtualMachine(name string, config *Hardwar
|
||||
return err
|
||||
}
|
||||
|
||||
//if err := vmm.CreateVhdxFile(config.DiskPath, config.DiskSize*1024*1024*1024); err != nil {
|
||||
// return err
|
||||
//}
|
||||
if err := NewDriveSettingsBuilder(systemSettings).
|
||||
AddScsiController().
|
||||
AddSyntheticDiskDrive(0).
|
||||
@@ -416,13 +413,15 @@ func (vmm *VirtualMachineManager) NewVirtualMachine(name string, config *Hardwar
|
||||
return err
|
||||
}
|
||||
// Add default network connection
|
||||
if err := NewNetworkSettingsBuilder(systemSettings).
|
||||
AddSyntheticEthernetPort(nil).
|
||||
AddEthernetPortAllocation(""). // "" = connect to default switch
|
||||
Finish(). // allocation
|
||||
Finish(). // port
|
||||
Complete(); err != nil {
|
||||
return err
|
||||
if config.Network {
|
||||
if err := NewNetworkSettingsBuilder(systemSettings).
|
||||
AddSyntheticEthernetPort(nil).
|
||||
AddEthernetPortAllocation(""). // "" = connect to default switch
|
||||
Finish(). // allocation
|
||||
Finish(). // port
|
||||
Complete(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
3
vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go
generated
vendored
3
vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go
generated
vendored
@@ -98,6 +98,9 @@ type HardwareConfig struct {
|
||||
DiskSize uint64
|
||||
// Memory in megabytes assigned to the vm
|
||||
Memory int32
|
||||
// Network is bool to add a Network Connection to the
|
||||
// default network switch in Microsoft HyperV
|
||||
Network bool
|
||||
}
|
||||
|
||||
type Statuses struct {
|
||||
|
||||
Reference in New Issue
Block a user