On 09/07/21 13:09, Yang Zhong wrote:
+ sgx_epc = g_malloc0(sizeof(*sgx_epc));
+ pcms->sgx_epc = sgx_epc;
+
No need to malloc this, it's small.
}
+##
+# @SgxEPC:
+#
+# Sgx EPC cmdline information
+#
+# @id: device's ID
+#
+# @memdev: memory backend linked with device
+#
+# Since: 6.1
+##
+{ 'struct': 'SgxEPC',
+ 'data': { 'id': [ 'str' ],
+ 'memdev': [ 'str' ]
+ }
+}
Is the "id" needed at all? If not, you can make the property just a
string list.
If not, you should still make the property a list, and SgxEPC can be
just the id/memdev pair.
Also please place the compound property in PCMachineState, not in
MachineState. You can call the field something else than sgx_epc to
avoid conflicts with the SGXEPCState, for example sgx_epc_memdevs or
sgx_epc_backends. Later it can be moved to X86MachineState if needed,
but in any case it should not be in common target-independent code.
Paolo