From nobody Tue Feb 10 21:19:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1665442224; cv=none; d=zohomail.com; s=zohoarc; b=EH4ezZgFhiIwGhsjx6H/UL2Ie20cdwZJ+nFXSqCgGWsi6qTLiRlPloOzGWREjxj7mLm/7q4zDrC64r1oT2mIhA221eJ+b//6F86rpyGyfzIOdGqfcikgCFWQ1dVXF6KQSDio9Ofm22nTcVUfuFpBLMZbpWl9IjZEyzBXOC9Yoo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665442224; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+JsT0mNct8OZIfo57txTQH7p9G2vY2+a28J5+Ay86x0=; b=FImEZbwJu9EDps7obahWT7DF33wUmrRSI0CxWKMuauNPVieUMD5g8oG8WF6+l+0FB98lE7I179sJZzK2TEkwV1LsJYpE85zXTYUuyr36O8lA7kEs4PTyjrwlK9ZR7aWLH3sJopVaul13Fcp3HXpQctqd7pXtlipjiZ2IQ83qi1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665442224621374.3611762772009; Mon, 10 Oct 2022 15:50:24 -0700 (PDT) Received: from localhost ([::1]:44498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi1bL-00066s-D0 for importer@patchew.org; Mon, 10 Oct 2022 18:50:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi1I7-0005vv-0G for qemu-devel@nongnu.org; Mon, 10 Oct 2022 18:30:31 -0400 Received: from mga02.intel.com ([134.134.136.20]:24675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi1I5-0005Dj-8j for qemu-devel@nongnu.org; Mon, 10 Oct 2022 18:30:30 -0400 Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:30:20 -0700 Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.212.104.4]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:30:19 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665441029; x=1696977029; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/t8uS0dJ6+AOQCZeLPwusIK7WCU31QkWkBGL5ijeEMc=; b=m3kSAEF7FnXop4C+8S+lGEAdqKc4tz7qsWfdQybHQhXgegWGldCDyMtw 0KBRuM113mgc+Lvda8kbKSUwhmisTOPujgqc6sqY3NDR+M82vUlQIxGmd oyeZ9w6xHM0Gh2HAw7otj12QVipKymx8xh5REB5sGHbWys2Y0jgCUAP8M 9xShtZVF+vsN8GrDbrocj/PfEu9TTDo7n+tu8TMEI5xs7jz+1mI1T86EB 5BQwi4OBTgoB6P43YdsdSrvbnsTpNIHkgo2ksh2gUZVvBP0WNnGZ89Awv ZhSb8HsuEVGjVO353/JiHuxSZ3qlP5EA1951pt2JG0FmEcaEtp3TZ0tkP w==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="291661240" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="291661240" X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="628456977" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="628456977" From: ira.weiny@intel.com To: Michael Tsirkin , Ben Widawsky , Jonathan Cameron Cc: Ira Weiny , qemu-devel@nongnu.org, linux-cxl@vger.kernel.org Subject: [RFC PATCH 2/6] qemu/uuid: Add UUID static initializer Date: Mon, 10 Oct 2022 15:29:40 -0700 Message-Id: <20221010222944.3923556-3-ira.weiny@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221010222944.3923556-1-ira.weiny@intel.com> References: <20221010222944.3923556-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.20; envelope-from=ira.weiny@intel.com; helo=mga02.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 10 Oct 2022 18:44:32 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1665442226304100001 Content-Type: text/plain; charset="utf-8" From: Ira Weiny UUID's are defined as network byte order fields. No static initializer was available for UUID's in their standard big endian format. Define a big endian initializer for UUIDs. Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron --- include/qemu/uuid.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 9925febfa54d..dc40ee1fc998 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -61,6 +61,18 @@ typedef struct { (clock_seq_hi_and_reserved), (clock_seq_low), (node0), (node1), (node2= ),\ (node3), (node4), (node5) } =20 +/* Normal (network byte order) UUID */ +#define UUID(time_low, time_mid, time_hi_and_version, \ + clock_seq_hi_and_reserved, clock_seq_low, node0, node1, node2, \ + node3, node4, node5) \ + { ((time_low) >> 24) & 0xff, ((time_low) >> 16) & 0xff, \ + ((time_low) >> 8) & 0xff, (time_low) & 0xff, \ + ((time_mid) >> 8) & 0xff, (time_mid) & 0xff, \ + ((time_hi_and_version) >> 8) & 0xff, (time_hi_and_version) & 0xff, \ + (clock_seq_hi_and_reserved), (clock_seq_low), \ + (node0), (node1), (node2), (node3), (node4), (node5) \ + } + #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-" \ "%02hhx%02hhx-%02hhx%02hhx-" \ "%02hhx%02hhx-" \ --=20 2.37.2