All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Subject: [PATCH 1/1] tools/python: move lowlevel packages one level up
Date: Wed, 20 Apr 2022 19:23:50 -0700	[thread overview]
Message-ID: <92e5016290be569916c82c255e911d469b1de2db.1650551486.git.ehem+xen@m5p.com> (raw)
In-Reply-To: <cover.1650551486.git.ehem+xen@m5p.com>

Prior to this a Python script first needed to import 3 levels of
packages, then invoke xen.lowlevel.$tool.$tool() to get a handle.  Now
only 2 levels of packages, then xen.lowlevel.$tool() gets a handle.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/pygrub/src/pygrub                 |  4 ++--
 tools/python/setup.py                   | 12 ++++++------
 tools/python/xen/lowlevel/{xc => }/xc.c |  0
 tools/python/xen/lowlevel/{xs => }/xs.c |  0
 4 files changed, 8 insertions(+), 8 deletions(-)
 rename tools/python/xen/lowlevel/{xc => }/xc.c (100%)
 rename tools/python/xen/lowlevel/{xs => }/xs.c (100%)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index ce7ab0eb8c..6b1989c7d8 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -18,7 +18,7 @@ import os, sys, string, struct, tempfile, re, traceback, stat, errno
 import copy
 import logging
 import platform
-import xen.lowlevel.xc
+import xen.lowlevel
 
 import curses, _curses, curses.textpad, curses.ascii
 import getopt
@@ -669,7 +669,7 @@ def run_grub(file, entry, fs, cfg_args):
     return grubcfg
 
 def supports64bitPVguest():
-    xc = xen.lowlevel.xc.xc()
+    xc = xen.lowlevel.xc()
     caps = xc.xeninfo()['xen_caps'].split(" ")
     for cap in caps:
         if cap == "xen-3.0-x86_64":
diff --git a/tools/python/setup.py b/tools/python/setup.py
index 8c95db7769..77546335b8 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -17,28 +17,28 @@ PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl"
 PATH_LIBXENGUEST = XEN_ROOT + "/tools/libs/guest"
 PATH_XENSTORE = XEN_ROOT + "/tools/libs/store"
 
-xc = Extension("xc",
+xc = Extension("xen.lowlevel.xc",
                extra_compile_args = extra_compile_args,
                include_dirs       = [ PATH_XEN,
                                       PATH_LIBXENTOOLLOG + "/include",
                                       PATH_LIBXENEVTCHN + "/include",
                                       PATH_LIBXENCTRL + "/include",
                                       PATH_LIBXENGUEST + "/include",
-                                      "xen/lowlevel/xc" ],
+                                      "xen/lowlevel" ],
                library_dirs       = [ PATH_LIBXENCTRL, PATH_LIBXENGUEST ],
                libraries          = [ "xenctrl", "xenguest" ],
                depends            = [ PATH_LIBXENCTRL + "/libxenctrl.so", PATH_LIBXENGUEST + "/libxenguest.so" ],
                extra_link_args    = SHLIB_libxenctrl + SHLIB_libxenguest,
-               sources            = [ "xen/lowlevel/xc/xc.c" ])
+               sources            = [ "xen/lowlevel/xc.c" ])
 
-xs = Extension("xs",
+xs = Extension("xen.lowlevel.xs",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ],
+               include_dirs       = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel" ],
                library_dirs       = [ PATH_XENSTORE ],
                libraries          = [ "xenstore" ],
                depends            = [ PATH_XENSTORE + "/libxenstore.so" ],
                extra_link_args    = SHLIB_libxenstore,
-               sources            = [ "xen/lowlevel/xs/xs.c" ])
+               sources            = [ "xen/lowlevel/xs.c" ])
 
 plat = os.uname()[0]
 modules = [ xc, xs ]
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc.c
similarity index 100%
rename from tools/python/xen/lowlevel/xc/xc.c
rename to tools/python/xen/lowlevel/xc.c
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs.c
similarity index 100%
rename from tools/python/xen/lowlevel/xs/xs.c
rename to tools/python/xen/lowlevel/xs.c
-- 
2.30.2



  reply	other threads:[~2022-04-22  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 14:31 [PATCH 0/1] Adjust odd Python bindings Elliott Mitchell
2022-04-21  2:23 ` Elliott Mitchell [this message]
2022-04-22  1:17 ` Marek Marczykowski-Górecki
2022-04-22 19:59   ` Elliott Mitchell

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=92e5016290be569916c82c255e911d469b1de2db.1650551486.git.ehem+xen@m5p.com \
    --to=ehem+xen@m5p.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.