Commit fa949b0c authored by Changpeng Liu's avatar Changpeng Liu
Browse files

nvmf: stop paused subsystem correctly



For live migration support in vfio-user transport, we need to pause
the subsystem when starting migration in source VM, then after
migration, the subsystem is in paused state, when exiting the
application, we will call spdk_nvmf_subsystem_stop() at last,
and existing code will assert this case.

Change-Id: If5214c45973b27f6092c4a6d71ede336e54d89e8
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9407


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
parent ae701941
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -539,6 +539,11 @@ nvmf_subsystem_set_state(struct spdk_nvmf_subsystem *subsystem,
		    state == SPDK_NVMF_SUBSYSTEM_PAUSING) {
			expected_old_state = SPDK_NVMF_SUBSYSTEM_RESUMING;
		}
		/* This is for the case when stopping paused subsystem */
		if (actual_old_state == SPDK_NVMF_SUBSYSTEM_PAUSED &&
		    state == SPDK_NVMF_SUBSYSTEM_DEACTIVATING) {
			expected_old_state = SPDK_NVMF_SUBSYSTEM_PAUSED;
		}
		actual_old_state = expected_old_state;
		__atomic_compare_exchange_n(&subsystem->state, &actual_old_state, state, false,
					    __ATOMIC_RELAXED, __ATOMIC_RELAXED);