[v2,05/10] vm_event: Move struct vm_event_domain to vm_event.c
diff mbox series

Message ID 93d50867ea8e45270a180a8f93aaed5a89619510.1563293545.git.ppircalabu@bitdefender.com
State New
Headers show
Series
  • Per vcpu vm_event channels
Related show

Commit Message

Petre Ovidiu PIRCALABU July 16, 2019, 5:06 p.m. UTC
The vm_event_domain members are not accessed outside vm_event.c so it's
better to hide de implementation details.

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/common/vm_event.c   | 26 ++++++++++++++++++++++++++
 xen/include/xen/sched.h | 26 +-------------------------
 2 files changed, 27 insertions(+), 25 deletions(-)

Comments

Jan Beulich July 17, 2019, 9:31 a.m. UTC | #1
On 16.07.2019 19:06, Petre Pircalabu wrote:
> The vm_event_domain members are not accessed outside vm_event.c so it's
> better to hide de implementation details.
> 
> Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
> ---
>   xen/common/vm_event.c   | 26 ++++++++++++++++++++++++++
>   xen/include/xen/sched.h | 26 +-------------------------
>   2 files changed, 27 insertions(+), 25 deletions(-)

Ah, here it comes. This would better have been ahead of the other
change (where I did comment).

Jan
Petre Ovidiu PIRCALABU July 17, 2019, 12:26 p.m. UTC | #2
On Wed, 2019-07-17 at 09:31 +0000, Jan Beulich wrote:
> On 16.07.2019 19:06, Petre Pircalabu wrote:
> > The vm_event_domain members are not accessed outside vm_event.c so
> > it's
> > better to hide de implementation details.
> > 
> > Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
> > Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
> > ---
> >   xen/common/vm_event.c   | 26 ++++++++++++++++++++++++++
> >   xen/include/xen/sched.h | 26 +-------------------------
> >   2 files changed, 27 insertions(+), 25 deletions(-)
> 
> Ah, here it comes. This would better have been ahead of the other
> change (where I did comment).
> 
> Jan
I will reorder the patches in the next iteration.

Many thanks for your comments,
Petre

Patch
diff mbox series

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index a235d25..21895c2 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -35,6 +35,32 @@ 
 #define xen_rmb()  smp_rmb()
 #define xen_wmb()  smp_wmb()
 
+/* VM event */
+struct vm_event_domain
+{
+    /* Domain reference */
+    struct domain *d;
+    spinlock_t lock;
+    /* The ring has 64 entries */
+    unsigned char foreign_producers;
+    unsigned char target_producers;
+    /* shared ring page */
+    void *ring_page;
+    struct page_info *ring_pg_struct;
+    /* front-end ring */
+    vm_event_front_ring_t front_ring;
+    /* event channel port (vcpu0 only) */
+    int xen_port;
+    /* vm_event bit for vcpu->pause_flags */
+    int pause_flag;
+    /* list of vcpus waiting for room in the ring */
+    struct waitqueue_head wq;
+    /* the number of vCPUs blocked */
+    unsigned int blocked;
+    /* The last vcpu woken up */
+    unsigned int last_vcpu_wake_up;
+};
+
 static int vm_event_enable(
     struct domain *d,
     struct xen_domctl_vm_event_op *vec,
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e3093d3..19980d2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -276,31 +276,7 @@  struct vcpu
 #define domain_lock(d) spin_lock_recursive(&(d)->domain_lock)
 #define domain_unlock(d) spin_unlock_recursive(&(d)->domain_lock)
 
-/* VM event */
-struct vm_event_domain
-{
-    /* Domain reference */
-    struct domain *d;
-    spinlock_t lock;
-    /* The ring has 64 entries */
-    unsigned char foreign_producers;
-    unsigned char target_producers;
-    /* shared ring page */
-    void *ring_page;
-    struct page_info *ring_pg_struct;
-    /* front-end ring */
-    vm_event_front_ring_t front_ring;
-    /* event channel port (vcpu0 only) */
-    int xen_port;
-    /* vm_event bit for vcpu->pause_flags */
-    int pause_flag;
-    /* list of vcpus waiting for room in the ring */
-    struct waitqueue_head wq;
-    /* the number of vCPUs blocked */
-    unsigned int blocked;
-    /* The last vcpu woken up */
-    unsigned int last_vcpu_wake_up;
-};
+struct vm_event_domain;
 
 struct evtchn_port_ops;