From nobody Mon Feb 9 07:23:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1608050198; cv=none; d=zohomail.com; s=zohoarc; b=jUogFtDUlsPXaM606omsydO3QzjYyYZOOQPyjCaqOtB33/XqW9rapb7oT2vEMSA5IKZ4Pv8/ybmwD1SIi/dmbM+c6WfGszNskDy2KHij6y1zWhCFMF0IPsVqcHIbrD7SZ3lURf6RrlPqTZokB8AoH4WsYCTAOykDQzR+GRLvdwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608050198; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oPsWgsu0Wo7yJeT1ib74W9U6E/lawBZhnW/z8jovZm8=; b=eJwWqNP+IqfYx8w9BWRb+4OGAoZF7S5X0V7SqBQARPf6oh27v7d2fcs3GL/LQcT++k0p4lHpTnwY0kCtv1+3g4oWbU/TPcBj/bFGZQK6bKAM+0DzFSK919238GK6lOxQoZ+fLay6YA3u5dNVo2OgRINpl7S0TYJ+gklvWiUb/NU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1608050198069178.26292047805714; Tue, 15 Dec 2020 08:36:38 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.54532.94868 (Exim 4.92) (envelope-from ) id 1kpDJF-0006Ja-Hx; Tue, 15 Dec 2020 16:36:21 +0000 Received: by outflank-mailman (output) from mailman id 54532.94868; Tue, 15 Dec 2020 16:36:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpDJF-0006JO-Cp; Tue, 15 Dec 2020 16:36:21 +0000 Received: by outflank-mailman (input) for mailman id 54532; Tue, 15 Dec 2020 16:36:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpDJE-000667-Ga for xen-devel@lists.xenproject.org; Tue, 15 Dec 2020 16:36:20 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c49e25d7-c81e-4f40-8a58-c74da2309399; Tue, 15 Dec 2020 16:36:12 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BFFFEB263; Tue, 15 Dec 2020 16:36:09 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c49e25d7-c81e-4f40-8a58-c74da2309399 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1608050169; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oPsWgsu0Wo7yJeT1ib74W9U6E/lawBZhnW/z8jovZm8=; b=s039V4RVTZgXJYfw041GnbYOSMsbkTwO/6sN/ldkOjZSIY/BGrxE/mOiJE5Xyk44ldmsv/ CXixgGXkUbh41g+VxYF5bBnF0KQWpwBypFg+gkdNNw4wlAyTLvsIlH8k/sO3HPkLTy/ovN c6U0CWh/Mt2PX8EagEjIKPUS8/YwRcg= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Julien Grall , Paul Durrant Subject: [PATCH v10 10/25] tools/xenstore: add command line handling for live update Date: Tue, 15 Dec 2020 17:35:48 +0100 Message-Id: <20201215163603.21700-11-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201215163603.21700-1-jgross@suse.com> References: <20201215163603.21700-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Updating an instance of Xenstore via live update needs to hand over the command line parameters to the updated instance. Those can be either the parameters used by the updated instance or new ones when supplied when starting the live update. So when supplied store the new command line parameters in lu_status. As it is related add a new option -U (or --live-update") to the command line of xenstored which will be added when starting the new instance. This enables to perform slightly different initializations when started as a result of live update. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall Reviewed-by: Paul Durrant --- tools/xenstore/xenstored_control.c | 6 ++++++ tools/xenstore/xenstored_core.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_= control.c index 95ac1a1648..2e0827b9ef 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -42,6 +42,8 @@ struct live_update { #else char *filename; #endif + + char *cmdline; }; =20 static struct live_update *lu_status; @@ -211,6 +213,10 @@ static const char *lu_cmdline(const void *ctx, struct = connection *conn, if (!lu_status || lu_status->conn !=3D conn) return "Not in live-update session."; =20 + lu_status->cmdline =3D talloc_strdup(lu_status, cmdline); + if (!lu_status->cmdline) + return "Allocation failure."; + return NULL; } =20 diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_cor= e.c index e1b92c3dc8..0dddf24327 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -1969,6 +1969,7 @@ static struct option options[] =3D { { "internal-db", 0, NULL, 'I' }, { "verbose", 0, NULL, 'V' }, { "watch-nb", 1, NULL, 'W' }, + { "live-update", 0, NULL, 'U' }, { NULL, 0, NULL, 0 } }; =20 extern void dump_conn(struct connection *conn);=20 @@ -1983,11 +1984,12 @@ int main(int argc, char *argv[]) bool dofork =3D true; bool outputpid =3D false; bool no_domain_init =3D false; + bool live_update =3D false; const char *pidfile =3D NULL; int timeout; =20 =20 - while ((opt =3D getopt_long(argc, argv, "DE:F:HNPS:t:A:M:T:RVW:", options, + while ((opt =3D getopt_long(argc, argv, "DE:F:HNPS:t:A:M:T:RVW:U", option= s, NULL)) !=3D -1) { switch (opt) { case 'D': @@ -2045,6 +2047,9 @@ int main(int argc, char *argv[]) case 'p': priv_domid =3D strtol(optarg, NULL, 10); break; + case 'U': + live_update =3D true; + break; } } if (optind !=3D argc) --=20 2.26.2