[CRIU] [PATCH] LOG_DIR_FD_OFF -> WORK_DIR_FD_OFF

Andrew Vagin avagin at parallels.com
Mon Nov 11 02:34:06 PST 2013


On Mon, Nov 11, 2013 at 06:31:03PM +0400, Ruslan Kuprieiev wrote:
> On 11.11.2013 14:25, Andrew Vagin wrote:
> >On Mon, Nov 11, 2013 at 04:46:33PM +0400, Ruslan Kuprieiev wrote:
> >>On 11.11.2013 08:51, Andrew Vagin wrote:
> >>>On Mon, Nov 11, 2013 at 06:18:59AM +0400, Ruslan Kuprieiev wrote:
> >>>>Rename LOG_DIR_FD_OFF to WORK_DIR_FD_OFF for further use.
> >>>>Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> >>>>---
> >>>>  include/servicefd.h | 2 +-
> >>>>  log.c               | 6 +++---
> >>>>  2 files changed, 4 insertions(+), 4 deletions(-)
> >>>>
> >>>>diff --git a/include/servicefd.h b/include/servicefd.h
> >>>>index 85526b0..8547995 100644
> >>>>--- a/include/servicefd.h
> >>>>+++ b/include/servicefd.h
> >>>>@@ -7,7 +7,7 @@ enum sfd_type {
> >>>>  	SERVICE_FD_MIN,
> >>>>  	LOG_FD_OFF,
> >>>>-	LOG_DIR_FD_OFF,
> >>>>+	WORK_DIR_FD_OFF,
> >>>>  	IMG_FD_OFF,
> >>>Why do we need WORK_DIR and IMAGE_DIR? Can they be merged?
> >>No, they can't. We may need to restore from dir, where writing new
> >>logfiles\pidfiles isn't good. For example, this dir may be open as
> >>read-only.
> >What kind of files are saved in work dir?
> 
> If logfile or pidfile isn't absolute,  than it will be saved in work dir.

If someone don't want to save logfile and pidfile in a work (image) dir,
he can use absolute paths...

I suggest to remove LOG_DIR_FD_OFF at all.

> 
> >>>>  	PROC_FD_OFF,	/* fd with /proc for all proc_ calls */
> >>>>  	CTL_TTY_OFF,
> >>>>diff --git a/log.c b/log.c
> >>>>index a3b1472..c06d1c2 100644
> >>>>--- a/log.c
> >>>>+++ b/log.c
> >>>>@@ -68,7 +68,7 @@ int log_init(const char *output)
> >>>>  	gettimeofday(&start, NULL);
> >>>>  	buf_off = TS_BUF_OFF;
> >>>>-	dfd = get_service_fd(LOG_DIR_FD_OFF);
> >>>>+	dfd = get_service_fd(WORK_DIR_FD_OFF);
> >>>>  	if (dfd < 0) {
> >>>>  		int tmp;
> >>>>  		tmp = open(".", O_RDONLY);
> >>>>@@ -77,7 +77,7 @@ int log_init(const char *output)
> >>>>  			return -1;
> >>>>  		}
> >>>>-		dfd = install_service_fd(LOG_DIR_FD_OFF, tmp);
> >>>>+		dfd = install_service_fd(WORK_DIR_FD_OFF, tmp);
> >>>>  		close(tmp);
> >>>>  		if (dfd < 0)
> >>>>  			return -1;
> >>>>@@ -142,7 +142,7 @@ void log_fini(void)
> >>>>  void log_closedir(void)
> >>>>  {
> >>>>-	close_service_fd(LOG_DIR_FD_OFF);
> >>>>+	close_service_fd(WORK_DIR_FD_OFF);
> >>>>  }
> >>>>  void log_set_loglevel(unsigned int level)
> >>>>-- 
> >>>>1.8.1.2
> >>>>
> >>>>_______________________________________________
> >>>>CRIU mailing list
> >>>>CRIU at openvz.org
> >>>>https://lists.openvz.org/mailman/listinfo/criu
> 


More information about the CRIU mailing list