Currently, only SEV uses it, but it shouldn't hurt either to make the root
class (CONFIDENTIAL_GUEST_SUPPORT) to inherit from TYPE_OBJECT_COMPAT, so
that it'll apply compat properties when object is initialized.  With it,
drop the explicit call.

Cc: David Gibson <[email protected]>
Cc: Michael Roth <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
---
 backends/confidential-guest-support.c | 2 +-
 target/i386/sev.c                     | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/backends/confidential-guest-support.c 
b/backends/confidential-guest-support.c
index 156dd15e66..855788fac0 100644
--- a/backends/confidential-guest-support.c
+++ b/backends/confidential-guest-support.c
@@ -19,7 +19,7 @@
 OBJECT_DEFINE_ABSTRACT_TYPE(ConfidentialGuestSupport,
                             confidential_guest_support,
                             CONFIDENTIAL_GUEST_SUPPORT,
-                            OBJECT)
+                            OBJECT_COMPAT)
 
 static bool check_support(ConfidentialGuestPlatformType platform,
                          uint16_t platform_version, uint8_t highest_vtl,
diff --git a/target/i386/sev.c b/target/i386/sev.c
index fd2dada013..084264bc88 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -2865,7 +2865,6 @@ sev_guest_instance_init(Object *obj)
                                    OBJ_PROP_FLAG_READWRITE);
     object_property_add_uint32_ptr(obj, "policy", &sev_guest->policy,
                                    OBJ_PROP_FLAG_READWRITE);
-    object_apply_compat_props(obj);
 
     sev_guest->legacy_vm_type = ON_OFF_AUTO_AUTO;
 }
-- 
2.50.1


Reply via email to