Skip to content

Commit

Permalink
Revert "device: Allow to use the predicted 'VmPath' when adding blk d…
Browse files Browse the repository at this point in the history
…evices"

This reverts commit c01192e.
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: kata-containers#823
  • Loading branch information
likebreath committed Aug 28, 2020
1 parent 2b839fe commit a693329
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a693329

Please sign in to comment.