Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clh: Support VFIO device unplug #861

Merged
merged 3 commits into from Oct 6, 2020

Conversation

likebreath
Copy link
Contributor

Forward port PR kata-containers/runtime#2996 for issue kata-containers/runtime#2569.

This patch adds the support of VFIO device unplug when using
cloud-hypervisor.

Fixes: #860

Signed-off-by: Bo Chen chen.bo@intel.com

The cloud-hypervisor commit `6d30fe05` introduced a fix on its API for
VFIO device hotplug (`VmAddDevice`), which is required for supporting
VFIO unplug through openAPI calls in kata.

Signed-off-by: Bo Chen <chen.bo@intel.com>
We can rely on the error handling of the actual HTTP API calls to catch
errors, and don't need to call VmmPing explicitly in advance.

Signed-off-by: Bo Chen <chen.bo@intel.com>
@likebreath likebreath requested a review from a team as a code owner October 5, 2020 19:17
@likebreath
Copy link
Contributor Author

/test-clh
/cc @devimc

@likebreath likebreath changed the title clh: Support VFIO device unplug #2996 clh: Support VFIO device unplug Oct 5, 2020
This patch adds the support of VFIO device unplug when using
cloud-hypervisor.

Fixes: kata-containers#860

Signed-off-by: Bo Chen <chen.bo@intel.com>
Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @likebreath - lgtm

VFIO test is passing but I need to disable DAX

see #862

@likebreath
Copy link
Contributor Author

/test-ubuntu

@likebreath likebreath added the forward-port Change from an older branch / repository label Oct 6, 2020
Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @likebreath.

lgtm

_, err := cl.VmRemoveDevicePut(ctx, chclient.VmRemoveDevice{Id: device.ID})

if err != nil {
err = fmt.Errorf("failed to hotplug remove vfio device %+v %s", device, openAPIClientError(err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd consider adding a colon just before the original error:

Suggested change
err = fmt.Errorf("failed to hotplug remove vfio device %+v %s", device, openAPIClientError(err))
err = fmt.Errorf("failed to hotplug remove vfio device %+v: %s", device, openAPIClientError(err))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forward-port Change from an older branch / repository
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

clh: Support VFIO device unplug
3 participants