mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 02:51:55 +00:00
qemu: restore persistent mac address support
If the state dir is preserved then the VM should come up with the same mac address on subsequent reboots. Fixes regression in #2498. Rather than fixing the typo in the associated comments just remove them since they don't really convey any useful information. Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
parent
ca4ee13fca
commit
16147a7591
@ -571,13 +571,12 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
|
||||
if config.NetdevConfig == "" {
|
||||
qemuArgs = append(qemuArgs, "-net", "none")
|
||||
} else {
|
||||
// provide a network device first for the QEMU VM if '-networking' is specified,
|
||||
qemuArgs = append(qemuArgs, "-device", "virtio-net-pci,netdev=t0")
|
||||
mac := retrieveMAC(config.StatePath)
|
||||
qemuArgs = append(qemuArgs, "-device", "virtio-net-pci,netdev=t0,mac="+mac.String())
|
||||
forwardings, err := buildQemuForwardings(config.PublishedPorts, config.Containerized)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
// we perfer "-netdev" to the "-net" which is an old way to initialize a host nic
|
||||
qemuArgs = append(qemuArgs, "-netdev", config.NetdevConfig+forwardings)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user