From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK8oR-0005Cf-44 for qemu-devel@nongnu.org; Tue, 28 Jul 2015 13:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZK8oO-0000zS-EI for qemu-devel@nongnu.org; Tue, 28 Jul 2015 13:37:11 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:35336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK8oO-0000zO-BO for qemu-devel@nongnu.org; Tue, 28 Jul 2015 13:37:08 -0400 Received: by qkbm65 with SMTP id m65so53840258qkb.2 for ; Tue, 28 Jul 2015 10:37:08 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 28 Jul 2015 19:36:39 +0200 Message-Id: <1438105003-29501-6-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1438105003-29501-1-git-send-email-marcandre.lureau@redhat.com> References: <1438105003-29501-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 5/9] vhost: document log resizing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: haifeng.lin@huawei.com, mst@redhat.com, thibaut.collet@6wind.com, jasowang@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 862e786..057d548 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -357,6 +357,8 @@ static inline void vhost_dev_log_resize(struct vhost_dev* dev, uint64_t size) uint64_t log_base = (uintptr_t)log->log; int r; + /* inform backend of log switching, this must be done before + releasing the current log, to ensure no logging is lost */ r = dev->vhost_ops->vhost_call(dev, VHOST_SET_LOG_BASE, &log_base); assert(r >= 0); vhost_log_put(dev, true); -- 2.4.3