All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Peter Xu <peterx@redhat.com>
Cc: kvm@vger.kernel.org, mst@redhat.com, mtosatti@redhat.com,
	Xiao Guangrong <xiaoguangrong@tencent.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	quintela@redhat.com, wei.w.wang@intel.com, cota@braap.org,
	guangrong.xiao@gmail.com, pbonzini@redhat.com
Subject: Re: [PATCH v2 2/3] migration: fix memory leak when updating tls-creds and tls-hostname
Date: Tue, 15 Jan 2019 10:03:53 -0600	[thread overview]
Message-ID: <2caebc3a-ccd0-d8c6-0368-4f339f326cdf@redhat.com> (raw)
In-Reply-To: <20190115102404.GA2135@work-vm>

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On 1/15/19 4:24 AM, Dr. David Alan Gilbert wrote:

> I think the problem is that
> migrate_params_check checks a MigrationParameters
> 
> while the QMP command gives us a MigrateSetParameters; but we also use
> migrate_params_check for the global check you added (8b0b29dc) which is
> against migrationParameters; so that's why migrate_params_check takes
> a MigrationParameters.
> 
> It's horrible we've got stuff duped so much.

Indeed.

> 
> However, I don't like this fix because if someone later was to add
> a test for tls parameters to migrate_params_check, then they would be
> confused why the hostname/creds weren't checked.
> So while we have migrate_params_test_apply, it should cover all
> parameters.
> 
> I think a cleaner check would be to write a MigrateParameters_free
> that free'd any strings, and call that in qmp_migrate_set_parameters
> on both exit paths.

We already have it; it's named qapi_free_MigrationParameters(),
generated in qapi-types-migration.h.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Peter Xu <peterx@redhat.com>
Cc: guangrong.xiao@gmail.com, pbonzini@redhat.com, mst@redhat.com,
	mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org,
	wei.w.wang@intel.com, quintela@redhat.com, cota@braap.org,
	Xiao Guangrong <xiaoguangrong@tencent.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] migration: fix memory leak when updating tls-creds and tls-hostname
Date: Tue, 15 Jan 2019 10:03:53 -0600	[thread overview]
Message-ID: <2caebc3a-ccd0-d8c6-0368-4f339f326cdf@redhat.com> (raw)
In-Reply-To: <20190115102404.GA2135@work-vm>

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

On 1/15/19 4:24 AM, Dr. David Alan Gilbert wrote:

> I think the problem is that
> migrate_params_check checks a MigrationParameters
> 
> while the QMP command gives us a MigrateSetParameters; but we also use
> migrate_params_check for the global check you added (8b0b29dc) which is
> against migrationParameters; so that's why migrate_params_check takes
> a MigrationParameters.
> 
> It's horrible we've got stuff duped so much.

Indeed.

> 
> However, I don't like this fix because if someone later was to add
> a test for tls parameters to migrate_params_check, then they would be
> confused why the hostname/creds weren't checked.
> So while we have migrate_params_test_apply, it should cover all
> parameters.
> 
> I think a cleaner check would be to write a MigrateParameters_free
> that free'd any strings, and call that in qmp_migrate_set_parameters
> on both exit paths.

We already have it; it's named qapi_free_MigrationParameters(),
generated in qapi-types-migration.h.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-01-15 16:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  6:37 [PATCH v2 0/3] optimize waiting for free thread to do compression guangrong.xiao
2019-01-11  6:37 ` [Qemu-devel] " guangrong.xiao
2019-01-11  6:37 ` [PATCH v2 1/3] migration: introduce pages-per-second guangrong.xiao
2019-01-11  6:37   ` [Qemu-devel] " guangrong.xiao
2019-01-11 15:37   ` Eric Blake
2019-01-11 15:37     ` [Qemu-devel] " Eric Blake
2019-01-23 12:51     ` Dr. David Alan Gilbert
2019-01-23 12:51       ` [Qemu-devel] " Dr. David Alan Gilbert
2019-01-23 12:34   ` Dr. David Alan Gilbert
2019-01-23 12:34     ` [Qemu-devel] " Dr. David Alan Gilbert
2019-01-11  6:37 ` [PATCH v2 2/3] migration: fix memory leak when updating tls-creds and tls-hostname guangrong.xiao
2019-01-11  6:37   ` [Qemu-devel] " guangrong.xiao
2019-01-15  7:51   ` Peter Xu
2019-01-15  7:51     ` [Qemu-devel] " Peter Xu
2019-01-15 10:24     ` Dr. David Alan Gilbert
2019-01-15 10:24       ` [Qemu-devel] " Dr. David Alan Gilbert
2019-01-15 16:03       ` Eric Blake [this message]
2019-01-15 16:03         ` Eric Blake
2019-01-16  5:55         ` Peter Xu
2019-01-16  5:55           ` [Qemu-devel] " Peter Xu
2019-02-18  8:26         ` Xiao Guangrong
2019-02-18  8:26           ` [Qemu-devel] " Xiao Guangrong
2019-01-11  6:37 ` [PATCH v2 3/3] migration: introduce adaptive model for waiting thread guangrong.xiao
2019-01-11  6:37   ` [Qemu-devel] " guangrong.xiao
2019-01-11  9:57   ` Markus Armbruster
2019-01-11  9:57     ` [Qemu-devel] " Markus Armbruster
2019-02-18  8:47     ` Xiao Guangrong
2019-02-18  8:47       ` [Qemu-devel] " Xiao Guangrong
2019-01-16  6:40   ` Peter Xu
2019-01-16  6:40     ` [Qemu-devel] " Peter Xu
2019-02-18  9:01     ` Xiao Guangrong
2019-02-18  9:01       ` [Qemu-devel] " Xiao Guangrong
2019-01-11  9:53 ` [PATCH v2 0/3] optimize waiting for free thread to do compression Markus Armbruster
2019-01-11  9:53   ` [Qemu-devel] " Markus Armbruster
2019-01-13 14:43 ` no-reply
2019-01-13 14:43   ` [Qemu-devel] " no-reply
2019-01-13 17:41 ` no-reply
2019-01-13 17:41   ` [Qemu-devel] " no-reply

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=2caebc3a-ccd0-d8c6-0368-4f339f326cdf@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=cota@braap.org \
    --cc=dgilbert@redhat.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=wei.w.wang@intel.com \
    --cc=xiaoguangrong@tencent.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.