From patchwork Fri May 3 16:59:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 10929023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37CF1912 for ; Fri, 3 May 2019 17:01:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2864C2873C for ; Fri, 3 May 2019 17:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C9D12869B; Fri, 3 May 2019 17:01:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9DE8D28717 for ; Fri, 3 May 2019 17:01:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMbXi-000858-Ca; Fri, 03 May 2019 17:00:14 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMbXh-00084T-Aa for xen-devel@lists.xenproject.org; Fri, 03 May 2019 17:00:13 +0000 X-Inumbo-ID: e9f68e9c-6dc4-11e9-843c-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id e9f68e9c-6dc4-11e9-843c-bc764e045a96; Fri, 03 May 2019 17:00:11 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,426,1549929600"; d="scan'208";a="85085350" From: Ian Jackson To: Date: Fri, 3 May 2019 17:59:57 +0100 Message-ID: <20190503165957.5960-12-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190503165957.5960-1-ian.jackson@eu.citrix.com> References: <20190503165957.5960-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 11/11] mg-allocate: Don't try allocating the same resource for two specs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is obviously wrong. In fact it does not work (we bomb out in the allocation). Signed-off-by: Ian Jackson --- v2: New patch --- mg-allocate | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mg-allocate b/mg-allocate index 087b14b0..b5dc185e 100755 --- a/mg-allocate +++ b/mg-allocate @@ -437,6 +437,16 @@ sub plan () { map { [ @$possreqs, $_ ] } @reqlist; } @possmatrix; } + @possmatrix = grep { + my $possreqs = $_; + my %got; + my $ok=1; + foreach (@$possreqs) { + next if !$got{$_->{Reso}}++; + $ok=0; last; + } + $ok; + } @possmatrix; my $planned; my @reqlist;