All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: allow clearing migration string parameters
Date: Fri, 03 Mar 2017 18:05:15 +0100	[thread overview]
Message-ID: <874lzanvec.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170303161857.GC13631@redhat.com> (Daniel P. Berrange's message of "Fri, 3 Mar 2017 16:18:57 +0000")

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Fri, Mar 03, 2017 at 03:44:12PM +0100, Markus Armbruster wrote:
>> "Daniel P. Berrange" <berrange@redhat.com> writes:
>> 
>> > On Wed, Mar 01, 2017 at 08:36:03AM -0600, Eric Blake wrote:
>> >> On 03/01/2017 06:32 AM, Daniel P. Berrange wrote:
>> >> >      }
>> >> >      if (params->has_tls_creds) {
>> >> >          g_free(s->parameters.tls_creds);
>> >> > -        s->parameters.tls_creds = g_strdup(params->tls_creds);
>> >> > +        if (*params->tls_creds == '\0') {
>> >> > +            s->parameters.tls_creds = NULL;
>> >> 
>> >> I'm wondering if you should also do s->parameters.has_tls_creds = false
>> >> at this point?  The visitors expect that if has_tls_creds is true, then
>> >> the string is non-NULL.
>> >
>> > The fact that s->parameters contains has_* fields is completely ignored
>> > by the migration code afaict. IOW the code behaves as if all the has_*
>> > fields are hardwired to true in s->parameters, even though that is not
>> > the case :-) The has_* fields are only used when the various migration
>> > QMP methods are executed, and those all use a separate MigrationParameters
>> > struct instance.
>> 
>> Not keeping the has_ members up-to-date is harmless as long as you don't
>> pass the thing to visitors, including the one hiding in qapi_free_FOO().
>> That one ignores scalars, though.
>> 
>> 
>> From a more abstract point of view, we have two related data types: one
>> for the state, and one for state changes requests.
>> 
>> In state, members are always present.
>> 
>> A state change request is a bag of state member change requests, and
>> each request can either specify the new value or ask for a reset to
>> default.  Absent member means no change.
>> 
>> We press the same QAPI type into service for both by making all members
>> optional.
>> 
>> For the state case, we hardwire the has_ to true.  Or even ignore them
>> completely.
>> 
>> For the state change request, we use has_ = false for "no change", has_
>> = true with a special value for "reset to default" (new in this patch)
>> and has_ = true with a non-special value for "set to this value".
>> 
>> Requires a special value outside the set of non-special values.  The
>> obvious one is JSON null, but the QAPI generator doesn't quite support
>> that, yet.  "" works here, but is not general.
>> 
>> I think I can get you null support in 2.10.  Would that work for you?
>
> Not really - we need this fix so libvirt can enable TLS migration,
> in addition we'll be wanting to add it to stable branches upstream
> and downstream.

Alternatives:

(a) We support null in 2.9, and use it to solve this problem.

(b) We use "", support null in 2.10, immediately deprecate "" in favor
    of null.

PRO (a): Less churn, less variation, less overall work.

PRO (b): Might be easier to backport to really old versions.  Soft
freeze.

Non-alternative: use "" forever.  Sorry, I hate it.

  reply	other threads:[~2017-03-03 17:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 12:32 [Qemu-devel] [PATCH] migration: allow clearing migration string parameters Daniel P. Berrange
2017-03-01 12:39 ` no-reply
2017-03-01 12:40 ` no-reply
2017-03-01 14:36 ` Eric Blake
2017-03-01 14:48   ` Daniel P. Berrange
2017-03-01 15:36     ` Eric Blake
2017-03-02  7:55     ` Markus Armbruster
2017-03-02 12:33   ` Daniel P. Berrange
2017-03-03 14:44     ` Markus Armbruster
2017-03-03 16:18       ` Daniel P. Berrange
2017-03-03 17:05         ` Markus Armbruster [this message]
2017-03-03 17:08           ` Daniel P. Berrange
2017-03-14 18:49       ` Dr. David Alan Gilbert
2017-03-15  6:26         ` Markus Armbruster
2017-03-15  9:32           ` Dr. David Alan Gilbert
2017-03-15 10:30             ` Markus Armbruster
2017-03-15 10:36               ` Dr. David Alan Gilbert
2017-03-15 10:49                 ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lzanvec.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.