From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 7AE485A026D for ; Wed, 5 Apr 2023 13:58:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680695918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dOcwezSzI60r/hIWzM2KlLuYsiTRxW0rM1XkeZ6nn1M=; b=BPiEPX9kawgTpPwyBSW1NbzUFd+Cr9MsUUltqTnyNgT0M3yS9a5LLAH6cgAxvwd+Po4xIQ LBJif7kfBTwe3G3Dpzzo0D83vSWhIlGEYuNbWAx3CicDorg2R8rMzht9V1qn4nK+osUo0d cE2DHaL8ILrevAo4aFc+D1SeLP2zmrs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-M_8DE5pbNUKFThcV16pcnA-1; Wed, 05 Apr 2023 07:58:37 -0400 X-MC-Unique: M_8DE5pbNUKFThcV16pcnA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB7D18996F7; Wed, 5 Apr 2023 11:58:36 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B88E40C6EC4; Wed, 5 Apr 2023 11:58:35 +0000 (UTC) Date: Wed, 5 Apr 2023 13:58:34 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 07/14] nstool: Add magic number to advertized information Message-ID: <20230405135834.0031231a@elisabeth> In-Reply-To: <20230404014638.3225556-8-david@gibson.dropbear.id.au> References: <20230404014638.3225556-1-david@gibson.dropbear.id.au> <20230404014638.3225556-8-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4I6VRLKJ4PAZN6ET4ZRJTR2VFVVRMTU3 X-Message-ID-Hash: 4I6VRLKJ4PAZN6ET4ZRJTR2VFVVRMTU3 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 4 Apr 2023 11:46:31 +1000 David Gibson wrote: > So that we'll probably give a better error if you point it at something > that's not an nstool hold control socket. > > Signed-off-by: David Gibson > --- > test/nstool.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/test/nstool.c b/test/nstool.c > index 428c9c4..e995f3e 100644 > --- a/test/nstool.c > +++ b/test/nstool.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -45,7 +46,10 @@ const struct ns_type nstypes[] = { > { CLONE_NEWUTS, "uts" }, > }; > > +#define NSTOOL_MAGIC 0x75601d75 > + > struct holder_info { > + uint64_t magic; Is uint64_t with just 32 bits "set" a trick to detect endianness problems (perhaps it's a common pattern I'm not aware of)? -- Stefano