« Previous | Next » 

Revision 28bd3496

ID28bd3496cd5a5cb3857d6f94ad11cd01ce51c076

Added by Dimitris Aragiorgis over 11 years ago

Hotplug: KVM support

KVM >= 1.0 is needed.

Introduce new methods: HotAddNic/HotDelNic

Both qemu monitor interface for hotplugging. If a device has
hotplug info (idx, pci) then:
- it gets named after it (e.g. virtio-net-pci.%d % idx ).
- it gets placed to the pci slot (hex(pci)) of bus 0.
If no hotplug info exist or kvm version is old then no hotplug takes
place and modifications will take place after reboot:
- devices will get traditionaly named
- and placed automaticaly in empty pci slots

NIC hotplug:
- open a tap and get its file descriptor.
- pass fd with SCM rights (using python-fdsend) via monitor socket
- create netdev and device with proper qemu interface

Disk hotplug:
- create drive with drive%d % idx name
- create device virtio-blk-pci.%d % idx

In order to migrate a VM that has devices hotplugged, an identical
VM should be booted with -incoming. To this end every time a hotplug
takes place runtime file must be updated.

For disk hotplug support we removeds disk from kvm_cmd in
runtime file add added them separately just like nics. So code building
disk related options has been moved out from _GenerateKVMRuntime()
and added to _ExecuteKVMRuntime().

Signed-off-by: Dimitris Aragiorgis <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences