Skip to contentSkip to conversation

Hot reload network configuration

Qemu-devel Hu Keping 3 participants 4 messages May 11, 2016 – May 17, 2016

lore
Share & tools
lore

Hu Keping

author
#0 lore raw

Hi there,

Is there any possible that start qemu with --net=none and then change the configuration of the network, say using tap for example?

#1 lore raw
Quoted 2 lines · Hu Keping

Is there any possible that start qemu with --net=none and then change the configuration of the network, say using tap for example?

Yes. If your machine type supports PCI hotplug then you can use the netdev_add and device_add commands. This is equivalent to hotplugging a NIC into a running machine.

I don't have exact syntax because I haven't tested it, but it should be similar to using the -netdev tap,id=netdev0 -device e1000,netdev=netdev0 command-line option syntax.

Stefan

#2 lore raw
Quoted 11 lines · Stefan Hajnoczi
Quoted 2 lines · Hu Keping

Is there any possible that start qemu with --net=none and then change the configuration of the network, say using tap for example?

Yes. If your machine type supports PCI hotplug then you can use the netdev_add and device_add commands. This is equivalent to hotplugging a NIC into a running machine.

I don't have exact syntax because I haven't tested it, but it should be similar to using the -netdev tap,id=netdev0 -device e1000,netdev=netdev0 command-line option syntax.

Aside: we should be able to swap out the network backend without unplugging + plugging the frontend, in a way that looks like unplugging
+ plugging the network cable, possibly changing to a different network. As far as I know, we can't do that today, but it could be a fun project.

author
#3 lore raw
Quoted 1 line
Quoted 1 line

... possibly changing to a different network.

That would be most interesting part.

Quoted 19 lines · Markus Armbruster
Quoted 10 lines · Stefan Hajnoczi
Quoted 2 lines · Hu Keping

Is there any possible that start qemu with --net=none and then change the configuration of the network, say using tap for example?

Yes. If your machine type supports PCI hotplug then you can use the netdev_add and device_add commands. This is equivalent to hotplugging a NIC into a running machine.

I don't have exact syntax because I haven't tested it, but it should be similar to using the -netdev tap,id=netdev0 -device e1000,netdev=netdev0 command-line option syntax.

Aside: we should be able to swap out the network backend without unplugging + plugging the frontend, in a way that looks like unplugging
+ plugging the network cable, possibly changing to a different network. As far as I know, we can't do that today, but it could be a fun project.

.