From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH OSSTEST 3/4] Add support for selecting resources based on their properties.
Date: Wed, 16 Sep 2015 09:57:50 +0100 [thread overview]
Message-ID: <1442393870.18856.44.camel@citrix.com> (raw)
In-Reply-To: <22008.21199.151242.800194@mariner.uk.xensource.com>
On Tue, 2015-09-15 at 18:18 +0100, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH OSSTEST 3/4] Add support for selecting
> resources based on their properties."):
> > In particular for allocating hosts based on host properties.
> >
> > To do this we extend the hostflags syntax with "condition:arg1:arg2".
> > This specifies that the candidate host must pass the condition given
> > the arguments.
>
> This looks pretty good.
>
> > +package Osstest::ResourceCondition::PropMinVer;
> ...
> > +sub new {
> > + my ($class, $name, $prop, $val) = @_;
> > + return bless {
> > + Prop => propname_massage($prop),
>
> You can probably skip this propname_massage too, and require the new
> actual flag settings to use the CamelCase naming.
My thinking is that this would prevent people using an old style name for
the database prop and getting away with it by making the same error in the
host flags.
Of course this now lets people get away with the wrong name in the host
flags so long as the database is correct.
die $prop ne propname_massage($prop)
???
>
> I think this function should check the length of @_ so as to reject
> invocations with the wrong number of :-delimited values. (This is not
> in general true of the various host access methods which arguably
> ought to tolerate additional expansion arguments, so it wasn't in the
> code you were cribbing.)
>
> > +sub stringify {
> > + my ($pmv) = @_;
> > + return "$pmv->{MinVal} >= property $pmv->{Prop}";
> ^
> Maybe add `(version)' or `(v)' ?
Done.
>
> > + # If the required minimum is >= to the resource's minimum then the
>
> You don't mean the `required minimum'. It's the `maximum minimum'.
> (In fact in the Linux kernel example it is going to be the _actual_.)
I did s/required minimum/maximum minimum/
> > diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
> > index 294395d..345ffeb 100755
> ...
> > + } elsif ($flag =~ m/:/) {
>
> Can we have $flag =~ m/^\w+: ?
Yep, done
[...]
> > + or die "get ResourceCondition $@";
> > +
> > + push @{$hid->{Conds}{host}}, $o;
>
> I normally like to put some spaces inside the @{ } in this kind of
> thing.
Ack.
>
> Ian.
next prev parent reply other threads:[~2015-09-16 8:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 16:05 [PATCH OSSTEST 0/4] Avoid running Linux on hosts for the given version lacks drivers Ian Campbell
2015-09-15 16:05 ` [PATCH OSSTEST 1/4] ts-hosts-allocate-Executive: Allow dry-run Ian Campbell
2015-09-15 17:04 ` Ian Jackson
2015-09-15 16:05 ` [PATCH OSSTEST 2/4] ts-hosts-allocate-Executive: add a label to loop over candidates Ian Campbell
2015-09-15 17:04 ` Ian Jackson
2015-09-16 8:51 ` Ian Campbell
2015-09-15 16:05 ` [PATCH OSSTEST 3/4] Add support for selecting resources based on their properties Ian Campbell
2015-09-15 17:18 ` Ian Jackson
2015-09-16 8:57 ` Ian Campbell [this message]
2015-09-15 16:05 ` [PATCH OSSTEST 4/4] make-flight: Add a minimum linux version requirement to all linux-* branches Ian Campbell
2015-09-15 17:19 ` Ian Jackson
2015-09-15 17:21 ` [PATCH OSSTEST 0/4] Avoid running Linux on hosts for the given version lacks drivers Ian Jackson
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=1442393870.18856.44.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--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.