On 10/20/2014 04:52 AM, Juan Quintela wrote: > "Dr. David Alan Gilbert" <dgilb...@redhat.com> wrote: >> * Juan Quintela (quint...@redhat.com) wrote: >>> This allows us to store the current state to send it through migration. >> >> Why store the runstate as a string? The later code then ends up doing >> string compares and things - why not just use the enum value? > > How do you know that it has the same values both sides? As far as I can > see, all interaction with the outside is done with strings (i.e. QMP).
If it's part of the migration stream, then it is not something visible in QMP, and it is your own fault if you ever change the enum values in such a way that the migration stream is incompatible between versions. I think using an enum in the migration stream is just fine, and more efficient. > > But it is easier for me if I can sent the numeric value. > > Libvirt folks? As far as I can tell, libvirt is unimpacted by HOW it is represented in the migration stream, only that the destination is able to inform libvirt what state was received as part of migration, with libvirt having an easy way to then get back into that state (of course, libvirt should also still have the option to choose a different state than what just got migrated, as in the case where the user pauses the source in order to avoid convergence problems but wants the destination to start running again). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature