WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Rename the struct grant_entry to struct g

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Rename the struct grant_entry to struct grant_entry_v1, so that it
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 06 Oct 2009 23:55:15 -0700
Delivery-date: Tue, 06 Oct 2009 23:56:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1254897974 -3600
# Node ID 7d4f05a65d5a840eca5fdf1319c696d5583f100d
# Parent  9130b2b5dc99173f70f7cc45eeb7cc9d0f30411c
Rename the struct grant_entry to struct grant_entry_v1, so that it
isn't in the way when we introduce struct grant_entry_v2.

Signed-off-by: Steven Smith <steven.smith@xxxxxxxxxx>
---
 tools/libxc/xc_linux.c           |    6 +++---
 tools/libxc/xc_offline_page.c    |    6 +++---
 tools/libxc/xenctrl.h            |    2 +-
 xen/common/compat/grant_table.c  |    6 +++---
 xen/common/grant_table.c         |   24 ++++++++++++------------
 xen/include/public/grant_table.h |    8 ++++++--
 xen/include/public/xen-compat.h  |    2 +-
 xen/include/xen/grant_table.h    |    6 +++---
 xen/include/xlat.lst             |    2 +-
 9 files changed, 33 insertions(+), 29 deletions(-)

diff -r 9130b2b5dc99 -r 7d4f05a65d5a tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c    Wed Oct 07 07:45:39 2009 +0100
+++ b/tools/libxc/xc_linux.c    Wed Oct 07 07:46:14 2009 +0100
@@ -558,14 +558,14 @@ int xc_gnttab_op(int xc_handle, int cmd,
     return ret;
 }
 
-struct grant_entry *xc_gnttab_map_table(int xc_handle, int domid, int *gnt_num)
+struct grant_entry_v1 *xc_gnttab_map_table(int xc_handle, int domid, int 
*gnt_num)
 {
     int rc, i;
     struct gnttab_query_size query;
     struct gnttab_setup_table setup;
     unsigned long *frame_list = NULL;
     xen_pfn_t *pfn_list = NULL;
-    struct grant_entry *gnt = NULL;
+    struct grant_entry_v1 *gnt = NULL;
 
     if (!gnt_num)
         return NULL;
@@ -581,7 +581,7 @@ struct grant_entry *xc_gnttab_map_table(
     }
 
     *gnt_num = query.nr_frames *
-            (PAGE_SIZE / sizeof(struct grant_entry) );
+            (PAGE_SIZE / sizeof(struct grant_entry_v1) );
 
     frame_list = malloc(query.nr_frames * sizeof(unsigned long));
     if (!frame_list || lock_pages(frame_list, query.nr_frames *
diff -r 9130b2b5dc99 -r 7d4f05a65d5a tools/libxc/xc_offline_page.c
--- a/tools/libxc/xc_offline_page.c     Wed Oct 07 07:45:39 2009 +0100
+++ b/tools/libxc/xc_offline_page.c     Wed Oct 07 07:46:14 2009 +0100
@@ -133,7 +133,7 @@ int xc_query_page_offline_status(int xc,
   * There should no update to the grant when domain paused
   */
 static int xc_is_page_granted(int xc_handle, xen_pfn_t gpfn,
-                              struct grant_entry *gnttab, int gnt_num)
+                              struct grant_entry_v1 *gnttab, int gnt_num)
 {
     int i = 0;
 
@@ -549,7 +549,7 @@ int xc_exchange_page(int xc_handle, int 
     struct domain_mem_info minfo;
     struct xc_mmu *mmu = NULL;
     struct pte_backup old_ptes = {NULL, 0, 0};
-    struct grant_entry *gnttab = NULL;
+    struct grant_entry_v1 *gnttab = NULL;
     struct mmuext_op mops;
     int gnt_num, unpined = 0;
     void *old_p, *backup = NULL;
@@ -756,7 +756,7 @@ failed:
         free(backup);
 
     if (gnttab)
-        munmap(gnttab, gnt_num / (PAGE_SIZE/sizeof(struct grant_entry)));
+        munmap(gnttab, gnt_num / (PAGE_SIZE/sizeof(struct grant_entry_v1)));
 
     close_mem_info(xc_handle, &minfo);
 
diff -r 9130b2b5dc99 -r 7d4f05a65d5a tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Wed Oct 07 07:45:39 2009 +0100
+++ b/tools/libxc/xenctrl.h     Wed Oct 07 07:46:14 2009 +0100
@@ -943,7 +943,7 @@ int xc_gnttab_op(int xc_handle, int cmd,
 int xc_gnttab_op(int xc_handle, int cmd,
                  void * op, int op_size, int count);
 
-struct grant_entry *xc_gnttab_map_table(int xc_handle, int domid, int 
*gnt_num);
+struct grant_entry_v1 *xc_gnttab_map_table(int xc_handle, int domid, int 
*gnt_num);
 
 int xc_physdev_map_pirq(int xc_handle,
                         int domid,
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c   Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/common/compat/grant_table.c   Wed Oct 07 07:46:14 2009 +0100
@@ -5,9 +5,9 @@
 
 #include <compat/grant_table.h>
 
-#define xen_grant_entry grant_entry
-CHECK_grant_entry;
-#undef xen_grant_entry
+#define xen_grant_entry_v1 grant_entry_v1
+CHECK_grant_entry_v1;
+#undef xen_grant_entry_v1
 
 #define xen_gnttab_map_grant_ref gnttab_map_grant_ref
 CHECK_gnttab_map_grant_ref;
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/common/grant_table.c
--- a/xen/common/grant_table.c  Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/common/grant_table.c  Wed Oct 07 07:46:14 2009 +0100
@@ -105,7 +105,7 @@ static unsigned inline int max_nr_maptra
 }
 
 
-#define SHGNT_PER_PAGE (PAGE_SIZE / sizeof(grant_entry_t))
+#define SHGNT_PER_PAGE (PAGE_SIZE / sizeof(grant_entry_v1_t))
 #define shared_entry(t, e) \
     ((t)->shared[(e)/SHGNT_PER_PAGE][(e)%SHGNT_PER_PAGE])
 #define ACGNT_PER_PAGE (PAGE_SIZE / sizeof(struct active_grant_entry))
@@ -205,7 +205,7 @@ __gnttab_map_grant_ref(
     unsigned int   cache_flags;
     struct active_grant_entry *act;
     struct grant_mapping *mt;
-    grant_entry_t *sha;
+    grant_entry_v1_t *sha;
     union grant_combo scombo, prev_scombo, new_scombo;
 
     /*
@@ -508,7 +508,7 @@ __gnttab_unmap_common(
     domid_t          dom;
     struct domain   *ld, *rd;
     struct active_grant_entry *act;
-    grant_entry_t   *sha;
+    grant_entry_v1_t *sha;
     s16              rc = 0;
     u32              old_pin;
 
@@ -622,7 +622,7 @@ __gnttab_unmap_common_complete(struct gn
 {
     struct domain   *ld, *rd;
     struct active_grant_entry *act;
-    grant_entry_t   *sha;
+    grant_entry_v1_t *sha;
     struct page_info *pg;
 
     rd = op->rd;
@@ -1046,7 +1046,7 @@ gnttab_prepare_for_transfer(
     struct domain *rd, struct domain *ld, grant_ref_t ref)
 {
     struct grant_table *rgt;
-    struct grant_entry *sha;
+    struct grant_entry_v1 *sha;
     union grant_combo   scombo, prev_scombo, new_scombo;
     int                 retries = 0;
 
@@ -1115,7 +1115,7 @@ gnttab_transfer(
     struct domain *e;
     struct page_info *page;
     int i;
-    grant_entry_t *sha;
+    grant_entry_v1_t *sha;
     struct gnttab_transfer gop;
     unsigned long mfn;
     unsigned int max_bitsize;
@@ -1278,7 +1278,7 @@ __release_grant_for_copy(
 __release_grant_for_copy(
     struct domain *rd, unsigned long gref, int readonly)
 {
-    grant_entry_t *sha;
+    grant_entry_v1_t *sha;
     struct active_grant_entry *act;
     unsigned long r_frame;
 
@@ -1316,7 +1316,7 @@ __acquire_grant_for_copy(
     struct domain *rd, unsigned long gref, int readonly,
     unsigned long *frame)
 {
-    grant_entry_t *sha;
+    grant_entry_v1_t *sha;
     struct active_grant_entry *act;
     s16 rc = GNTST_okay;
     int retries = 0;
@@ -1654,7 +1654,7 @@ do_grant_table_op(
 
 static unsigned int max_nr_active_grant_frames(void)
 {
-    return (((max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_t))) + 
+    return (((max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_v1_t))) + 
                     ((PAGE_SIZE / sizeof(struct active_grant_entry))-1)) 
                    / (PAGE_SIZE / sizeof(struct active_grant_entry)));
 }
@@ -1667,7 +1667,7 @@ grant_table_create(
     int                 i;
 
     /* If this sizeof assertion fails, fix the function: shared_index */
-    ASSERT(sizeof(grant_entry_t) == 8);
+    ASSERT(sizeof(grant_entry_v1_t) == 8);
 
     if ( (t = xmalloc(struct grant_table)) == NULL )
         goto no_mem_0;
@@ -1703,7 +1703,7 @@ grant_table_create(
         t->maptrack[0][i].ref = i+1;
 
     /* Shared grant table. */
-    if ( (t->shared = xmalloc_array(struct grant_entry *,
+    if ( (t->shared = xmalloc_array(struct grant_entry_v1 *,
                                     max_nr_grant_frames)) == NULL )
         goto no_mem_3;
     memset(t->shared, 0, max_nr_grant_frames * sizeof(t->shared[0]));
@@ -1749,7 +1749,7 @@ gnttab_release_mappings(
     grant_handle_t        handle;
     struct domain        *rd;
     struct active_grant_entry *act;
-    struct grant_entry   *sha;
+    struct grant_entry_v1*sha;
     struct page_info     *pg;
 
     BUG_ON(!d->is_dying);
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h  Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/include/public/grant_table.h  Wed Oct 07 07:46:14 2009 +0100
@@ -90,7 +90,11 @@
  * [XEN]: This field is written by Xen and read by the sharing guest.
  * [GST]: This field is written by the guest and read by Xen.
  */
-struct grant_entry {
+#if __XEN_INTERFACE_VERSION__ < 0x0003020a
+#define grant_entry_v1 grant_entry
+#define grant_entry_v1_t grant_entry_t
+#endif
+struct grant_entry_v1 {
     /* GTF_xxx: various type and flag information.  [XEN,GST] */
     uint16_t flags;
     /* The domain being granted foreign privileges. [GST] */
@@ -101,7 +105,7 @@ struct grant_entry {
      */
     uint32_t frame;
 };
-typedef struct grant_entry grant_entry_t;
+typedef struct grant_entry_v1 grant_entry_v1_t;
 
 /*
  * Type of grant entry.
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/include/public/xen-compat.h
--- a/xen/include/public/xen-compat.h   Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/include/public/xen-compat.h   Wed Oct 07 07:46:14 2009 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030209
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x0003020a
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h     Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/include/xen/grant_table.h     Wed Oct 07 07:46:14 2009 +0100
@@ -80,7 +80,7 @@ struct grant_table {
     /* Table size. Number of frames shared with guest */
     unsigned int          nr_grant_frames;
     /* Shared grant table (see include/public/grant_table.h). */
-    struct grant_entry  **shared;
+    struct grant_entry_v1 **shared;
     /* Active grant table. */
     struct active_grant_entry **active;
     /* Mapping tracking table. */
@@ -117,7 +117,7 @@ static inline unsigned int nr_grant_fram
 /* Number of grant table entries. Caller must hold d's grant table lock. */
 static inline unsigned int nr_grant_entries(struct grant_table *gt)
 {
-    return (nr_grant_frames(gt) << PAGE_SHIFT) / sizeof(grant_entry_t);
+    return (nr_grant_frames(gt) << PAGE_SHIFT) / sizeof(grant_entry_v1_t);
 }
 
 static inline unsigned int
@@ -126,7 +126,7 @@ num_act_frames_from_sha_frames(const uns
     /* How many frames are needed for the active grant table,
      * given the size of the shared grant table? */
     unsigned act_per_page = PAGE_SIZE / sizeof(struct active_grant_entry);
-    unsigned sha_per_page = PAGE_SIZE / sizeof(grant_entry_t);
+    unsigned sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t);
     unsigned num_sha_entries = num * sha_per_page;
     unsigned num_act_frames =
         (num_sha_entries + (act_per_page-1)) / act_per_page;
diff -r 9130b2b5dc99 -r 7d4f05a65d5a xen/include/xlat.lst
--- a/xen/include/xlat.lst      Wed Oct 07 07:45:39 2009 +0100
+++ b/xen/include/xlat.lst      Wed Oct 07 07:46:14 2009 +0100
@@ -44,7 +44,7 @@
 !      gnttab_transfer                 grant_table.h
 ?      gnttab_unmap_grant_ref          grant_table.h
 ?      gnttab_unmap_and_replace        grant_table.h
-?      grant_entry                     grant_table.h
+?      grant_entry_v1                  grant_table.h
 ?      kexec_exec                      kexec.h
 !      kexec_image                     kexec.h
 !      kexec_range                     kexec.h

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Rename the struct grant_entry to struct grant_entry_v1, so that it, Xen patchbot-unstable <=