Skip to content
  • Dimitris Aragiorgis's avatar
    Hotplug: cmdlib support · ba924970
    Dimitris Aragiorgis authored
    
    
    Hotplugging is done by functions invoked by ApplyContainerMods(). In
    order hotplugging to take place the --hotplug option must be passed
    otherwise the modifications will take place after reboot.
    
    NIC hotplug supports add, remove and modify. The modify is done by removing
    the existing NIC and adding a new one in the same pci slot.
    
    Disk hotplug supports add and remove.  Before hotplugging a Disk it
    must be assembled. Use blockdev_assemble RPC, get the device link_name
    and then call hotplug RPC command.
    
    In order to remove a disk (with blockdev_remove) it must be shutdown. So
    after unplugging the disk ShutdownDiskInstanceDisks() must be invoked.
    
    For both device types we use the generic RPC call_hotplug_device.
    
    Also adapt unit tests to follow the change.
    
    Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
    Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
    Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
    ba924970