mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
qemuMigrationSrcNBDStorageCopy: Don't pass migrate_flags
'migrate_flags' can be updated in the only caller and since qemuMigrationSrcNBDStorageCopy already takes @flags which contains VIR_MIGRATE_NON_SHARED_INC (used to set QEMU_MONITOR_MIGRATE_NON_SHARED_INC) we can completely remove the parameter. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com> Tested-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
652ea8083b
commit
a9c1d5657d
@ -1074,14 +1074,11 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriver *driver,
|
|||||||
* @mig: migration cookie
|
* @mig: migration cookie
|
||||||
* @host: where are we migrating to
|
* @host: where are we migrating to
|
||||||
* @speed: bandwidth limit in MiB/s
|
* @speed: bandwidth limit in MiB/s
|
||||||
* @migrate_flags: migrate monitor command flags
|
|
||||||
*
|
*
|
||||||
* Migrate non-shared storage using the NBD protocol to the server running
|
* Migrate non-shared storage using the NBD protocol to the server running
|
||||||
* inside the qemu process on dst and wait until the copy converges.
|
* inside the qemu process on dst and wait until the copy converges.
|
||||||
* On success update @migrate_flags so we don't tell 'migrate' command
|
* On failure, the caller is expected to call qemuMigrationSrcNBDCopyCancel
|
||||||
* to do the very same operation. On failure, the caller is
|
* to stop all running copy operations.
|
||||||
* expected to call qemuMigrationSrcNBDCopyCancel to stop all
|
|
||||||
* running copy operations.
|
|
||||||
*
|
*
|
||||||
* Returns 0 on success (@migrate_flags updated),
|
* Returns 0 on success (@migrate_flags updated),
|
||||||
* -1 otherwise.
|
* -1 otherwise.
|
||||||
@ -1092,7 +1089,6 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
|||||||
qemuMigrationCookie *mig,
|
qemuMigrationCookie *mig,
|
||||||
const char *host,
|
const char *host,
|
||||||
unsigned long speed,
|
unsigned long speed,
|
||||||
unsigned int *migrate_flags,
|
|
||||||
size_t nmigrate_disks,
|
size_t nmigrate_disks,
|
||||||
const char **migrate_disks,
|
const char **migrate_disks,
|
||||||
virConnectPtr dconn,
|
virConnectPtr dconn,
|
||||||
@ -1104,7 +1100,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
|||||||
int port;
|
int port;
|
||||||
size_t i;
|
size_t i;
|
||||||
unsigned long long mirror_speed = speed;
|
unsigned long long mirror_speed = speed;
|
||||||
bool mirror_shallow = *migrate_flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC;
|
bool mirror_shallow = flags & VIR_MIGRATE_NON_SHARED_INC;
|
||||||
int rv;
|
int rv;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||||
g_autoptr(virURI) uri = NULL;
|
g_autoptr(virURI) uri = NULL;
|
||||||
@ -1201,11 +1197,6 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
|||||||
|
|
||||||
qemuMigrationSrcFetchMirrorStats(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
qemuMigrationSrcFetchMirrorStats(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
||||||
priv->job.current);
|
priv->job.current);
|
||||||
|
|
||||||
/* Okay, all disks are ready. Modify migrate_flags */
|
|
||||||
*migrate_flags &= ~(QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
|
|
||||||
QEMU_MONITOR_MIGRATE_NON_SHARED_INC);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4130,17 +4121,20 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This will update migrate_flags on success */
|
|
||||||
if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig,
|
if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig,
|
||||||
host,
|
host,
|
||||||
migrate_speed,
|
migrate_speed,
|
||||||
&migrate_flags,
|
|
||||||
nmigrate_disks,
|
nmigrate_disks,
|
||||||
migrate_disks,
|
migrate_disks,
|
||||||
dconn, tlsAlias,
|
dconn, tlsAlias,
|
||||||
nbdURI, flags) < 0) {
|
nbdURI, flags) < 0) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* mask out the legacy migration flags if we are using NBD */
|
||||||
|
migrate_flags &= ~(QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
|
||||||
|
QEMU_MONITOR_MIGRATE_NON_SHARED_INC);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Destination doesn't support NBD server.
|
/* Destination doesn't support NBD server.
|
||||||
* Fall back to previous implementation. */
|
* Fall back to previous implementation. */
|
||||||
|
Loading…
Reference in New Issue
Block a user