diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 047c7ea4eb7a3200e56c6a37803b28c15808fadd..107a66cfa7005f1939fc146babaf683520c12264 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -1025,7 +1025,11 @@ static void v9fs_version(V9fsState *s, V9fsPDU *pdu) pdu_unmarshal(pdu, offset, "ds", &msize, &version); - if (strcmp(version.data, "9P2000.u")) { + if (!strcmp(version.data, "9P2000.u")) { + s->proto_version = V9FS_PROTO_2000U; + } else if (!strcmp(version.data, "9P2000.L")) { + s->proto_version = V9FS_PROTO_2000L; + } else { v9fs_string_sprintf(&version, "unknown"); } diff --git a/hw/virtio-9p.h b/hw/virtio-9p.h index 67f808761f2d3494ce240b31cc990cfc4c5ae1e5..9286f59cd4a71c160940727b7bfcd09666bf5443 100644 --- a/hw/virtio-9p.h +++ b/hw/virtio-9p.h @@ -57,6 +57,11 @@ enum { P9_QTFILE = 0x00, }; +enum p9_proto_version { + V9FS_PROTO_2000U = 0x01, + V9FS_PROTO_2000L = 0x02, +}; + #define P9_NOTAG (u16)(~0) #define P9_NOFID (u32)(~0) #define P9_MAXWELEM 16 @@ -144,6 +149,7 @@ typedef struct V9fsState uint16_t tag_len; uint8_t *tag; size_t config_size; + enum p9_proto_version proto_version; } V9fsState; typedef struct V9fsCreateState {