2011-01-31 04:47:03 -06:00
|
|
|
/*
|
|
|
|
* qemu_migration.h: QEMU migration handling
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2011 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __QEMU_MIGRATION_H__
|
|
|
|
# define __QEMU_MIGRATION_H__
|
|
|
|
|
|
|
|
# include "qemu_conf.h"
|
|
|
|
|
2011-07-14 16:46:49 -05:00
|
|
|
/* All supported qemu migration flags. */
|
|
|
|
# define QEMU_MIGRATION_FLAGS \
|
|
|
|
(VIR_MIGRATE_LIVE | \
|
|
|
|
VIR_MIGRATE_PEER2PEER | \
|
|
|
|
VIR_MIGRATE_TUNNELLED | \
|
|
|
|
VIR_MIGRATE_PERSIST_DEST | \
|
|
|
|
VIR_MIGRATE_UNDEFINE_SOURCE | \
|
|
|
|
VIR_MIGRATE_PAUSED | \
|
|
|
|
VIR_MIGRATE_NON_SHARED_DISK | \
|
|
|
|
VIR_MIGRATE_NON_SHARED_INC)
|
2011-01-31 04:47:03 -06:00
|
|
|
|
|
|
|
bool qemuMigrationIsAllowed(virDomainDefPtr def)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
int qemuMigrationSetOffline(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm);
|
|
|
|
|
|
|
|
int qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm);
|
|
|
|
|
2011-02-03 05:09:28 -06:00
|
|
|
char *qemuMigrationBegin(struct qemud_driver *driver,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-18 04:26:30 -05:00
|
|
|
const char *xmlin,
|
2011-02-03 05:09:28 -06:00
|
|
|
char **cookieout,
|
|
|
|
int *cookieoutlen);
|
|
|
|
|
2011-01-31 04:47:03 -06:00
|
|
|
int qemuMigrationPrepareTunnel(struct qemud_driver *driver,
|
|
|
|
virConnectPtr dconn,
|
2011-01-24 12:06:16 -06:00
|
|
|
const char *cookiein,
|
|
|
|
int cookieinlen,
|
|
|
|
char **cookieout,
|
|
|
|
int *cookieoutlen,
|
2011-01-31 04:47:03 -06:00
|
|
|
virStreamPtr st,
|
|
|
|
const char *dname,
|
|
|
|
const char *dom_xml);
|
|
|
|
|
|
|
|
int qemuMigrationPrepareDirect(struct qemud_driver *driver,
|
|
|
|
virConnectPtr dconn,
|
2011-01-24 12:06:16 -06:00
|
|
|
const char *cookiein,
|
|
|
|
int cookieinlen,
|
|
|
|
char **cookieout,
|
|
|
|
int *cookieoutlen,
|
2011-01-31 04:47:03 -06:00
|
|
|
const char *uri_in,
|
|
|
|
char **uri_out,
|
|
|
|
const char *dname,
|
|
|
|
const char *dom_xml);
|
|
|
|
|
|
|
|
int qemuMigrationPerform(struct qemud_driver *driver,
|
|
|
|
virConnectPtr conn,
|
|
|
|
virDomainObjPtr vm,
|
2011-05-18 04:26:30 -05:00
|
|
|
const char *xmlin,
|
Add a second URI parameter to virDomainMigratePerform3 method
The virDomainMigratePerform3 currently has a single URI parameter
whose meaning varies. It is either
- A QEMU migration URI (normal migration)
- A libvirtd connection URI (peer2peer migration)
Unfortunately when using peer2peer migration, without also
using tunnelled migration, it is possible that both URIs are
required.
This adds a second URI parameter to the virDomainMigratePerform3
method, to cope with this scenario. Each parameter how has a fixed
meaning.
NB, there is no way to actually take advantage of this yet,
since virDomainMigrate/virDomainMigrateToURI do not have any
way to provide the 2 separate URIs
* daemon/remote.c, src/remote/remote_driver.c,
src/remote/remote_protocol.x, src/remote_protocol-structs: Add
the second URI parameter to perform3 message
* src/driver.h, src/libvirt.c, src/libvirt_internal.h: Add
the second URI parameter to Perform3 method
* src/libvirt_internal.h, src/qemu/qemu_migration.c,
src/qemu/qemu_migration.h: Update to handle URIs correctly
2011-05-18 08:18:53 -05:00
|
|
|
const char *dconnuri,
|
2011-01-31 04:47:03 -06:00
|
|
|
const char *uri,
|
2011-01-24 12:06:16 -06:00
|
|
|
const char *cookiein,
|
|
|
|
int cookieinlen,
|
|
|
|
char **cookieout,
|
|
|
|
int *cookieoutlen,
|
2011-01-31 04:47:03 -06:00
|
|
|
unsigned long flags,
|
|
|
|
const char *dname,
|
2011-02-03 05:09:28 -06:00
|
|
|
unsigned long resource,
|
2011-05-23 07:50:11 -05:00
|
|
|
bool v3proto);
|
2011-01-31 04:47:03 -06:00
|
|
|
|
|
|
|
virDomainPtr qemuMigrationFinish(struct qemud_driver *driver,
|
|
|
|
virConnectPtr dconn,
|
|
|
|
virDomainObjPtr vm,
|
2011-01-24 12:06:16 -06:00
|
|
|
const char *cookiein,
|
|
|
|
int cookieinlen,
|
|
|
|
char **cookieout,
|
|
|
|
int *cookieoutlen,
|
2011-01-31 04:47:03 -06:00
|
|
|
unsigned long flags,
|
2011-05-23 07:50:11 -05:00
|
|
|
int retcode,
|
|
|
|
bool v3proto);
|
2011-01-31 04:47:03 -06:00
|
|
|
|
2011-02-03 05:09:28 -06:00
|
|
|
int qemuMigrationConfirm(struct qemud_driver *driver,
|
|
|
|
virConnectPtr conn,
|
|
|
|
virDomainObjPtr vm,
|
|
|
|
const char *cookiein,
|
|
|
|
int cookieinlen,
|
|
|
|
unsigned int flags,
|
2011-05-19 06:48:15 -05:00
|
|
|
int retcode);
|
2011-02-03 05:09:28 -06:00
|
|
|
|
2011-01-31 04:47:03 -06:00
|
|
|
|
2011-03-09 18:35:13 -06:00
|
|
|
int qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
|
|
|
|
int fd, off_t offset, const char *path,
|
|
|
|
const char *compressor,
|
|
|
|
bool is_reg, bool bypassSecurityDriver)
|
2011-05-05 05:30:26 -05:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
|
2011-03-09 18:35:13 -06:00
|
|
|
ATTRIBUTE_RETURN_CHECK;
|
|
|
|
|
2011-01-31 04:47:03 -06:00
|
|
|
#endif /* __QEMU_MIGRATION_H__ */
|