From a693329c48e653bf4e1594d280127db6ae148236 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 27 Aug 2020 16:59:32 -0700 Subject: [PATCH] Revert "device: Allow to use the predicted 'VmPath' when adding blk devices" This reverts commit c01192e76a139c9bd18d6bedef9ed9554dc5cd1e. The above commit was a temporary (not reliable) workaround to support container rootfs through hotplugged block device when using cloud-hypervisor (clh). As the updated version of clh now returns the PCI BDF information for all hotplugged devices, we no longer need to rely on the predicted device path in the guest (a.k.a 'VmPath'). This patch reverts the above commit to remove the special code path for supporting cloud-hypervisor. Fixes: #823 --- device.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/device.go b/device.go index 01ee559602..1de25868ec 100644 --- a/device.go +++ b/device.go @@ -219,15 +219,12 @@ func virtioBlkCCWDeviceHandler(ctx context.Context, device pb.Device, spec *pb.S // Here, bridgeAddr is the address at which the brige is attached on the root bus, // while deviceAddr is the address at which the device is attached on the bridge. func virtioBlkDeviceHandler(_ context.Context, device pb.Device, spec *pb.Spec, s *sandbox) error { - // When "Id (PCIAddr)" is not set, we allow to use the predicted "VmPath" passed from kata-runtime - if device.Id != "" { - // Get the device node path based on the PCI device address - devPath, err := getPCIDeviceName(s, device.Id) - if err != nil { - return err - } - device.VmPath = devPath + // Get the device node path based on the PCI device address + devPath, err := getPCIDeviceName(s, device.Id) + if err != nil { + return err } + device.VmPath = devPath return updateSpecDeviceList(device, spec) }