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

[Xen-changelog] Many files:



ChangeSet 1.1442, 2005/05/11 18:36:38+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        Many files:
          Merge interface changes from previous 'Split out context fetching into
          separate DOM0 op' and 'xen,tools: pincpu use vcpu and cpumap_t' 
checkins.
        xc_linux_save.c:
          Undo incorrect change from previous patch.
        xc.h, xc_domain.c:
          Cleanup whitespace.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 tools/libxc/xc.h                        |   41 ++++++++++------------
 tools/libxc/xc_core.c                   |    9 +++-
 tools/libxc/xc_domain.c                 |   13 ++-----
 tools/libxc/xc_linux_save.c             |   24 ++++---------
 tools/python/xen/lowlevel/xc/xc.c       |    3 -
 tools/python/xen/xend/XendDomainInfo.py |    2 -
 xen/common/dom0_ops.c                   |   58 +++++++++++---------------------
 xen/include/public/dom0_ops.h           |    5 --
 8 files changed, 62 insertions(+), 93 deletions(-)


diff -Nru a/tools/libxc/xc.h b/tools/libxc/xc.h
--- a/tools/libxc/xc.h  2005-05-11 17:04:50 -04:00
+++ b/tools/libxc/xc.h  2005-05-11 17:04:50 -04:00
@@ -87,22 +87,22 @@
 
 
 long xc_ptrace(enum __ptrace_request request, 
-              u32  domid,
-              long addr, 
-              long data);
+               u32  domid,
+               long addr, 
+               long data);
 
 long xc_ptrace_core(enum __ptrace_request request, 
-                   u32 domid, 
-                   long addr, 
-                   long data);
+                    u32 domid, 
+                    long addr, 
+                    long data);
 
 int xc_waitdomain(int domain, 
-                 int *status, 
-                 int options);
+                  int *status, 
+                  int options);
 
 int xc_waitdomain_core(int domain, 
-                      int *status, 
-                      int options);
+                       int *status, 
+                       int options);
 
 /*
  * DOMAIN MANAGEMENT FUNCTIONS
@@ -110,10 +110,6 @@
 
 typedef struct {
     u32           domid;
-    unsigned int  flags;
-    unsigned int  processors;
-    unsigned int  vcpus;
-    u16           n_vcpus;     
     unsigned int  dying:1, crashed:1, shutdown:1, 
                   paused:1, blocked:1, running:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
@@ -121,6 +117,7 @@
     unsigned long shared_info_frame;
     u64           cpu_time;
     unsigned long max_memkb;
+    unsigned int  vcpus;
     s32           vcpu_to_cpu[MAX_VIRT_CPUS];
     cpumap_t      cpumap[MAX_VIRT_CPUS];
 } xc_dominfo_t;
@@ -134,8 +131,8 @@
 
 
 int xc_domain_dumpcore(int xc_handle, 
-                      u32 domid,
-                      const char *corename);
+                       u32 domid,
+                       const char *corename);
 
 
 /**
@@ -202,9 +199,9 @@
  * @return 0 on success, -1 on failure
  */
 int xc_domain_get_vcpu_context(int xc_handle,
-                             u32 domid,
-                             u32 vcpu,
-                             vcpu_guest_context_t *ctxt);
+                               u32 domid,
+                               u32 vcpu,
+                               vcpu_guest_context_t *ctxt);
 
 int xc_domain_setcpuweight(int xc_handle,
                            u32 domid,
@@ -266,8 +263,8 @@
                 u32 domid, 
                 const char *image_name,
                 const char *cmdline, 
-               unsigned int control_evtchn, 
-               unsigned long flags);
+                unsigned int control_evtchn, 
+                unsigned long flags);
 
 struct mem_map;
 int xc_vmx_build(int xc_handle,
@@ -444,7 +441,7 @@
                            unsigned long *arr, int num );
 
 int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf, 
-                   unsigned long max_pfns);
+                    unsigned long max_pfns);
 
 /*\
  *  GRANT TABLE FUNCTIONS
diff -Nru a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     2005-05-11 17:04:50 -04:00
+++ b/tools/libxc/xc_core.c     2005-05-11 17:04:50 -04:00
@@ -53,7 +53,10 @@
                goto error_out;
        }
        
-       for (i = 0; i < info.n_vcpus; i++) {
+       for (i = 0; i < sizeof(info.vcpu_to_cpu) / sizeof(info.vcpu_to_cpu[0]);
+            i++) {
+               if (info.vcpu_to_cpu[i] == -1)
+                       continue;
                if (xc_domain_get_vcpu_context(xc_handle, domid, i, &ctxt[i])) {
                        PERROR("Could not get all vcpu contexts for domain");
                        goto error_out;
@@ -63,7 +66,7 @@
        nr_pages = info.nr_pages;
 
        header.xch_magic = 0xF00FEBED; 
-       header.xch_nr_vcpus = info.n_vcpus;
+       header.xch_nr_vcpus = info.vcpus;
        header.xch_nr_pages = nr_pages;
        header.xch_ctxt_offset = sizeof(struct xc_core_header);
        header.xch_index_offset = sizeof(struct xc_core_header) +
@@ -72,7 +75,7 @@
            sizeof(vcpu_guest_context_t) + nr_pages * sizeof(unsigned long));
 
        write(dump_fd, &header, sizeof(struct xc_core_header));
-       write(dump_fd, &ctxt, sizeof(ctxt[0]) * info.n_vcpus);
+       write(dump_fd, &ctxt, sizeof(ctxt[0]) * info.vcpus);
 
        if ((page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL) {
            printf("Could not allocate memory\n");
diff -Nru a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   2005-05-11 17:04:50 -04:00
+++ b/tools/libxc/xc_domain.c   2005-05-11 17:04:50 -04:00
@@ -115,9 +115,6 @@
         if ( (rc = do_dom0_op(xc_handle, &op)) < 0 )
             break;
         info->domid      = (u16)op.u.getdomaininfo.domain;
-        info->processors = op.u.getdomaininfo.processors;
-       info->n_vcpus    = op.u.getdomaininfo.n_active_vcpus;
-       info->flags      = op.u.getdomaininfo.flags;
 
         info->dying    = !!(op.u.getdomaininfo.flags & DOMFLAGS_DYING);
         info->crashed  = !!(op.u.getdomaininfo.flags & DOMFLAGS_CRASHED);
@@ -140,8 +137,8 @@
         memcpy(&info->cpumap, &op.u.getdomaininfo.cpumap, 
                sizeof(info->cpumap));
 
-       next_domid = (u16)op.u.getdomaininfo.domain + 1;
-       info++;
+        next_domid = (u16)op.u.getdomaininfo.domain + 1;
+        info++;
     }
 
     if( !nr_doms ) return rc; 
@@ -150,9 +147,9 @@
 }
 
 int xc_domain_get_vcpu_context(int xc_handle,
-                              u32 domid,
-                              u32 vcpu,
-                              vcpu_guest_context_t *ctxt)
+                               u32 domid,
+                               u32 vcpu,
+                               vcpu_guest_context_t *ctxt)
 {
     int rc, errno_saved;
     dom0_op_t op;
diff -Nru a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       2005-05-11 17:04:50 -04:00
+++ b/tools/libxc/xc_linux_save.c       2005-05-11 17:04:50 -04:00
@@ -345,20 +345,17 @@
         xcio_error(ioctxt, "Could not get vcpu context");
     }
 
-    if ( (info->flags & 
-          (DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT))) ==
-         (DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT)) )
+    if ( info->shutdown && info->shutdown_reason == SHUTDOWN_suspend )
     {
        return 0; // success
     }
 
-    if ( info->flags & DOMFLAGS_PAUSED )
+    if ( info->paused )
     {
        // try unpausing domain, wait, and retest       
        xc_domain_unpause( xc_handle, ioctxt->domain );
 
-       xcio_error(ioctxt, "Domain was paused. Wait and re-test. (%u)",
-                  info->flags);
+       xcio_error(ioctxt, "Domain was paused. Wait and re-test.");
        usleep(10000);  // 10ms
 
        goto retry;
@@ -367,12 +364,12 @@
 
     if( ++i < 100 )
     {
-       xcio_error(ioctxt, "Retry suspend domain (%u)", info->flags);
+       xcio_error(ioctxt, "Retry suspend domain.");
        usleep(10000);  // 10ms 
        goto retry;
     }
 
-    xcio_error(ioctxt, "Unable to suspend domain. (%u)", info->flags);
+    xcio_error(ioctxt, "Unable to suspend domain.");
 
     return -1;
 }
@@ -469,7 +466,7 @@
         goto out;
     }
     
-    nr_pfns = info.nr_pages; 
+    nr_pfns = info.max_memkb >> PAGE_SHIFT; 
 
     /* cheesy sanity check */
     if ( nr_pfns > 1024*1024 ){
@@ -556,8 +553,7 @@
 
        if ( suspend_and_state( xc_handle, ioctxt, &info, &ctxt) )
        {
-           xcio_error(ioctxt, "Domain appears not to have suspended: %u",
-                      info.flags);
+           xcio_error(ioctxt, "Domain appears not to have suspended");
            goto out;
        }
 
@@ -923,14 +919,12 @@
                if ( suspend_and_state( xc_handle, ioctxt, &info, &ctxt) )
                {
                    xcio_error(ioctxt, 
-                               "Domain appears not to have suspended: %u",
-                              info.flags);
+                               "Domain appears not to have suspended");
                    goto out;
                }
 
                xcio_info(ioctxt,
-                          "SUSPEND flags %08u shinfo %08lx eip %08u "
-                          "esi %08u\n",info.flags,
+                          "SUSPEND shinfo %08lx eip %08u esi %08u\n",
                           info.shared_info_frame,
                           ctxt.user_regs.eip, ctxt.user_regs.esi );
             } 
diff -Nru a/tools/python/xen/lowlevel/xc/xc.c 
b/tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c 2005-05-11 17:04:50 -04:00
+++ b/tools/python/xen/lowlevel/xc/xc.c 2005-05-11 17:04:50 -04:00

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


 


Rackspace

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