On 2/12/18 11:27 AM, Eric Blake wrote: > On 02/12/2018 09:37 AM, Brijesh Singh wrote: >> The QMP query command can used to retrieve the SEV information when >> memory encryption is enabled on AMD platform. >> >> Cc: "Daniel P. Berrangé" <berrange@xxxxxxxxxx> >> Cc: "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx> >> Cc: Markus Armbruster <armbru@xxxxxxxxxx> >> Signed-off-by: Brijesh Singh <brijesh.singh@xxxxxxx> >> --- > >> +# @SevInfo: >> +# >> +# Information about Secure Encrypted Virtualization (SEV) support >> +# >> +# @enabled: true if SEV is active >> +# >> +# @api-major: SEV API major version >> +# >> +# @api-minor: SEV API minor version >> +# >> +# @build-id: SEV FW build id >> +# >> +# @policy: SEV policy value >> +# >> +# @state: SEV guest state > > Is there a finite list of guest states? > Yes, the list is finite. include/sysemu/sev.h defines the enum typedef enum { SEV_STATE_UNINIT = 0, SEV_STATE_LUPDATE, SEV_STATE_SECRET, SEV_STATE_RUNNING, SEV_STATE_SUPDATE, SEV_STATE_RUPDATE, SEV_STATE_MAX } >> +# >> +# Since: 2.12 >> +## >> +{ 'struct': 'SevInfo', >> + 'data': { 'enabled': 'bool', >> + 'api-major': 'uint8', >> + 'api-minor' : 'uint8', >> + 'build-id' : 'uint8', >> + 'policy' : 'uint32', >> + 'state' : 'str' > > If so, this should be an enum type listing those possible states, > rather than an open-coded 'str' that can hold anything. > If the preference is to return enum, then I can convert the state to return enum instead of string.