qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style
@ 2025-05-16  9:11 Zhao Liu
  2025-05-16  9:11 ` [PATCH 1/2] qapi/misc-target: Rename SGXEPCSection to SgxEpcSection Zhao Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhao Liu @ 2025-05-16  9:11 UTC (permalink / raw)
  To: Markus Armbruster, Eric Blake, Paolo Bonzini; +Cc: qemu-devel, Zhao Liu

QAPI requires strict PascalCase naming style, i.e., only the first
letter of a single word is allowed to be uppercase, which could help
with readability.

Rename SGXEPCSection & SGXInfo to SgxEpcSection & SgxInfo.

Thanks and Best Regards,
Zhao
---
Zhao Liu (2):
  qapi/misc-target: Rename SGXEPCSection to SgxEpcSection
  qapi/misc-target: Rename SGXInfo to SgxInfo

 hw/i386/sgx-stub.c    |  4 ++--
 hw/i386/sgx.c         | 32 ++++++++++++++++----------------
 qapi/misc-target.json | 18 +++++++++---------
 3 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] qapi/misc-target: Rename SGXEPCSection to SgxEpcSection
  2025-05-16  9:11 [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Zhao Liu
@ 2025-05-16  9:11 ` Zhao Liu
  2025-05-16  9:11 ` [PATCH 2/2] qapi/misc-target: Rename SGXInfo to SgxInfo Zhao Liu
  2025-05-17 14:29 ` [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Zhao Liu @ 2025-05-16  9:11 UTC (permalink / raw)
  To: Markus Armbruster, Eric Blake, Paolo Bonzini; +Cc: qemu-devel, Zhao Liu

QAPI requires strict PascalCase naming style, i.e., only the first
letter of a single word is allowed to be uppercase, which could help
with readability.

Rename SGXEPCSection to SgxEpcSection.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/i386/sgx.c         | 18 +++++++++---------
 qapi/misc-target.json |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index 5685c4fb802d..3c601689eb72 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -84,10 +84,10 @@ static uint64_t sgx_calc_section_metric(uint64_t low, uint64_t high)
            ((high & MAKE_64BIT_MASK(0, 20)) << 32);
 }
 
-static SGXEPCSectionList *sgx_calc_host_epc_sections(void)
+static SgxEpcSectionList *sgx_calc_host_epc_sections(void)
 {
-    SGXEPCSectionList *head = NULL, **tail = &head;
-    SGXEPCSection *section;
+    SgxEpcSectionList *head = NULL, **tail = &head;
+    SgxEpcSection *section;
     uint32_t i, type;
     uint32_t eax, ebx, ecx, edx;
     uint32_t j = 0;
@@ -104,7 +104,7 @@ static SGXEPCSectionList *sgx_calc_host_epc_sections(void)
             break;
         }
 
-        section = g_new0(SGXEPCSection, 1);
+        section = g_new0(SgxEpcSection, 1);
         section->node = j++;
         section->size = sgx_calc_section_metric(ecx, edx);
         QAPI_LIST_APPEND(tail, section);
@@ -183,17 +183,17 @@ SGXInfo *qmp_query_sgx_capabilities(Error **errp)
     return info;
 }
 
-static SGXEPCSectionList *sgx_get_epc_sections_list(void)
+static SgxEpcSectionList *sgx_get_epc_sections_list(void)
 {
     GSList *device_list = sgx_epc_get_device_list();
-    SGXEPCSectionList *head = NULL, **tail = &head;
-    SGXEPCSection *section;
+    SgxEpcSectionList *head = NULL, **tail = &head;
+    SgxEpcSection *section;
 
     for (; device_list; device_list = device_list->next) {
         DeviceState *dev = device_list->data;
         Object *obj = OBJECT(dev);
 
-        section = g_new0(SGXEPCSection, 1);
+        section = g_new0(SgxEpcSection, 1);
         section->node = object_property_get_uint(obj, SGX_EPC_NUMA_NODE_PROP,
                                                  &error_abort);
         section->size = object_property_get_uint(obj, SGX_EPC_SIZE_PROP,
@@ -237,7 +237,7 @@ SGXInfo *qmp_query_sgx(Error **errp)
 void hmp_info_sgx(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
-    SGXEPCSectionList *section_list, *section;
+    SgxEpcSectionList *section_list, *section;
     g_autoptr(SGXInfo) info = qmp_query_sgx(&err);
     uint64_t size = 0;
 
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index 42e4a7417dc6..a1275d3873ab 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -319,7 +319,7 @@
   'if': 'TARGET_ARM' }
 
 ##
-# @SGXEPCSection:
+# @SgxEpcSection:
 #
 # Information about intel SGX EPC section info
 #
@@ -329,7 +329,7 @@
 #
 # Since: 7.0
 ##
-{ 'struct': 'SGXEPCSection',
+{ 'struct': 'SgxEpcSection',
   'data': { 'node': 'int',
             'size': 'uint64'}}
 
@@ -355,7 +355,7 @@
             'sgx1': 'bool',
             'sgx2': 'bool',
             'flc': 'bool',
-            'sections': ['SGXEPCSection']},
+            'sections': ['SgxEpcSection']},
    'if': 'TARGET_I386' }
 
 ##
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] qapi/misc-target: Rename SGXInfo to SgxInfo
  2025-05-16  9:11 [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Zhao Liu
  2025-05-16  9:11 ` [PATCH 1/2] qapi/misc-target: Rename SGXEPCSection to SgxEpcSection Zhao Liu
@ 2025-05-16  9:11 ` Zhao Liu
  2025-05-17 14:29 ` [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Zhao Liu @ 2025-05-16  9:11 UTC (permalink / raw)
  To: Markus Armbruster, Eric Blake, Paolo Bonzini; +Cc: qemu-devel, Zhao Liu

QAPI requires strict PascalCase naming style, i.e., only the first
letter of a single word is allowed to be uppercase, which could help
with readability.

Rename SGXInfo to SgxInfo.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/i386/sgx-stub.c    |  4 ++--
 hw/i386/sgx.c         | 14 +++++++-------
 qapi/misc-target.json | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
index 38ff75e9f377..ccb21a975d76 100644
--- a/hw/i386/sgx-stub.c
+++ b/hw/i386/sgx-stub.c
@@ -10,13 +10,13 @@ void sgx_epc_build_srat(GArray *table_data)
 {
 }
 
-SGXInfo *qmp_query_sgx(Error **errp)
+SgxInfo *qmp_query_sgx(Error **errp)
 {
     error_setg(errp, "SGX support is not compiled in");
     return NULL;
 }
 
-SGXInfo *qmp_query_sgx_capabilities(Error **errp)
+SgxInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     error_setg(errp, "SGX support is not compiled in");
     return NULL;
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index 3c601689eb72..c80203b438ec 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -153,9 +153,9 @@ static void sgx_epc_reset(void *opaque)
      }
 }
 
-SGXInfo *qmp_query_sgx_capabilities(Error **errp)
+SgxInfo *qmp_query_sgx_capabilities(Error **errp)
 {
-    SGXInfo *info = NULL;
+    SgxInfo *info = NULL;
     uint32_t eax, ebx, ecx, edx;
     Error *local_err = NULL;
 
@@ -166,7 +166,7 @@ SGXInfo *qmp_query_sgx_capabilities(Error **errp)
         return NULL;
     }
 
-    info = g_new0(SGXInfo, 1);
+    info = g_new0(SgxInfo, 1);
     host_cpuid(0x7, 0, &eax, &ebx, &ecx, &edx);
 
     info->sgx = ebx & (1U << 2) ? true : false;
@@ -205,9 +205,9 @@ static SgxEpcSectionList *sgx_get_epc_sections_list(void)
     return head;
 }
 
-SGXInfo *qmp_query_sgx(Error **errp)
+SgxInfo *qmp_query_sgx(Error **errp)
 {
-    SGXInfo *info = NULL;
+    SgxInfo *info = NULL;
     X86MachineState *x86ms;
     PCMachineState *pcms =
         (PCMachineState *)object_dynamic_cast(qdev_get_machine(),
@@ -223,7 +223,7 @@ SGXInfo *qmp_query_sgx(Error **errp)
         return NULL;
     }
 
-    info = g_new0(SGXInfo, 1);
+    info = g_new0(SgxInfo, 1);
 
     info->sgx = true;
     info->sgx1 = true;
@@ -238,7 +238,7 @@ void hmp_info_sgx(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
     SgxEpcSectionList *section_list, *section;
-    g_autoptr(SGXInfo) info = qmp_query_sgx(&err);
+    g_autoptr(SgxInfo) info = qmp_query_sgx(&err);
     uint64_t size = 0;
 
     if (err) {
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index a1275d3873ab..6b3c9d8bd589 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -334,7 +334,7 @@
             'size': 'uint64'}}
 
 ##
-# @SGXInfo:
+# @SgxInfo:
 #
 # Information about intel Safe Guard eXtension (SGX) support
 #
@@ -350,7 +350,7 @@
 #
 # Since: 6.2
 ##
-{ 'struct': 'SGXInfo',
+{ 'struct': 'SgxInfo',
   'data': { 'sgx': 'bool',
             'sgx1': 'bool',
             'sgx2': 'bool',
@@ -363,7 +363,7 @@
 #
 # Returns information about SGX
 #
-# Returns: @SGXInfo
+# Returns: @SgxInfo
 #
 # Since: 6.2
 #
@@ -375,14 +375,14 @@
 #                      "sections": [{"node": 0, "size": 67108864},
 #                      {"node": 1, "size": 29360128}]} }
 ##
-{ 'command': 'query-sgx', 'returns': 'SGXInfo', 'if': 'TARGET_I386' }
+{ 'command': 'query-sgx', 'returns': 'SgxInfo', 'if': 'TARGET_I386' }
 
 ##
 # @query-sgx-capabilities:
 #
 # Returns information from host SGX capabilities
 #
-# Returns: @SGXInfo
+# Returns: @SgxInfo
 #
 # Since: 6.2
 #
@@ -394,7 +394,7 @@
 #                      "section" : [{"node": 0, "size": 67108864},
 #                      {"node": 1, "size": 29360128}]} }
 ##
-{ 'command': 'query-sgx-capabilities', 'returns': 'SGXInfo', 'if': 'TARGET_I386' }
+{ 'command': 'query-sgx-capabilities', 'returns': 'SgxInfo', 'if': 'TARGET_I386' }
 
 
 ##
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style
  2025-05-16  9:11 [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Zhao Liu
  2025-05-16  9:11 ` [PATCH 1/2] qapi/misc-target: Rename SGXEPCSection to SgxEpcSection Zhao Liu
  2025-05-16  9:11 ` [PATCH 2/2] qapi/misc-target: Rename SGXInfo to SgxInfo Zhao Liu
@ 2025-05-17 14:29 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2025-05-17 14:29 UTC (permalink / raw)
  To: Zhao Liu; +Cc: Markus Armbruster, Eric Blake, qemu-devel

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-17 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16  9:11 [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Zhao Liu
2025-05-16  9:11 ` [PATCH 1/2] qapi/misc-target: Rename SGXEPCSection to SgxEpcSection Zhao Liu
2025-05-16  9:11 ` [PATCH 2/2] qapi/misc-target: Rename SGXInfo to SgxInfo Zhao Liu
2025-05-17 14:29 ` [PATCH 0/2] qapi/misc-target: Rename SGX related items to follow QAPI naming style Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).