diff --git a/virtcontainers/clh.go b/virtcontainers/clh.go index a71865a7a9..8d328b2d4a 100644 --- a/virtcontainers/clh.go +++ b/virtcontainers/clh.go @@ -414,15 +414,12 @@ func (clh *cloudHypervisor) hotplugAddBlockDevice(drive *config.BlockDrive) erro " using '%v' but only support '%v'", clh.config.BlockDeviceDriver, config.VirtioBlock) } + var err error + cl := clh.client() ctx, cancel := context.WithTimeout(context.Background(), clhHotPlugAPITimeout*time.Second) defer cancel() - _, _, err := cl.VmmPingGet(ctx) - if err != nil { - return openAPIClientError(err) - } - driveID := clhDriveIndexToID(drive.Index) //Explicitly set PCIAddr to NULL, so that VirtPath can be used @@ -451,12 +448,7 @@ func (clh *cloudHypervisor) hotPlugVFIODevice(device config.VFIODev) error { ctx, cancel := context.WithTimeout(context.Background(), clhHotPlugAPITimeout*time.Second) defer cancel() - _, _, err := cl.VmmPingGet(ctx) - if err != nil { - return openAPIClientError(err) - } - - _, _, err = cl.VmAddDevicePut(ctx, chclient.VmAddDevice{Path: device.SysfsDev}) + _, _, err := cl.VmAddDevicePut(ctx, chclient.VmAddDevice{Path: device.SysfsDev}) if err != nil { err = fmt.Errorf("Failed to hotplug device %+v %s", device, openAPIClientError(err)) }