[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 2/3] tools/xenstored: use unique_id to identify new domain with same domid


  • To: Juergen Gross <jgross@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Fri, 14 Mar 2025 08:58:09 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xFOLi0UTvjw25NFi2GoIi3wrylRvqqhM+2dOk51oVZs=; b=M0rSPzfOBl24+OwlcKgHxVA+uCPOTyIHmcLg9pY98hK3sqm06cOB46dhFIyC+XNZCQBqwIwZcFN7FD0FgoAGhOOz3X3BgNK0/isHRMJzeCJ4Q8JqeIPj+eYZ81J7whOfbY0xOt4QA6ITVWi2oZgPXJRr/t8Apy2gjE7b7Gc6w3dO1vVwMWOYLe1mAS1baLzzPZ+5o0RU7pQ6Rwdzjc6c4wew5hQRICwPDOUXCQ3h++TdwqAF3Dqx2P2lBHrIhQ9xXMNoyRhxHJr3lx1ib3FC6x6vQMwLMdKsmUv44p8WFB96oXp5xZpa7X+A03x77Uf9PP1z59apyrjviJck0uDdKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hU/qvvMCzouYqW1AXYVih1Kc+xlxEct5WCo+ZGbVAWtAX5QqbGDooX4OlAWOFDyBHsf5q4LWL6lWgy1Z8uSX1HZcL2+ngW/UHcrA+FUM+xLAIOCxO44dT7LA1hdpoNgvPLptJI/6GNWjLAS5/2nyRbOLCFO5qnPaMlC1sXCAd+b8phUKaT1ds3MWjH+nXlHBwgAtoK8nX33LiL9xP7qxWQoVjChNrV9PWByznzr2xQsv1o0yuOyDVTT56E8zaxmTLpU78/TfHb3l8e6sD2b30rqhXKQQ3hKtaH8mQBfnZZndcacODt8okUnMjEnLN/mN0uCRZUpEDgmMagXpvIXC5g==
  • Cc: Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 14 Mar 2025 12:58:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-03-14 08:18, Juergen Gross wrote:
Use the new unique_id of a domain in order to detect that a domain
has been replaced with another one reusing the doamin-id of the old
domain.

While changing the related code, switch from "dom_invalid" to
"dom_valid" in order to avoid double negation and use "bool" as type
for it.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V8:
- new patch
V9:
- adapt to different LU-record layout
- "dom_invalid" -> "dom_valid" (Jason Andryuk)

Thanks.

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

One thought below.

---
  tools/xenstored/domain.c         | 65 ++++++++++++++++++++++++++------
  tools/xenstored/xenstore_state.h |  3 +-
  2 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index a6506a5bb2..fc0992d3a5 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c

@@ -1778,6 +1811,14 @@ void read_state_connection(const void *ctx, const void 
*state)
        conn->conn_id = sc->conn_id;
read_state_buffered_data(ctx, conn, sc);
+
+       /* Validity of unique_id will be tested by check_domains() later. */
+       if ((sc->fields & XS_STATE_CONN_FIELDS_UNIQ_ID) && domain) {

Is it worth adding a sanity check for the other bits in sc->fields == 0? And a check domain != NULL when XS_STATE_CONN_FIELDS_UNIQ_ID is set?

Regards,
Jason

+               unsigned long off;
+
+               off = sizeof(*sc) + sc->data_in_len + sc->data_out_len;
+               domain->unique_id = *(uint64_t *)(state + ROUNDUP(off, 3));
+       }
  }



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.