[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V6 05/13] xen/vm_event: Style fixes



Fix style issues left over from the renaming to vm_event and other minor
alignment issues.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx>
---
 xen/common/vm_event.c      | 36 +++++++++++-------------------------
 xen/include/xen/vm_event.h | 18 +++++++++---------
 2 files changed, 20 insertions(+), 34 deletions(-)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index 195739e..a185539 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -568,9 +568,6 @@ int vm_event_domctl(struct domain *d, 
xen_domctl_vm_event_op_t *vec,
         switch( vec->op )
         {
         case XEN_VM_EVENT_PAGING_ENABLE:
-        {
-            struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
             rc = -EOPNOTSUPP;
             /* pvh fixme: p2m_is_foreign types need addressing */
             if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
@@ -588,21 +585,18 @@ int vm_event_domctl(struct domain *d, 
xen_domctl_vm_event_op_t *vec,
 
             rc = -EXDEV;
             /* Disallow paging in a PoD guest */
-            if ( p2m->pod.entry_count )
+            if ( p2m_get_hostp2m(d)->pod.entry_count )
                 break;
 
             rc = vm_event_enable(d, vec, ved, _VPF_mem_paging,
                                  HVM_PARAM_PAGING_RING_PFN,
                                  mem_paging_notification);
-        }
-        break;
+            break;
 
         case XEN_VM_EVENT_PAGING_DISABLE:
-        {
             if ( ved->ring_page )
                 rc = vm_event_disable(d, ved);
-        }
-        break;
+            break;
 
         default:
             rc = -ENOSYS;
@@ -622,31 +616,27 @@ int vm_event_domctl(struct domain *d, 
xen_domctl_vm_event_op_t *vec,
         {
         case XEN_VM_EVENT_MONITOR_ENABLE:
         case XEN_VM_EVENT_MONITOR_ENABLE_INTROSPECTION:
-        {
             rc = -ENODEV;
             if ( !p2m_vm_event_sanity_check(d) )
                 break;
 
             rc = vm_event_enable(d, vec, ved, _VPF_mem_access,
-                                    HVM_PARAM_MONITOR_RING_PFN,
-                                    mem_access_notification);
+                                 HVM_PARAM_MONITOR_RING_PFN,
+                                 mem_access_notification);
 
             if ( vec->op == XEN_VM_EVENT_MONITOR_ENABLE_INTROSPECTION
                  && !rc )
                 p2m_setup_introspection(d);
 
-        }
-        break;
+            break;
 
         case XEN_VM_EVENT_MONITOR_DISABLE:
-        {
             if ( ved->ring_page )
             {
                 rc = vm_event_disable(d, ved);
                 d->arch.hvm_domain.introspection_enabled = 0;
             }
-        }
-        break;
+            break;
 
         default:
             rc = -ENOSYS;
@@ -665,7 +655,6 @@ int vm_event_domctl(struct domain *d, 
xen_domctl_vm_event_op_t *vec,
         switch( vec->op )
         {
         case XEN_VM_EVENT_SHARING_ENABLE:
-        {
             rc = -EOPNOTSUPP;
             /* pvh fixme: p2m_is_foreign types need addressing */
             if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
@@ -677,17 +666,14 @@ int vm_event_domctl(struct domain *d, 
xen_domctl_vm_event_op_t *vec,
                 break;
 
             rc = vm_event_enable(d, vec, ved, _VPF_mem_sharing,
-                                    HVM_PARAM_SHARING_RING_PFN,
-                                    mem_sharing_notification);
-        }
-        break;
+                                 HVM_PARAM_SHARING_RING_PFN,
+                                 mem_sharing_notification);
+            break;
 
         case XEN_VM_EVENT_SHARING_DISABLE:
-        {
             if ( ved->ring_page )
                 rc = vm_event_disable(d, ved);
-        }
-        break;
+            break;
 
         default:
             rc = -ENOSYS;
diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h
index 188ee16..206efb0 100644
--- a/xen/include/xen/vm_event.h
+++ b/xen/include/xen/vm_event.h
@@ -48,15 +48,15 @@ bool_t vm_event_check_ring(struct vm_event_domain *ved);
  * succeed.
  */
 int __vm_event_claim_slot(struct domain *d, struct vm_event_domain *ved,
-                            bool_t allow_sleep);
+                          bool_t allow_sleep);
 static inline int vm_event_claim_slot(struct domain *d,
-                                        struct vm_event_domain *ved)
+                                      struct vm_event_domain *ved)
 {
     return __vm_event_claim_slot(d, ved, 1);
 }
 
 static inline int vm_event_claim_slot_nosleep(struct domain *d,
-                                        struct vm_event_domain *ved)
+                                              struct vm_event_domain *ved)
 {
     return __vm_event_claim_slot(d, ved, 0);
 }
@@ -64,10 +64,10 @@ static inline int vm_event_claim_slot_nosleep(struct domain 
*d,
 void vm_event_cancel_slot(struct domain *d, struct vm_event_domain *ved);
 
 void vm_event_put_request(struct domain *d, struct vm_event_domain *ved,
-                            vm_event_request_t *req);
+                          vm_event_request_t *req);
 
 int vm_event_get_response(struct domain *d, struct vm_event_domain *ved,
-                           vm_event_response_t *rsp);
+                          vm_event_response_t *rsp);
 
 int do_vm_event_op(int op, uint32_t domain, void *arg);
 int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec,
@@ -86,13 +86,13 @@ static inline bool_t vm_event_check_ring(struct 
vm_event_domain *ved)
 }
 
 static inline int vm_event_claim_slot(struct domain *d,
-                                        struct vm_event_domain *ved)
+                                      struct vm_event_domain *ved)
 {
     return -ENOSYS;
 }
 
 static inline int vm_event_claim_slot_nosleep(struct domain *d,
-                                        struct vm_event_domain *ved)
+                                              struct vm_event_domain *ved)
 {
     return -ENOSYS;
 }
@@ -103,12 +103,12 @@ void vm_event_cancel_slot(struct domain *d, struct 
vm_event_domain *ved)
 
 static inline
 void vm_event_put_request(struct domain *d, struct vm_event_domain *ved,
-                            vm_event_request_t *req)
+                          vm_event_request_t *req)
 {}
 
 static inline
 int vm_event_get_response(struct domain *d, struct vm_event_domain *ved,
-                           vm_event_response_t *rsp)
+                          vm_event_response_t *rsp)
 {
     return -ENOSYS;
 }
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.