mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 08:56:32 +00:00
clh: Make vmAddNetPutRequest capable of doing hotplugs
THe only bit needed for having the vmAddNetPutRequest() capable of dealing with hotplugs, instead of only coldplugs, is making sure it doesn't error out in case a `200` response is returned. The 200 response means: """ The new device was successfully added to the VM instance. """ Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
@@ -220,7 +220,7 @@ var vmAddNetPutRequest = func(clh *cloudHypervisor) error {
|
||||
resp.Body.Close()
|
||||
resp.Body = io.NopCloser(bytes.NewBuffer(respBody))
|
||||
|
||||
if resp.StatusCode != 204 {
|
||||
if resp.StatusCode != 200 && resp.StatusCode != 204 {
|
||||
clh.Logger().Errorf("vmAddNetPut failed with error '%d'. Response: %+v", resp.StatusCode, resp)
|
||||
return fmt.Errorf("Failed to add the network device '%+v' to Cloud Hypervisor: %v", netDevice, resp.StatusCode)
|
||||
}
|
||||
|
Reference in New Issue
Block a user