All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command
@ 2012-04-16 15:01 Ian Campbell
  2012-04-16 19:37 ` Dan Magenheimer
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2012-04-16 15:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Dan Magenheimer, ian.jackson

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1334588447 -3600
# Node ID bf46871ecfeee48a86855823df835a1ff174429e
# Parent  a20c43492fbff622aa9746404981628b498e0711
libxl: Remove libxl_tmem_destroy and associated xl command

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>

diff -r a20c43492fbf -r bf46871ecfee docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Mon Apr 16 15:41:43 2012 +0100
+++ b/docs/man/xl.pod.1	Mon Apr 16 16:00:47 2012 +0100
@@ -1055,10 +1055,6 @@ List tmem pools. If I<-l> is specified, 
 
 Freeze tmem pools.
 
-=item B<tmem-destroy> I<domain-id>
-
-Destroy tmem pools.
-
 =item B<tmem-thaw> I<domain-id>
 
 Thaw tmem pools.
diff -r a20c43492fbf -r bf46871ecfee tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Apr 16 15:41:43 2012 +0100
+++ b/tools/libxl/libxl.c	Mon Apr 16 16:00:47 2012 +0100
@@ -3495,21 +3495,6 @@ int libxl_tmem_freeze(libxl_ctx *ctx, ui
     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;
diff -r a20c43492fbf -r bf46871ecfee tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Mon Apr 16 15:41:43 2012 +0100
+++ b/tools/libxl/libxl.h	Mon Apr 16 16:00:47 2012 +0100
@@ -757,7 +757,6 @@ uint32_t libxl_vm_get_start_time(libxl_c
 
 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);
diff -r a20c43492fbf -r bf46871ecfee tools/libxl/xl.h
--- a/tools/libxl/xl.h	Mon Apr 16 15:41:43 2012 +0100
+++ b/tools/libxl/xl.h	Mon Apr 16 16:00:47 2012 +0100
@@ -76,7 +76,6 @@ int main_blockdetach(int argc, char **ar
 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);
diff -r a20c43492fbf -r bf46871ecfee tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Apr 16 15:41:43 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Apr 16 16:00:47 2012 +0100
@@ -5348,38 +5348,6 @@ int main_tmem_freeze(int argc, char **ar
     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;
diff -r a20c43492fbf -r bf46871ecfee tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Mon Apr 16 15:41:43 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Mon Apr 16 16:00:47 2012 +0100
@@ -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",

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command
  2012-04-16 15:01 [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command Ian Campbell
@ 2012-04-16 19:37 ` Dan Magenheimer
  2012-04-24 16:35   ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Magenheimer @ 2012-04-16 19:37 UTC (permalink / raw)
  To: Ian Campbell, xen-devel; +Cc: ian.jackson

> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Subject: [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command
> 
> 
> 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>

Thanks for handling this!

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command
  2012-04-16 19:37 ` Dan Magenheimer
@ 2012-04-24 16:35   ` Ian Jackson
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2012-04-24 16:35 UTC (permalink / raw)
  To: Dan Magenheimer; +Cc: Ian Campbell, xen-devel

Dan Magenheimer writes ("Re: [Xen-devel] [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command"):
> > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > Subject: [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command
> > 
> > 
> > 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>
> 
> Thanks for handling this!
> 
> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-24 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 15:01 [PATCH] libxl: Remove libxl_tmem_destroy and associated xl command Ian Campbell
2012-04-16 19:37 ` Dan Magenheimer
2012-04-24 16:35   ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.