From nobody Mon Feb 9 22:39:17 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=1610638723; cv=none; d=zohomail.com; s=zohoarc; b=GNrRnEOQMuJ+Umm1vtwhi0FTwW3xnvVEgAWGlT+sh1XPgFCFlrhE8CdT1L765/Udmv30BcO7EbyxQN3GGdflTPAcdO5xnhP6+3+WlSpxoFH5yJYtOjZMzGAr1YH/oQrMH/M6K6P1AYZEGLz6jfjCplGS46/oEDZiwGzbjbmmYUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610638723; 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=LDcljI6URLMGWNIYgpPD7jtPIziHHvw+GHhSqPWF8QHirZCUmoDLQdDyo174T4OtnPQQkVXg2spJmbFlrgQn7cv7PphewcxgjlrofCVQquXP5CBfEGDSapKhD8Inmmp9oalEbBK6DVqM42LoUmcn1PlqM5tXohD/tS4jJNePubI= 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 1610638723570147.58071160696488; Thu, 14 Jan 2021 07:38:43 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.67209.119817 (Exim 4.92) (envelope-from ) id 1l04hj-00030g-Bu; Thu, 14 Jan 2021 15:38:31 +0000 Received: by outflank-mailman (output) from mailman id 67209.119817; Thu, 14 Jan 2021 15:38:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l04hj-00030R-3m; Thu, 14 Jan 2021 15:38:31 +0000 Received: by outflank-mailman (input) for mailman id 67209; Thu, 14 Jan 2021 15:38:29 +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.92) (envelope-from ) id 1l04hh-0002Sh-J0 for xen-devel@lists.xenproject.org; Thu, 14 Jan 2021 15:38:29 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ada90ed4-6fa4-410c-8edf-1b6a54c872b3; Thu, 14 Jan 2021 15:38:10 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1024DAF13; Thu, 14 Jan 2021 15:38: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: ada90ed4-6fa4-410c-8edf-1b6a54c872b3 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=1610638689; 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=N1xAQkx/RFrfnU4I0qMxcASLYpepg/we8dUn01dSCrxM2yL2jtzcpnHoHlJ48YY5FTw1Mk gv1/RRq3B+bTcwUgOHpRVEs3Pysy28b1uv//ixjidmVyZvSYNBCRtyZuqgvmw0Rnu59EL6 /EAOXH/sr3DcsAx8Op1CPzgOj6w3/rk= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Julien Grall , Paul Durrant Subject: [PATCH v11 11/27] tools/xenstore: add command line handling for live update Date: Thu, 14 Jan 2021 16:37:47 +0100 Message-Id: <20210114153803.2591-12-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210114153803.2591-1-jgross@suse.com> References: <20210114153803.2591-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