[libvirt] [PATCH 0/2] Forbid unsupported parameters for tunnelled migration

Jiri Denemark (2): virsh: Don't check migrate parameters qemu: Forbid unsupported parameters for tunnelled migration src/qemu/qemu_migration.c | 16 +++++++++++++++- tools/virsh-domain.c | 13 +------------ 2 files changed, 16 insertions(+), 13 deletions(-) -- 2.4.0

Just pass anything a user specified to the appropriate API. It's the API or libvirtd that should be responsible for checking its parameters. https://bugzilla.redhat.com/show_bug.cgi?id=1066375 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tools/virsh-domain.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 861766f..14e1e35 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9894,18 +9894,7 @@ doMigrate(void *opaque) if (vshCommandOptBool(cmd, "abort-on-error")) flags |= VIR_MIGRATE_ABORT_ON_ERROR; - if ((flags & VIR_MIGRATE_PEER2PEER) || - vshCommandOptBool(cmd, "direct")) { - - /* migrateuri doesn't make sense for tunnelled migration */ - if (flags & VIR_MIGRATE_TUNNELLED && - virTypedParamsGetString(params, nparams, - VIR_MIGRATE_PARAM_URI, NULL) == 1) { - vshError(ctl, "%s", _("migrate: Unexpected migrateuri for " - "peer2peer/direct migration")); - goto out; - } - + if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) { if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0) ret = '0'; } else { -- 2.4.0

Neither migrate URI nor lister address make any sense for tunnelled migration. https://bugzilla.redhat.com/show_bug.cgi?id=1066375 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_migration.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index eb70f29..20c2193 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4814,6 +4814,20 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver, NULLSTR(uri), NULLSTR(graphicsuri), NULLSTR(listenAddress), flags, NULLSTR(dname), resource); + if (flags & VIR_MIGRATE_TUNNELLED && uri) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("migration URI is not supported by tunnelled " + "migration")); + goto cleanup; + } + + if (flags & VIR_MIGRATE_TUNNELLED && listenAddress) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("listen address is not supported by tunnelled " + "migration")); + goto cleanup; + } + /* the order of operations is important here; we make sure the * destination side is completely setup before we touch the source */ @@ -4857,7 +4871,7 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver, /* Only xmlin, dname, uri, and bandwidth parameters can be used with * old-style APIs. */ - if (!useParams && graphicsuri) { + if (!useParams && (graphicsuri || listenAddress)) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("Migration APIs with extensible parameters are not " "supported but extended parameters were passed")); -- 2.4.0

On 05/04/2015 06:10 AM, Jiri Denemark wrote:
Neither migrate URI nor lister address make any sense for tunnelled
s/lister/listener/ ?
migration.
https://bugzilla.redhat.com/show_bug.cgi?id=1066375
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/qemu/qemu_migration.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 04.05.2015 14:10, Jiri Denemark wrote:
Jiri Denemark (2): virsh: Don't check migrate parameters qemu: Forbid unsupported parameters for tunnelled migration
src/qemu/qemu_migration.c | 16 +++++++++++++++- tools/virsh-domain.c | 13 +------------ 2 files changed, 16 insertions(+), 13 deletions(-)
ACK series. Although it would be nice to have those patches swapped, so that there's no window where arguments are not checked. Michal

On Mon, May 04, 2015 at 14:40:04 +0200, Michal Privoznik wrote:
On 04.05.2015 14:10, Jiri Denemark wrote:
Jiri Denemark (2): virsh: Don't check migrate parameters qemu: Forbid unsupported parameters for tunnelled migration
src/qemu/qemu_migration.c | 16 +++++++++++++++- tools/virsh-domain.c | 13 +------------ 2 files changed, 16 insertions(+), 13 deletions(-)
ACK series. Although it would be nice to have those patches swapped, so that there's no window where arguments are not checked.
Well, the window will always be there when a new virsh connects to an old libvirt... But I have no problem swapping the patches so I did that and pushed. Thanks. Jirka
participants (3)
-
Eric Blake
-
Jiri Denemark
-
Michal Privoznik