From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH 07/12] tools/pygrub: store kernels in /var/run/xen/pygrub
Date: Thu, 24 Apr 2014 10:41:01 +0100 [thread overview]
Message-ID: <5358DC2D.8090908@citrix.com> (raw)
In-Reply-To: <1398328615-28461-8-git-send-email-olaf@aepfle.de>
On 24/04/14 09:36, Olaf Hering wrote:
> Move location of temporary bootfiles from /var/run/xend/boot to
> /var/run/xen/pygrub. Create the subdirectory if does not exist, unless
> --output-directory=<dir> was specified.
>
> The reason for this change is that all entrys below /var/run have to be
> created at runtime in case /var/run is cleared on every boot.
>
> v3:
> use /var/run/xen/pygrub instead of /var/run/pygrub
> v2:
> update exception handling for python 2.4
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
> tools/pygrub/src/pygrub | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index 54fecee..7759b1a 100644
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -14,6 +14,7 @@
> #
>
> import os, sys, string, struct, tempfile, re, traceback
> +import errno
> import copy
> import logging
> import platform
> @@ -757,7 +758,7 @@ if __name__ == "__main__":
> debug = False
> not_really = False
> output_format = "sxp"
> - output_directory = "/var/run/xend/boot"
> + output_directory = None
>
> # what was passed in
> incfg = { "kernel": None, "ramdisk": None, "args": "" }
> @@ -813,6 +814,16 @@ if __name__ == "__main__":
> if debug:
> logging.basicConfig(level=logging.DEBUG)
>
> + if output_directory is None:
> + output_directory = "/var/run/xen/pygrub"
> + try:
> + os.mkdir(output_directory, 0700)
> + except OSError, exc:
> + if exc.errno == errno.EEXIST and os.path.isdir(output_directory):
> + pass
> + else:
> + raise
if not (exc.errno == errno.EEXIST and os.path.isdir(output_directory)):
raise
There is no need for the pass statement.
~Andrew
next prev parent reply other threads:[~2014-04-24 9:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 8:36 [PATCH 00/12] more tools changes to honor --prefix= Olaf Hering
2014-04-24 8:36 ` [PATCH 01/12] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
2014-05-02 10:40 ` Ian Campbell
2014-05-02 10:57 ` Olaf Hering
2014-05-02 11:46 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 02/12] Config.mk: replace dependency to genpath with actual target Olaf Hering
2014-05-02 10:43 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 03/12] Config.mk: add new macro buildmakevars2header Olaf Hering
2014-05-02 10:44 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 04/12] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
2014-05-02 10:46 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 05/12] tools/libxc: provide variable paths to libxc Olaf Hering
2014-05-02 10:48 ` Ian Campbell
2014-05-02 10:58 ` Olaf Hering
2014-04-24 8:36 ` [PATCH 06/12] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
2014-04-24 8:36 ` [PATCH 07/12] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
2014-04-24 9:41 ` Andrew Cooper [this message]
2014-04-24 12:12 ` [PATCH 07/12 v4] " Olaf Hering
2014-05-02 10:49 ` Ian Campbell
2014-05-02 11:02 ` Olaf Hering
2014-05-02 11:48 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 08/12] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
2014-05-02 10:53 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 09/12] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
2014-05-02 10:54 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 10/12] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
2014-05-02 10:56 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 11/12] tools/examples: remove obsolete install targets Olaf Hering
2014-05-02 10:57 ` Ian Campbell
2014-04-24 8:36 ` [PATCH 12/12] remove obsolete SUBSYS_DIR variable Olaf Hering
2014-05-02 10:59 ` Ian Campbell
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=5358DC2D.8090908@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xen.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 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.