From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 4/8] ms-planner: Support ClientNotes
Date: Wed, 6 Jul 2016 16:31:10 +0100 [thread overview]
Message-ID: <1467819074-16310-5-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1467819074-16310-1-git-send-email-ian.jackson@eu.citrix.com>
No users yet.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
README.planner | 22 ++++++++++++++++++++++
ms-planner | 23 +++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/README.planner b/README.planner
index daccef5..80c2506 100644
--- a/README.planner
+++ b/README.planner
@@ -286,6 +286,13 @@ Plan is:
Live
Job flight.job which made the allocation
+ ClientNotes
+ map from note key
+ to one of
+ scalar
+ array of values supplied by clients
+ hash of keys/values supplied by clients
+
* = internal to plan
** = computed by launder_check_plan
+ = as shown to clients
@@ -302,6 +309,12 @@ Booking list is:
Share optional struct containing
Type
Shares
+ [ClientNotes]
+ as for Plan; merged by
+ for scalar, updating from Booking if specified
+ for array, appending Booking to Plan
+ for hash, updating individual values from Booking
+ type must not have changed!
Sharing resources:
@@ -313,3 +326,12 @@ Bookings which do not create the share do not mention the master.
Note that whether a resource is free, or simply nonexistent, is not
represented.
+
+
+Note keys
+---------
+
+Note key name (key in ClientNotes):
+ Note value format:
+
+(none yet defined)
diff --git a/ms-planner b/ms-planner
index abf5fac..bce6e13 100755
--- a/ms-planner
+++ b/ms-planner
@@ -245,6 +245,7 @@ sub cmd_reset () {
$plan->{Start}= time;
$plan->{Events}= { };
$plan->{Unprocessed}= [ ];
+ $plan->{ClientNotes}= { };
my %magictask;
foreach my $taskrefkey (qw(preparing shared)) {
@@ -415,6 +416,9 @@ sub cmd_get_plan () {
}
$jplan->{Events}{$reso}= \@jevts;
}
+
+ $jplan->{ClientNotes} = $plan->{ClientNotes};
+
print to_json($jplan),"\n" or die $!;
}
@@ -529,6 +533,25 @@ sub cmd_book_resources () {
);
}
+ my $jnotes = $jbookings->{ClientNotes} // { };
+ foreach my $k (sort keys %$jnotes) {
+ my $v = $jnotes->{$k};
+ my $newt = ref $v // '(none)';
+ if (exists $plan->{ClientNotes}{$k}) {
+ my $oldt = ref $plan->{ClientNotes}{$k} // '(none)';
+ die "$k $oldt -> $newt" unless $oldt eq $newt;
+ }
+ if (!ref $v) {
+ $plan->{ClientNotes}{$k} = $v;
+ } elsif (ref $v eq 'HASH') {
+ $plan->{ClientNotes}{$k}{$_} = $v->{$_} foreach keys %$v;
+ } elsif (ref $v eq 'ARRAY') {
+ push @{ $plan->{ClientNotes}{$_} }, @{ $jnotes->{$_} };
+ } else {
+ die "$k $newt";
+ }
+ }
+
check_write_new_plan();
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-06 15:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 15:31 [OSSTEST PATCH 0/8] Support diverse-CLASS hostflag Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 1/8] Tcl: Use tclsh8.5 Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 2/8] ms-flights-summary: Remove spurious \ in keys \%{ something } Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 3/8] mg-schema-test-database: Direct logs to local directory Ian Jackson
2016-07-06 15:31 ` Ian Jackson [this message]
2016-07-06 15:31 ` [OSSTEST PATCH 5/8] ts-hosts-allocate-Executive: Replace some odd commas with semicolons Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 6/8] ts-hosts-allocate-Executive: pass $plan to hid_find_possibilities Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 7/8] ts-hosts-allocate-Executive: Support diverse-CLASS hostflag Ian Jackson
2016-07-06 15:31 ` [OSSTEST PATCH 8/8] DO NOT APPLY make-flight-diverse-test: test case for " 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=1467819074-16310-5-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).