[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] Disallow outward migration while awaiting i
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] Disallow outward migration while awaiting incoming migration |
Date: |
Mon, 14 Apr 2014 17:34:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 14.04.2014 17:16, schrieb Dr. David Alan Gilbert (git):
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> QEMU will assert if you attempt to start an outgoing migration on
> a QEMU that's sitting waiting for an incoming migration (started
> with -incoming), so disallow it with a proper error.
>
> (This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1086987 )
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> include/qapi/qmp/qerror.h | 3 +++
> migration.c | 5 +++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index da75abf..03103cc 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -167,6 +167,9 @@ void qerror_report_err(Error *err);
> #define QERR_MIGRATION_NOT_SUPPORTED \
> ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'"
>
> +#define QERR_MIGRATION_ON_INCOMING \
> + ERROR_CLASS_GENERIC_ERROR, "Guest is waiting for an incoming migration"
> +
> #define QERR_MISSING_PARAMETER \
> ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing"
>
> diff --git a/migration.c b/migration.c
> index bd1fb91..e99b5fa 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -419,6 +419,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
> return;
> }
>
> + if (runstate_check(RUN_STATE_INMIGRATE)) {
> + error_set(errp, QERR_MIGRATION_ON_INCOMING);
Shouldn't this be using error_setg() instead of a new QERR_?
Andreas
> + return;
> + }
> +
> if (qemu_savevm_state_blocked(errp)) {
> return;
> }
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg