QEMU main repository: Please see https://www.qemu.org/docs/master/devel/submitting-a-patch.html for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website. http://www.qemu.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
909 B

/*
* Block activation tracking for migration purpose
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (C) 2024 Red Hat, Inc.
*/
#include "qemu/osdep.h"
#include "block/block.h"
#include "qapi/error.h"
#include "migration/migration.h"
#include "qemu/error-report.h"
#include "trace.h"
bool migration_block_activate(Error **errp)
{
ERRP_GUARD();
assert(bql_locked());
trace_migration_block_activation("active");
bdrv_activate_all(errp);
if (*errp) {
error_report_err(error_copy(*errp));
return false;
}
return true;
}
bool migration_block_inactivate(void)
{
int ret;
assert(bql_locked());
trace_migration_block_activation("inactive");
ret = bdrv_inactivate_all();
if (ret) {
error_report("%s: bdrv_inactivate_all() failed: %d",
__func__, ret);
return false;
}
return true;
}