From: Anthony Liguori <anthony@codemonkey.ws>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Lucas Meneghel Rodrigues <lmr@redhat.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/5] migrate: add migration blockers
Date: Mon, 21 Nov 2011 18:21:25 -0600 [thread overview]
Message-ID: <4ECAEB05.5020707@codemonkey.ws> (raw)
In-Reply-To: <1321304987-23041-1-git-send-email-aliguori@us.ibm.com>
On 11/14/2011 03:09 PM, Anthony Liguori wrote:
> This lets different subsystems register an Error that is thrown whenever
> migration is attempted. This works nicely because it gracefully supports
> things like hotplug.
>
> Right now, if multiple errors are registered, only one of them is reported.
> I expect that for 1.1, we'll extend query-migrate to return all of the reasons
> why migration is disabled at any given point in time.
>
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
Applied.
Regards,
Anthony Liguori
> ---
> migration.c | 18 ++++++++++++++++++
> migration.h | 15 +++++++++++++++
> 2 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 41c3c24..6764d3a 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -398,6 +398,18 @@ static MigrationState *migrate_init(Monitor *mon, int detach, int blk, int inc)
> return s;
> }
>
> +static GSList *migration_blockers;
> +
> +void migrate_add_blocker(Error *reason)
> +{
> + migration_blockers = g_slist_prepend(migration_blockers, reason);
> +}
> +
> +void migrate_del_blocker(Error *reason)
> +{
> + migration_blockers = g_slist_remove(migration_blockers, reason);
> +}
> +
> int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
> {
> MigrationState *s = migrate_get_current();
> @@ -417,6 +429,12 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
> return -1;
> }
>
> + if (migration_blockers) {
> + Error *err = migration_blockers->data;
> + qerror_report_err(err);
> + return -1;
> + }
> +
> s = migrate_init(mon, detach, blk, inc);
>
> if (strstart(uri, "tcp:",&p)) {
> diff --git a/migration.h b/migration.h
> index 1b8ee58..0682179 100644
> --- a/migration.h
> +++ b/migration.h
> @@ -17,6 +17,7 @@
> #include "qdict.h"
> #include "qemu-common.h"
> #include "notify.h"
> +#include "error.h"
>
> typedef struct MigrationState MigrationState;
>
> @@ -89,4 +90,18 @@ int ram_load(QEMUFile *f, void *opaque, int version_id);
>
> extern int incoming_expected;
>
> +/**
> + * @migrate_add_blocker - prevent migration from proceeding
> + *
> + * @reason - an error to be returned whenever migration is attempted
> + */
> +void migrate_add_blocker(Error *reason);
> +
> +/**
> + * @migrate_del_blocker - remove a blocking error from migration
> + *
> + * @reason - the error blocking migration
> + */
> +void migrate_del_blocker(Error *reason);
> +
> #endif
prev parent reply other threads:[~2011-11-22 0:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 21:09 [Qemu-devel] [PATCH 1/5] migrate: add migration blockers Anthony Liguori
2011-11-14 21:09 ` [Qemu-devel] [PATCH 2/5] ivshmem: use migration blockers to prevent live migration in peer mode (v2) Anthony Liguori
2011-11-14 21:31 ` Michael Roth
2011-11-14 21:38 ` Anthony Liguori
2011-11-14 21:09 ` [Qemu-devel] [PATCH 3/5] block: allow migration to work with image files (v3) Anthony Liguori
2011-11-14 21:09 ` [Qemu-devel] [PATCH 4/5] qcow2: implement bdrv_invalidate_cache (v2) Anthony Liguori
2011-11-14 21:09 ` [Qemu-devel] [PATCH 5/5] qed: add migration blocker (v2) Anthony Liguori
2011-11-14 21:29 ` [Qemu-devel] [PATCH 0/5] migration: support migration with image files Anthony Liguori
2011-11-22 0:21 ` Anthony Liguori [this message]
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=4ECAEB05.5020707@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=kwolf@redhat.com \
--cc=lmr@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@linux.vnet.ibm.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.