|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 2/3] x86/ioreq: Prepare spacing for upcoming patch
This patch just changes indentation, to make the next patch easier to
review.
Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
Changes in v2
- New patch
---
xen/arch/x86/hvm/ioreq.c | 86 ++++++++++++++++++++++------------------
1 file changed, 47 insertions(+), 39 deletions(-)
diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index a5fa97e149..5ebc48dbd4 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -125,14 +125,16 @@ static void hvm_unmap_ioreq_gfn(struct ioreq_server *s,
bool buf)
{
struct ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
- if ( gfn_eq(iorp->gfn, INVALID_GFN) )
- return;
+ {
+ if ( gfn_eq(iorp->gfn, INVALID_GFN) )
+ return;
- destroy_ring_for_helper(&iorp->va, iorp->page);
- iorp->page = NULL;
+ destroy_ring_for_helper(&iorp->va, iorp->page);
+ iorp->page = NULL;
- hvm_free_ioreq_gfn(s, iorp->gfn);
- iorp->gfn = INVALID_GFN;
+ hvm_free_ioreq_gfn(s, iorp->gfn);
+ iorp->gfn = INVALID_GFN;
+ }
}
static int hvm_map_ioreq_gfn(struct ioreq_server *s, bool buf)
@@ -141,34 +143,36 @@ static int hvm_map_ioreq_gfn(struct ioreq_server *s, bool
buf)
struct ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
int rc;
- if ( iorp->page )
{
- /*
- * If a page has already been allocated (which will happen on
- * demand if ioreq_server_get_frame() is called), then
- * mapping a guest frame is not permitted.
- */
- if ( gfn_eq(iorp->gfn, INVALID_GFN) )
- return -EPERM;
-
- return 0;
- }
+ if ( iorp->page )
+ {
+ /*
+ * If a page has already been allocated (which will happen on
+ * demand if ioreq_server_get_frame() is called), then
+ * mapping a guest frame is not permitted.
+ */
+ if ( gfn_eq(iorp->gfn, INVALID_GFN) )
+ return -EPERM;
+
+ return 0;
+ }
- if ( d->is_dying )
- return -EINVAL;
+ if ( d->is_dying )
+ return -EINVAL;
- iorp->gfn = hvm_alloc_ioreq_gfn(s);
+ iorp->gfn = hvm_alloc_ioreq_gfn(s);
- if ( gfn_eq(iorp->gfn, INVALID_GFN) )
- return -ENOMEM;
+ if ( gfn_eq(iorp->gfn, INVALID_GFN) )
+ return -ENOMEM;
- rc = prepare_ring_for_helper(d, gfn_x(iorp->gfn), &iorp->page,
- &iorp->va);
+ rc = prepare_ring_for_helper(d, gfn_x(iorp->gfn), &iorp->page,
+ &iorp->va);
- if ( rc )
- hvm_unmap_ioreq_gfn(s, buf);
+ if ( rc )
+ hvm_unmap_ioreq_gfn(s, buf);
- return rc;
+ return rc;
+ }
}
static void hvm_remove_ioreq_gfn(struct ioreq_server *s, bool buf)
@@ -176,12 +180,14 @@ static void hvm_remove_ioreq_gfn(struct ioreq_server *s,
bool buf)
struct domain *d = s->target;
struct ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
- if ( gfn_eq(iorp->gfn, INVALID_GFN) )
- return;
+ {
+ if ( gfn_eq(iorp->gfn, INVALID_GFN) )
+ return;
- if ( p2m_remove_page(d, iorp->gfn, page_to_mfn(iorp->page), 0) )
- domain_crash(d);
- clear_page(iorp->va);
+ if ( p2m_remove_page(d, iorp->gfn, page_to_mfn(iorp->page), 0) )
+ domain_crash(d);
+ clear_page(iorp->va);
+ }
}
static int hvm_add_ioreq_gfn(struct ioreq_server *s, bool buf)
@@ -190,16 +196,18 @@ static int hvm_add_ioreq_gfn(struct ioreq_server *s, bool
buf)
struct ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
int rc;
- if ( gfn_eq(iorp->gfn, INVALID_GFN) )
- return 0;
+ {
+ if ( gfn_eq(iorp->gfn, INVALID_GFN) )
+ return 0;
- clear_page(iorp->va);
+ clear_page(iorp->va);
- rc = p2m_add_page(d, iorp->gfn, page_to_mfn(iorp->page), 0, p2m_ram_rw);
- if ( rc == 0 )
- paging_mark_pfn_dirty(d, _pfn(gfn_x(iorp->gfn)));
+ rc = p2m_add_page(d, iorp->gfn, page_to_mfn(iorp->page), 0,
p2m_ram_rw);
+ if ( rc == 0 )
+ paging_mark_pfn_dirty(d, _pfn(gfn_x(iorp->gfn)));
- return rc;
+ return rc;
+ }
}
int arch_ioreq_server_map_pages(struct ioreq_server *s)
--
2.51.0
--
Julian Vetter | Vates Hypervisor & Kernel Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |