From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi4wC-0000IU-QN for qemu-devel@nongnu.org; Fri, 02 Oct 2015 14:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi4wC-0002i4-35 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 14:20:08 -0400 References: <1443717273-5280-1-git-send-email-jsnow@redhat.com> <1443717273-5280-4-git-send-email-jsnow@redhat.com> <560D7500.1000705@redhat.com> From: John Snow Message-ID: <560ECAD0.8020005@redhat.com> Date: Fri, 2 Oct 2015 14:20:00 -0400 MIME-Version: 1.0 In-Reply-To: <560D7500.1000705@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] block: prohibit migration during transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On 10/01/2015 02:01 PM, Paolo Bonzini wrote: > > > On 01/10/2015 18:34, John Snow wrote: >> + >> + error_setg(&blocker, "Block device(s) are in use by a Block Transaction"); > > s/Block Transaction/transaction command/ > > But how can migration start during a transaction? > Well, it definitely can't now ! :) This is actually more for the other case: The migration starts, and we want to prohibit snapshots and transactions during that period. Together with the patch this depends on, we accomplish that. The workflow of snapshot/transaction-before-migration isn't currently possible. >> + ret = migrate_add_blocker(blocker, errp); >> + if (ret < 0) { >> + goto cleanup_mig; >> + } >> >> QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionState) snap_bdrv_states; >> QSIMPLEQ_INIT(&snap_bdrv_states); >> @@ -1814,6 +1823,9 @@ exit: >> } >> g_free(state); >> } >> + cleanup_mig: >> + migrate_del_blocker(blocker); >> + error_free(blocker); >