[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] qmp/hmp: add set-vm-generation-id commands
From: |
Ben Warren |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] qmp/hmp: add set-vm-generation-id commands |
Date: |
Tue, 20 Dec 2016 09:23:36 -0800 |
Hi Eric,
> On Dec 20, 2016, at 6:36 AM, Eric Blake <address@hidden> wrote:
>
> On 12/19/2016 04:46 PM, address@hidden <mailto:address@hidden> wrote:
>> From: Igor Mammedov <address@hidden>
>>
>> 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 <address@hidden>
>> Cc: Igor Mammedov <address@hidden>
>> Cc: Eric Blake <address@hidden>
>> ---
>
>> +++ 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
- [Qemu-devel] [PATCH 0/5] RFC: Add support for VM Generation ID, ben, 2016/12/19
- [Qemu-devel] [PATCH 1/5] docs: vm generation id device's description, ben, 2016/12/19
- [Qemu-devel] [PATCH 4/5] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands, ben, 2016/12/19
- [Qemu-devel] [PATCH 5/5] qmp/hmp: add set-vm-generation-id commands, ben, 2016/12/19
- [Qemu-devel] [PATCH 3/5] ACPI: Add Virtual Machine Generation ID support, ben, 2016/12/19
- [Qemu-devel] [PATCH 2/5] ACPI: Add a function for building named qword entries, ben, 2016/12/19
- Re: [Qemu-devel] [PATCH 0/5] RFC: Add support for VM Generation ID, no-reply, 2016/12/20