From nobody Thu Oct 30 23:13:07 2025 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=1753449601; cv=none; d=zohomail.com; s=zohoarc; b=HdNB/vKm+mSRk+dWdY/oQe6iincfCdaJEUkYUU3Wvo/WX/sLvfK2bbLYukY4uPh0rLOyWbD+x3cvPuWzE00GtMCgL5cXyj2ESWHHlRk4Fw8gyrWt6IFRDRHQ9iSRahxE/gXcNVOX751eb5LEnkSjuNkL70CXvuMcb6AangAWAo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753449601; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yb7PraGRfp4jOfNUeV5ucZ1QqsNlsA8+/YfJexfVTTw=; b=ZMGOgbgE1/oeCyQwOlxgaCI8hzasQUUHgYBggrBIPxmo6rlTSJ2xUZqACOxh4Gc/ojwi8/5XPHkRE0hpRN2BWR/Gtf9U0vdtegor+6+qNNRVd4DHiNwwzmJy1FyzliLD6vxF7kn+fLEgEhxaOaKb0l3veuujN4ls7hmO8v81rAI= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1753449601219465.79196477182325; Fri, 25 Jul 2025 06:20:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1057794.1425511 (Exim 4.92) (envelope-from ) id 1ufIL0-0007Uv-Es; Fri, 25 Jul 2025 13:19:50 +0000 Received: by outflank-mailman (output) from mailman id 1057794.1425511; Fri, 25 Jul 2025 13:19:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ufIL0-0007Uk-C6; Fri, 25 Jul 2025 13:19:50 +0000 Received: by outflank-mailman (input) for mailman id 1057794; Fri, 25 Jul 2025 13:19:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ufIKz-0007Aq-RK for xen-devel@lists.xenproject.org; Fri, 25 Jul 2025 13:19:49 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 09d9fe66-695a-11f0-b895-0df219b8e170; Fri, 25 Jul 2025 15:19:48 +0200 (CEST) Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F3F232128E; Fri, 25 Jul 2025 13:19:47 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BF2C6134E8; Fri, 25 Jul 2025 13:19:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id W2URLXOEg2jfPAAAD6G6ig (envelope-from ); Fri, 25 Jul 2025 13:19:47 +0000 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: 09d9fe66-695a-11f0-b895-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1753449588; 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=yb7PraGRfp4jOfNUeV5ucZ1QqsNlsA8+/YfJexfVTTw=; b=gi6fg0Gcvd/rKw5jdaGGmJTR7cBBEFuVTV7iJP5SuRA+tiBLJ9Tqca55JiVLc/1R9kWgS+ le/Fwjszc6V+Z+njDdHkuqUN29AAPCKTC0RHI443BnN+7qmBYdMimKbTpR4YGjpyFEun7L CwfS1+w359YaJTf/So+T3HVGElaGNz4= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1753449588; 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=yb7PraGRfp4jOfNUeV5ucZ1QqsNlsA8+/YfJexfVTTw=; b=gi6fg0Gcvd/rKw5jdaGGmJTR7cBBEFuVTV7iJP5SuRA+tiBLJ9Tqca55JiVLc/1R9kWgS+ le/Fwjszc6V+Z+njDdHkuqUN29AAPCKTC0RHI443BnN+7qmBYdMimKbTpR4YGjpyFEun7L CwfS1+w359YaJTf/So+T3HVGElaGNz4= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Julien Grall , Anthony PERARD , Jason Andryuk Subject: [PATCH v2 3/7] tools/xenstored: add missing migration record definitions Date: Fri, 25 Jul 2025 15:19:24 +0200 Message-ID: <20250725131928.19286-4-jgross@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250725131928.19286-1-jgross@suse.com> References: <20250725131928.19286-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Score: -2.80 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1753449603539116600 Content-Type: text/plain; charset="utf-8" Add all the missing migration record structures and defines to the xenstore_state.h header file. Update the version of the migration stream to "2". In order to allow receiving version 1 streams, change the version check of the header to reject only streams with a version higher than the current known one. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- tools/xenstored/control.c | 2 +- tools/xenstored/lu.c | 2 +- tools/xenstored/xenstore_state.h | 31 ++++++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/tools/xenstored/control.c b/tools/xenstored/control.c index 953c01b735..2611a6fade 100644 --- a/tools/xenstored/control.c +++ b/tools/xenstored/control.c @@ -298,7 +298,7 @@ static struct cmd_s cmds[] =3D { */ { "live-update", do_control_lu, "[-c ] [-F] [-t ] [-v ] \n" - " Default timeout is 60 seconds, default version is 1.", 7 }, + " Default timeout is 60 seconds, default version is 2.", 7 }, #endif { "logfile", do_control_logfile, "" }, { "memreport", do_control_memreport, "[]" }, diff --git a/tools/xenstored/lu.c b/tools/xenstored/lu.c index 330820a8a2..2c6adecb56 100644 --- a/tools/xenstored/lu.c +++ b/tools/xenstored/lu.c @@ -136,7 +136,7 @@ void lu_read_state(void) =20 pre =3D state.buf; if (memcmp(pre->ident, XS_STATE_IDENT, sizeof(pre->ident)) || - pre->version !=3D htobe32(XS_STATE_VERSION) || + !pre->version || be32toh(pre->version) > XS_STATE_VERSION || pre->flags !=3D XS_STATE_FLAGS) barf("Unknown record identifier"); for (head =3D state.buf + sizeof(*pre); diff --git a/tools/xenstored/xenstore_state.h b/tools/xenstored/xenstore_st= ate.h index bad966caf4..3fd97d60d8 100644 --- a/tools/xenstored/xenstore_state.h +++ b/tools/xenstored/xenstore_state.h @@ -27,8 +27,10 @@ #ifndef htobe32 #if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN #define htobe32(x) __builtin_bswap32(x) +#define be32toh(x) __builtin_bswap32(x) #else #define htobe32(x) (x) +#define be32toh(x) (x) #endif #endif =20 @@ -36,7 +38,7 @@ struct xs_state_preamble { char ident[8]; #define XS_STATE_IDENT "xenstore" /* To be used without the NUL byte. = */ uint32_t version; /* Version in big endian format. */ -#define XS_STATE_VERSION 0x00000001 +#define XS_STATE_VERSION 0x00000002 uint32_t flags; /* Endianess. */ #if __BYTE_ORDER =3D=3D __LITTLE_ENDIAN #define XS_STATE_FLAGS 0x00000000 /* Little endian. */ @@ -59,6 +61,9 @@ struct xs_state_record_header { #define XS_STATE_TYPE_WATCH 0x00000003 #define XS_STATE_TYPE_TA 0x00000004 #define XS_STATE_TYPE_NODE 0x00000005 +#define XS_STATE_TYPE_GLB_QUOTA 0x00000006 +#define XS_STATE_TYPE_DOMAIN 0x00000007 +#define XS_STATE_TYPE_WATCH_EXT 0x00000008 uint32_t length; /* Length of record in bytes. */ }; =20 @@ -98,6 +103,15 @@ struct xs_state_watch { uint8_t data[]; /* Path bytes, token bytes, 0-7 pad bytes. */ }; =20 +struct xs_state_watch_ext { + uint32_t conn_id; /* Connection this watch is associated with. */ + uint16_t path_length; /* Number of bytes of path watched (incl. 0). = */ + uint16_t token_length; /* Number of bytes of watch token (incl. 0). */ + uint16_t depth; /* Number of directory levels below watched pa= th */ + /* to consider for a match. */ + uint8_t data[]; /* Path bytes, token bytes, 0-7 pad bytes. */ +}; + /* Transaction: */ struct xs_state_transaction { uint32_t conn_id; /* Connection this TA is associated with. */ @@ -129,4 +143,19 @@ struct xs_state_node { struct xs_state_node_perm perms[]; /* Path and data follows, plus 0-7 pad bytes. */ }; + +/* Global quota data: */ +struct xs_state_glb_quota { + uint16_t n_dom_quota; /* Number of quota values applying to domains.= */ + uint16_t n_glob_quota; /* Number of quota values applying globally on= ly. */ + uint32_t quota_val[]; /* Array of quota values (domain ones first). = */ +}; + +/* Domain data: */ +struct xs_state_domain { + uint16_t domain_id; /* Domain-id identifying the domain. */ + uint16_t n_quota; /* Number of quota values. */ + uint32_t features; /* Server features available to the domain. */ + uint32_t quota_val[]; /* Array of quota values. */ +}; #endif /* XENSTORE_STATE_H */ --=20 2.43.0