Linux Container Development
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>,
	serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Prefix / Naming USERCR API
Date: Mon, 5 Apr 2010 19:02:22 -0700	[thread overview]
Message-ID: <20100406020221.GA647@us.ibm.com> (raw)


Prefix / Function names for USERCR API

I guess the long term plan is to export the USERCR funtionality to management
or other applications as a library. We are trying to choose a good prefix for
the USERCR API. 

The current prefix for the API is, which was cooked up on the fly, is
"app_". This prefix is currently used in structures/functions like:

	struct app_checkpoint_args * 
	struct app_restart_args * 
	app_checkpoint()
	app_restart()

In the future we may have additional apis like:

	xxx_freeze()
	xxx_migrate()
	xxx_cr_advise() ?

Kernel api already uses some prefixes like (checkpoint, ckpt_ etc:

	<linux/checkpoint.h>
	<linux/checkpoint_hdr.h>

	struct ckpt_hdr_header
	struct ckpt_hdr

	checkpoint(2)
	restart(2)

	#define RESTART_TASKSELF 0x1
	#define CHECKPOINT_SUBTREE 0x1

Having a prefix would make it easy to identify the API and avoid collision
with other libraries that the application might link against. Eg: the
"pam_" prefixes PAM api.

Having a prefix like "cr_" or "acr_" could cause some redundancy in some
names, like cr_checkpoint(), but is probably ok, like pam_authenticate() ?

So, what would be a good prefix ?

	cr_
		cr_checkpoint.h, libcr.a
		cr_checkpoint() cr_restart() cr_freeze() cr_migrate()
		struct cr_checkpoint_args, struct cr_restart_args
	acr_ 
		Only advantage over 'cr_' is lesser likelihood of collision

		acr_checkpoint.h, libacr.a
		acr_checkpoint() acr_restart() acr_freeze() acr_migrate()
		struct acr_checkpoint_args, struct acr_restart_args

	lxcr_	
		lxcr_checkpoint.h, liblxcr.a 
		lxcr_checkpoint() lxcr_restart() lxcr_freeze() lxcr_migrate()
		struct lxcr_checkpoint_args, struct lxcr_restart_args

Other prefixes or naming suggestions ?

Thanks,

Sukadev

             reply	other threads:[~2010-04-06  2:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06  2:02 Sukadev Bhattiprolu [this message]
     [not found] ` <20100406020221.GA647-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-08  6:49   ` Prefix / Naming USERCR API Michel Normand
2010-04-10  3:48     ` Sukadev Bhattiprolu
     [not found]       ` <20100410034840.GA11028-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-10 13:06         ` Oren Laadan
     [not found]           ` <4BC077B8.6060305-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-11 17:02             ` Serge E. Hallyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100406020221.GA647@us.ibm.com \
    --to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox