[Kimchi-devel] [PATCH] Add os_arch field to distros

Christy Perez christy at linux.vnet.ibm.com
Thu Feb 6 16:58:26 UTC 2014


Thanks Paulo, Crístian See replies below.

On Thu, 2014-02-06 at 10:45 -0200, Paulo Ricardo Paz Vital wrote:
> On Wed, 2014-02-05 at 21:38 -0200, Crístian Viana wrote:
> > Am 05-02-2014 19:51, schrieb Christy Perez:
> > > Adding an os_arch field to the distro so we can filter distros
> > > on systems with other architectures. This prevents a user from
> > > creating unusable templates.
> > Does this prevent a user running on an x86_64 host from creating an x86 
> > guest?
> 
> Yes. I guess the best is create a dictionary with all architectures
> supported. So, the distroloader.py should be also, like:
> 
> diff --git a/src/kimchi/distroloader.py b/src/kimchi/distroloader.py
> index 98fd764..d8e76bf 100644
> --- a/src/kimchi/distroloader.py
> +++ b/src/kimchi/distroloader.py
> @@ -51,9 +51,10 @@ class DistroLoader(object):
>              raise OperationFailed(msg)
> 
>      def get(self):
> +        arch = {'x86_64': ['x86_64', 'amd64', 'i686', 'x86'],
>                  'amd64': ['x86_64', 'amd64', 'i686', 'x86']}
>          all_json_files = glob.glob("%s/%s" % (self.location, "*.json"))
>          distros = []
>          for f in all_json_files:
>              distros.extend(self._get_json_info(f))
> 
> -        return dict([(distro['name'], distro) for distro in distros])
> +        return dict([(distro['name'], distro) for distro in distros if
> distro['os_arch'] in arch[os.uname()[4]]])
> 
> May be this can dictionary or map should be added in src/kimchi/utils.py
> and the compatibility returned by a function.
I'll change it to do that.
> 
> In addition, the arch of Debian, Ubuntu and Gentoo entries should be
> 'amd64' instead of 'x86_64'.

Ok, will do that too. It works well with your "in arch" dictionary check. Thanks!

> Best regards, Paulo.
> 
> > 
> > _______________________________________________
> > Kimchi-devel mailing list
> > Kimchi-devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/kimchi-devel
> > 
> 





More information about the Kimchi-devel mailing list