From patchwork Tue Dec 24 13:04:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11309319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E36DD138D for ; Tue, 24 Dec 2019 13:05:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0A28206B7 for ; Tue, 24 Dec 2019 13:05:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="S+QGCHc9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0A28206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ijjrh-0005Nh-88; Tue, 24 Dec 2019 13:04:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ijjrf-0005N1-QR for xen-devel@lists.xenproject.org; Tue, 24 Dec 2019 13:04:43 +0000 X-Inumbo-ID: f0b48ec6-264d-11ea-97ba-12813bfff9fa Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f0b48ec6-264d-11ea-97ba-12813bfff9fa; Tue, 24 Dec 2019 13:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577192678; x=1608728678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vnIq/cIgRD0jd90vP+NlWt4S20SbX16kcXTVjrRcQ60=; b=S+QGCHc9tss+5PngJC2JcrPIOxT0hGuLojjx5qdTfUmpGSvusA2BaQ99 A7nz1PeNYkNSlhVUAtN/yLWfQB1HvGJXUxb5AN5eEwxML4p1YgAcqK+fa KBrmxjYCnixNPlRaPpnCNh4gqu+/k6ceaHjf06NQuLAy7nNSLT0E4MT5x I=; IronPort-SDR: f9DRfdJJtGk9Yoe+mjxl32GMCrpGGDFOEhjpy//ecS8xWfY38jI9ooewUmIt6GV4TPl12D2aJH zQR4sBOiAw5A== X-IronPort-AV: E=Sophos;i="5.69,351,1571702400"; d="scan'208";a="9013343" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-57e1d233.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 24 Dec 2019 13:04:37 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-57e1d233.us-east-1.amazon.com (Postfix) with ESMTPS id A8B28141A2F; Tue, 24 Dec 2019 13:04:34 +0000 (UTC) Received: from EX13D32EUC001.ant.amazon.com (10.43.164.159) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 24 Dec 2019 13:04:33 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D32EUC001.ant.amazon.com (10.43.164.159) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 24 Dec 2019 13:04:32 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 24 Dec 2019 13:04:30 +0000 From: Paul Durrant To: Date: Tue, 24 Dec 2019 13:04:14 +0000 Message-ID: <20191224130416.3570-5-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191224130416.3570-1-pdurrant@amazon.com> References: <20191224130416.3570-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH 4/6] domctl: set XEN_DOMCTL_createdomain 'rover' if valid domid is specified X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Paul Durrant , Ian Jackson , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The value of 'rover' is the value at which Xen will start searching for an unused domid if none is specified. Currently it is only updated when a domid is automatically chosen, rather than specified by the caller, which makes it very hard to describe Xen's rationale in choosing domids in an environment where some domain creations have specified domids and some don't. This patch always updates 'rover' after a successful creation, even in the case that domid is specified by the caller. This ensures that, if Xen automatically chooses a domid for a subsequent domain creation it will always be the next available value after the domid of the most recently created domain. Signed-off-by: Paul Durrant --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Wei Liu --- xen/common/domctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 650310e874..5268f3967b 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -521,8 +521,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) ret = -ENOMEM; if ( dom == rover ) break; - - rover = dom; } d = domain_create(dom, &op->u.createdomain, false); @@ -534,7 +532,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) } ret = 0; - op->domain = d->domain_id; + rover = op->domain = d->domain_id; copyback = 1; d = NULL; break;