]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Remove libxl_tmem_destroy and associated xl command
authorIan Campbell <ian.campbell@citrix.com>
Mon, 16 Apr 2012 15:00:47 +0000 (16:00 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 16 Apr 2012 15:00:47 +0000 (16:00 +0100)
Dan Magenheimer explains in <4c2f7fca-dda2-4598-aaab-3a6a3fe532cd@default>:

I think the tmem_destroy functionality pre-dates the
existence of tmem "freeable" memory* and was a way for
a toolset to force the hypervisor to free up the hypervisor
memory used by some or all ephemeral tmem pools.  Once the
tmem allocation/free process was directly linked into
alloc_heap_pages() in the hypervisor (see call to
tmem_relinquish_pages()), this forcing function was
no longer needed.

So, bottom line, I *think* it can be ripped out, or at least
for now removed from the definition of the stable xl API/UI.
The libxl.c routine libxl_tmem_destroy() could also be
removed if you like, but I guess I'd prefer to leave the
lower level droppings in xc.c and in the hypervisor in case
I am misremembering.

Accordingly remove this interface from libxl and xl but don't touch libxc or
the hypervisor.

This is the only libxl_tmem_* function which might potentially have required
conversion to be asynchronous and which therefore might have been a potential
API stability concern.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
docs/man/xl.pod.1
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/xl.h
tools/libxl/xl_cmdimpl.c
tools/libxl/xl_cmdtable.c

index e5324fb6e3846449f78845914da455a55801d873..6e7a7a082f852d6d50034f4528a55768ef03ca3b 100644 (file)
@@ -1055,10 +1055,6 @@ List tmem pools. If I<-l> is specified, also list tmem stats.
 
 Freeze tmem pools.
 
-=item B<tmem-destroy> I<domain-id>
-
-Destroy tmem pools.
-
 =item B<tmem-thaw> I<domain-id>
 
 Thaw tmem pools.
index 5617060e2237715b54abe08377643bd4ba1ad784..df1fe729693cf09af3ccc22ec6303efdbc1307a3 100644 (file)
@@ -3496,21 +3496,6 @@ int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid)
     return rc;
 }
 
-int libxl_tmem_destroy(libxl_ctx *ctx, uint32_t domid)
-{
-    int rc;
-
-    rc = xc_tmem_control(ctx->xch, -1, TMEMC_DESTROY, domid, 0, 0,
-                         0, NULL);
-    if (rc < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
-            "Can not destroy tmem pools");
-        return ERROR_FAIL;
-    }
-
-    return rc;
-}
-
 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid)
 {
     int rc;
index edbca535baca346a94fd015bbbd6495a8844820f..4cccccd5312ee1c9d7b9fd8a24330e2e91229c7d 100644 (file)
@@ -754,7 +754,6 @@ uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid);
 
 char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long);
 int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid);
-int libxl_tmem_destroy(libxl_ctx *ctx, uint32_t domid);
 int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid);
 int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name,
                    uint32_t set);
index 7e258d540844f7924742925eacadeb72d1e64fd6..f0d0ec8870d1dc67cb148a8a87a5ccdf4fbe3f38 100644 (file)
@@ -76,7 +76,6 @@ int main_blockdetach(int argc, char **argv);
 int main_uptime(int argc, char **argv);
 int main_tmem_list(int argc, char **argv);
 int main_tmem_freeze(int argc, char **argv);
-int main_tmem_destroy(int argc, char **argv);
 int main_tmem_thaw(int argc, char **argv);
 int main_tmem_set(int argc, char **argv);
 int main_tmem_shared_auth(int argc, char **argv);
index b9e7688cd95278f476fd9bd2b3c6fa215f19ba1a..ff487498eaa19814641934a7da9f0f413826cd85 100644 (file)
@@ -5384,38 +5384,6 @@ int main_tmem_freeze(int argc, char **argv)
     return 0;
 }
 
-int main_tmem_destroy(int argc, char **argv)
-{
-    const char *dom = NULL;
-    int all = 0;
-    int opt;
-
-    while ((opt = def_getopt(argc, argv, "a", "tmem-destroy", 0)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'a':
-            all = 1;
-            break;
-        }
-    }
-
-    dom = argv[optind];
-    if (!dom && all == 0) {
-        fprintf(stderr, "You must specify -a or a domain id.\n\n");
-        help("tmem-destroy");
-        return 1;
-    }
-
-    if (all)
-        domid = -1;
-    else
-        find_domain(dom);
-
-    libxl_tmem_destroy(ctx, domid);
-    return 0;
-}
-
 int main_tmem_thaw(int argc, char **argv)
 {
     const char *dom = NULL;
index 736a8366ed2facf6a36090c5053cbd4556ad3eb4..de8955c1fa99acea19e2757795fcf00756c78f5f 100644 (file)
@@ -336,12 +336,6 @@ struct cmd_spec cmd_table[] = {
       "[<Domain>|-a]",
       "  -a                             Freeze all tmem",
     },
-    { "tmem-destroy",
-      &main_tmem_destroy, 0,
-      "Destroy tmem pools",
-      "[<Domain>|-a]",
-      "  -a                             Destroy all tmem",
-    },
     { "tmem-thaw",
       &main_tmem_thaw, 0,
       "Thaw tmem pools",