Hi Eric, > On Dec 20, 2016, at 6:36 AM, Eric Blake <ebl...@redhat.com> wrote: > > On 12/19/2016 04:46 PM, b...@skyportsystems.com > <mailto:b...@skyportsystems.com> wrote: >> From: Igor Mammedov <imamm...@redhat.com> >> >> Add set-vm-generation-id command to set Virtual Machine >> Generation ID counter. >> >> QMP command example: >> { "execute": "set-vm-generation-id", >> "arguments": { >> "changed": true, >> "guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" >> } >> } >> >> HMP command example: >> set-vm-generation-id changed=true >> guid=324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87 >> >> Signed-off-by: Ben Warren <b...@skyportsystems.com> >> Cc: Igor Mammedov <imamm...@redhat.com> >> Cc: Eric Blake <ebl...@redhat.com> >> --- > >> +++ b/qapi-schema.json >> @@ -4796,3 +4796,15 @@ >> # Since 2.9 >> ## >> { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } >> + >> +## >> +# @set-vm-generation-id >> +# >> +# Set Virtual Machine Generation ID >> +# >> +# @changed: Is the Virtual Machine Generation ID a new value? >> +# @guid: new GUID to set as Virtual Machine Generation ID >> +# >> +# Since 2.9 >> +## >> +{ 'command': 'set-vm-generation-id', 'data': { 'changed': 'bool', 'guid': >> 'str' } } > > When should 'changed' ever be set to false? Should it be an optional > parameter, defaulting to true, if it is even needed? > Let me explain the intent, then we can talk about implementation. I apologize if this is stuff you already know. The purpose of VM Generation ID in Windows is to detect time rollbacks. Active Directory in particular can get out of sync in hard-to-debug ways. VM Generation ID is supposed to help with this, in that it tells Windows that a time rollback has occurred and therefore its AD data is “dirty” and must be “pull-synced” from its replication partners. The problem is that this replication can be quite costly in large installations, so I want to only do it if necessary. So the answer to your question is that “changed” will be false most of the time, and will be set to true only in a couple of situations: new VM instantiation and snapshot rollback. It’s up to the managing service (libvirt or custom SW, I guess) to manage the lifecycle of a VM and set this flag accordingly.
Now, the VM Generation ID spec identifies an ACPI Notify operation that is bound to the VM Generation ID ACPI object. I have this GPE only being set if the ‘changed’ variable is true. I don’t know enough about ACPI to know if this is the right approach, and will be doing as much testing within Windows to see if this does what I want, but as I’m sure you know Windows is pretty opaque and it’s not always obvious how to get the relevant information. I have both Hyper-V and Xen setups available and am trying to emulate the Hyper-V one since we should probably consider it to be a reference design. I know Xen just sets this thing blindly and we can do better than that. > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org <http://libvirt.org/> —Ben
smime.p7s
Description: S/MIME cryptographic signature