runtime: do not hot-remove PMEM devices

PMEM devices cannot be hot-removed from a running VM.

fixes #2018

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2021-06-18 09:02:03 -05:00 committed by Snir Sheriber
parent 5454c3d710
commit 8138a16b8b

View File

@ -1711,6 +1711,11 @@ func (s *Sandbox) HotplugRemoveDevice(ctx context.Context, device api.Device, de
if !ok {
return fmt.Errorf("device type mismatch, expect device type to be %s", devType)
}
// PMEM devices cannot be hot removed
if blockDrive.Pmem {
s.Logger().WithField("path", blockDrive.File).Infof("Skip device: cannot hot remove PMEM devices")
return nil
}
_, err := s.hypervisor.hotplugRemoveDevice(ctx, blockDrive, blockDev)
return err
case config.VhostUserBlk: