From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b48yI-0005oh-0Z for qemu-devel@nongnu.org; Sat, 21 May 2016 11:37:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b48yD-0007nx-Si for qemu-devel@nongnu.org; Sat, 21 May 2016 11:37:45 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b48yD-0007nc-6Y for qemu-devel@nongnu.org; Sat, 21 May 2016 11:37:41 -0400 Received: by mail-wm0-x241.google.com with SMTP id 67so4083805wmg.0 for ; Sat, 21 May 2016 08:37:40 -0700 (PDT) Sender: Paolo Bonzini References: <1463787632-7241-1-git-send-email-stefanha@redhat.com> <1463787632-7241-8-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: <1055bf16-4a14-2a93-ff53-d3db7db0d547@redhat.com> Date: Sat, 21 May 2016 17:37:27 +0200 MIME-Version: 1.0 In-Reply-To: <1463787632-7241-8-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] virtio-blk: live migrate s->rq with multiqueue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Ming Lei , Fam Zheng On 21/05/2016 01:40, Stefan Hajnoczi wrote: > while (req) { > qemu_put_sbyte(f, 1); Could you just put an extra 32-bit queue id here if num_queues > 1? A guest with num_queues > 1 cannot be started on pre-2.7 QEMU, so you can change the migration format (if virtio were using vmstate, it would be a VMSTATE_UINT32_TEST). Thanks, Paolo > qemu_put_virtqueue_element(f, &req->elem); > req = req->next; > + s->num_rq++; > } > qemu_put_sbyte(f, 0); > + > + /* In order to distinguish virtio-blk subsections from the generic virtio > + * device subsections that follow we emit a terminating byte. Old versions > + * of QEMU don't expect the terminating byte so, for compatibility, only > + * write it when virtio-blk subsections are needed. > + */ > + if (virtio_blk_mq_rq_indices_needed(s)) { > + uint32_t i; > + > + s->mq_rq_indices = g_new(uint32_t, s->num_rq); > + req = s->rq; > + for (i = 0; i < s->num_rq; i++) { > + s->mq_rq_indices[i] = virtio_get_queue_index(req->vq); > + req = req->next; > + } > + > + vmstate_save_state(f, &virtio_blk_vmstate, s, NULL); > + qemu_put_ubyte(f, ~QEMU_VM_SUBSECTION); > + > + g_free(s->mq_rq_indices); > + s->mq_rq_indices = NULL;