Message ID | 20170627171458.2529-4-venu.busireddy@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Jun 27, 2017 at 12:14:55PM -0500, Venu Busireddy wrote: > libxc: Add wrappers for new commands Extraneous line here. > > Add wrappers for the newly introduced commands "pci-assignable-hide", > "pci-assignable-unhide", and "pci-assignable-list-hidden". > > Signed-off-by: Venu Busireddy <venu.busireddy@oracle.com> > --- > tools/libxc/include/xenctrl.h | 4 ++++ > tools/libxc/xc_domain.c | 38 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 42 insertions(+) > > diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h > index 1629f41..9730285 100644 > --- a/tools/libxc/include/xenctrl.h > +++ b/tools/libxc/include/xenctrl.h > @@ -1670,6 +1670,10 @@ int xc_assign_device(xc_interface *xch, > uint32_t machine_sbdf, > uint32_t flag); > > +int xc_hide_device(xc_interface *xch, uint32_t machine_bdf); > +int xc_unhide_device(xc_interface *xch, uint32_t machine_bdf); > +int xc_test_hidden_device(xc_interface *xch, uint32_t machine_bdf); > + > int xc_get_device_group(xc_interface *xch, > uint32_t domid, > uint32_t machine_sbdf, > diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c > index 00909ad4..714d632 100644 > --- a/tools/libxc/xc_domain.c > +++ b/tools/libxc/xc_domain.c > @@ -1501,6 +1501,44 @@ int xc_assign_device( > return do_domctl(xch, &domctl); > } > > +int xc_hide_device( > + xc_interface *xch, > + uint32_t machine_sbdf) int xc_hide_device(xc_interface *xch, uint32_t machine_sbdf) Otherwise this patch looks good.
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 1629f41..9730285 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1670,6 +1670,10 @@ int xc_assign_device(xc_interface *xch, uint32_t machine_sbdf, uint32_t flag); +int xc_hide_device(xc_interface *xch, uint32_t machine_bdf); +int xc_unhide_device(xc_interface *xch, uint32_t machine_bdf); +int xc_test_hidden_device(xc_interface *xch, uint32_t machine_bdf); + int xc_get_device_group(xc_interface *xch, uint32_t domid, uint32_t machine_sbdf, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 00909ad4..714d632 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1501,6 +1501,44 @@ int xc_assign_device( return do_domctl(xch, &domctl); } +int xc_hide_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_hide_device; + domctl.domain = DOMID_XEN; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + +int xc_unhide_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_unhide_device; + domctl.domain = DOMID_XEN; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + +int xc_test_hidden_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_test_hidden_device; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + int xc_get_device_group( xc_interface *xch, uint32_t domid,
libxc: Add wrappers for new commands Add wrappers for the newly introduced commands "pci-assignable-hide", "pci-assignable-unhide", and "pci-assignable-list-hidden". Signed-off-by: Venu Busireddy <venu.busireddy@oracle.com> --- tools/libxc/include/xenctrl.h | 4 ++++ tools/libxc/xc_domain.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+)