mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
Enabled network over vsock
podman machine with Microsoft HyperV will use hvsock on the guest and vsock on the guest for its networking. this pr enables the basics for this to happen as well as changes to ignition to automatically set this up with network manager. the vm binary referenced in this pr is in containers/gvisor-tap-vsock and will need to be added to distributions. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
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