mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
xen: remove other open-coded use of libxengnttab
Now that helpers are available in xen_backend, use them throughout all Xen PV backends. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Acked-by: Anthony Perard <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
parent
5ee1d99913
commit
58560f2ae7
4 changed files with 50 additions and 61 deletions
|
@ -331,14 +331,14 @@ static int xen_9pfs_free(struct XenDevice *xendev)
|
|||
|
||||
for (i = 0; i < xen_9pdev->num_rings; i++) {
|
||||
if (xen_9pdev->rings[i].data != NULL) {
|
||||
xengnttab_unmap(xen_9pdev->xendev.gnttabdev,
|
||||
xen_9pdev->rings[i].data,
|
||||
(1 << xen_9pdev->rings[i].ring_order));
|
||||
xen_be_unmap_grant_refs(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].data,
|
||||
(1 << xen_9pdev->rings[i].ring_order));
|
||||
}
|
||||
if (xen_9pdev->rings[i].intf != NULL) {
|
||||
xengnttab_unmap(xen_9pdev->xendev.gnttabdev,
|
||||
xen_9pdev->rings[i].intf,
|
||||
1);
|
||||
xen_be_unmap_grant_refs(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].intf,
|
||||
1);
|
||||
}
|
||||
if (xen_9pdev->rings[i].bh != NULL) {
|
||||
qemu_bh_delete(xen_9pdev->rings[i].bh);
|
||||
|
@ -390,11 +390,10 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
|
|||
}
|
||||
g_free(str);
|
||||
|
||||
xen_9pdev->rings[i].intf = xengnttab_map_grant_ref(
|
||||
xen_9pdev->xendev.gnttabdev,
|
||||
xen_9pdev->xendev.dom,
|
||||
xen_9pdev->rings[i].ref,
|
||||
PROT_READ | PROT_WRITE);
|
||||
xen_9pdev->rings[i].intf =
|
||||
xen_be_map_grant_ref(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].ref,
|
||||
PROT_READ | PROT_WRITE);
|
||||
if (!xen_9pdev->rings[i].intf) {
|
||||
goto out;
|
||||
}
|
||||
|
@ -403,12 +402,11 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
|
|||
goto out;
|
||||
}
|
||||
xen_9pdev->rings[i].ring_order = ring_order;
|
||||
xen_9pdev->rings[i].data = xengnttab_map_domain_grant_refs(
|
||||
xen_9pdev->xendev.gnttabdev,
|
||||
(1 << ring_order),
|
||||
xen_9pdev->xendev.dom,
|
||||
xen_9pdev->rings[i].intf->ref,
|
||||
PROT_READ | PROT_WRITE);
|
||||
xen_9pdev->rings[i].data =
|
||||
xen_be_map_grant_refs(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].intf->ref,
|
||||
(1 << ring_order),
|
||||
PROT_READ | PROT_WRITE);
|
||||
if (!xen_9pdev->rings[i].data) {
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue