On Tuesday, 21 August 2018 01:45:33 UTC-4, J. Kiszka wrote: > On 2018-08-20 21:41, Christopher Goldsworthy wrote: > > The information needed to determine if a machine can run jailhouse is > > located > > entirely in sysfs. To see if a machine can run jailhouse, the user must > > currently (1) generate a configuration file using jailhouse-config-create > > (2) > > run `make` (3) pass this file to jailhouse-hardware-check. > > > > Enable jailhouse-hardware-check to read this information directly from > > sysfs by > > moving the relevant sysfs parsing functions in jailhouse-config-create into > > a > > module in pyjailhouse. > > Just to clarify: Code was moved without modifications, right?
Yep. > > > > > Signed-off-by: Chris Goldsworthy <[email protected]> > > --- > > pyjailhouse/sysfs_parsers.py | 908 > > +++++++++++++++++++++++++++++++++++++++ > > sysfs_parser, I would suggest. It's not that it provides many > alternatives, it's rather one parser for the various interesting > entries, so to say. > > > tools/jailhouse-config-create | 958 > > ++---------------------------------------- > > 2 files changed, 936 insertions(+), 930 deletions(-) > > create mode 100644 pyjailhouse/sysfs_parsers.py > > > > diff --git a/pyjailhouse/sysfs_parsers.py b/pyjailhouse/sysfs_parsers.py > > new file mode 100644 > > index 0000000..fa919d7 > > --- /dev/null > > +++ b/pyjailhouse/sysfs_parsers.py > > @@ -0,0 +1,908 @@ > > Missing copyright header for this new file. > > > + > > +import struct > > +import os > > +import fnmatch > > + > > +root_dir = "" > > I would rather default to "/". > > > ...... > > try: > > from mako.template import Template > > @@ -33,6 +32,11 @@ except ImportError: > > print("This script requires the mako library to run.") > > sys.exit(1) > > > > +sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "/.." > > +import pyjailhouse.sysfs_parsers as sp > > "sp" is short but not very telling when you read it down in the code. > Maybe keep at least "sysfs_parser". > -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
