[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.10 3/4] block-backend: Defer shared_perm t
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH for-2.10 3/4] block-backend: Defer shared_perm tightening migration completion |
Date: |
Tue, 15 Aug 2017 12:50:05 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, Aug 15, 2017 at 12:04:53PM +0800, Fam Zheng wrote:
> @@ -147,6 +166,24 @@ static void blk_root_activate(BdrvChild *child, Error
> **errp)
>
> blk->disable_perm = false;
>
> + blk_set_perm(blk, blk->perm, BLK_PERM_ALL, &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + blk->disable_perm = true;
> + return;
> + }
> +
> + if (runstate_check(RUN_STATE_INMIGRATE)) {
> + /* Activation can happen when migration process is still active, for
> + * example when nbd_server_add is called during non-shared storage
> + * migration. Defer the shared_perm update to migration completion.
> */
> + if (!blk->vmsh) {
> + blk->vmsh =
> qemu_add_vm_change_state_handler(blk_vm_state_changed,
> + blk);
Please add a qemu_del_vm_change_state_handler() call to cover the case
where the BB is deleted before the migration state changes.
This is necessary to prevent a memory leak and a crash when the change
state handler is invoked.
Stefan
signature.asc
Description: PGP signature