Commit 9bbb7e0f authored by Christian Schoenebeck's avatar Christian Schoenebeck Committed by Greg Kurz
Browse files

xen-9pfs: Fix log messages of reply errors



If delivery of some 9pfs response fails for some reason, log the
error message by mentioning the 9P protocol reply type, not by
client's request type. The latter could be misleading that the
error occurred already when handling the request input.

Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
Acked-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Message-Id: <ad0e5a9b6abde52502aa40b30661d29aebe1590a.1589132512.git.qemu_oss@crudebyte.com>
Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
parent a5804fcf
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -137,7 +137,8 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
    ret = v9fs_iov_vmarshal(in_sg, num, offset, 0, fmt, ap);
    if (ret < 0) {
        xen_pv_printf(&xen_9pfs->xendev, 0,
                      "Failed to encode VirtFS request type %d\n", pdu->id + 1);
                      "Failed to encode VirtFS reply type %d\n",
                      pdu->id + 1);
        xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
        xen_9pfs_disconnect(&xen_9pfs->xendev);
    }
@@ -201,9 +202,9 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,

    buf_size = iov_size(ring->sg, num);
    if (buf_size  < P9_IOHDRSZ) {
        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
                "needs %zu bytes, buffer has %zu, less than minimum\n",
                pdu->id, *size, buf_size);
        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs "
                      "%zu bytes, buffer has %zu, less than minimum\n",
                      pdu->id + 1, *size, buf_size);
        xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
        xen_9pfs_disconnect(&xen_9pfs->xendev);
    }