mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
- Aneesh no longer listed in MAINTAINERS,
- deprecation of the handle backend, - improved error reporting, especially when the local backend fails to open the VirtFS root, - virtio-9p-test to behave more like a real virtio guest driver: set DRIVER_OK when ready to use the device and process the used ring for completed requests, - cosmetic fixes (mostly coding style related). -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEtIKLr5QxQM7yo0kQcdTV5YIvc9YFAlpTRaYACgkQcdTV5YIv c9a7whAAirmxuFubIELmGDZiihqlCddq8ez4YfEWg2QXJ4I4I2TVcMRqPvxOqDM1 w3bFgBD1N6ukA16i9wn2vevzU7NTdr6CHJFReDALZteOxLD+36VeZf159kSISA7L bXENI893mUVxaLzx9ce/I7A06Hl4BlZtSs0mrpzLhaP+WE1t2Hth0Atw6sWSyCJP JanB+5mMsh4VFv/S7YiA21bPt8O5q5BWiyzQQ8kikPj+KBThLa5J711lAakEeQTZ gKqmOzeou/r2XfXi3ZkfMm4QmDdnA4gXIe8OXIaP/Rg88413DnGWUAFyaa06VYfc CsVX1t7EeqP6F+DR+G/6LhdhcSVrZ62//Ie3a9ZsWy0Ul8nTB08CLxIxhCKmV+gg bJyruhwH7s09NtsEmPg+HFQ7Hkq+qUdFiNBLtjFOvaLu3XTPKFopvDK/fohcS5Yc 7vJLQ676rGcQIEb5/Ws3tlAzARSqELmUSp/X6RXj/4mVK/HE4l5z2OLlJPXVVWUS xE5wz/p/qNnTCJeBXHjVl2nhyW4clwunuc/RANm5FiQMqJmNel8rrpnszQgsX0g7 eLCyXuWn4Poq3YSr69lK/KkqREqu5OhxesCw23TrPY1/vvtSbxywr1V9d4ITywQc v/I67ZSxF9zQOgKw/XvAyal7De+A8VJw7GhqHpYc1//jCzarLQ4= =aKjv -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging - Aneesh no longer listed in MAINTAINERS, - deprecation of the handle backend, - improved error reporting, especially when the local backend fails to open the VirtFS root, - virtio-9p-test to behave more like a real virtio guest driver: set DRIVER_OK when ready to use the device and process the used ring for completed requests, - cosmetic fixes (mostly coding style related). # gpg: Signature made Mon 08 Jan 2018 10:19:18 GMT # gpg: using RSA key 0x71D4D5E5822F73D6 # gpg: Good signature from "Greg Kurz <groug@kaod.org>" # gpg: aka "Gregory Kurz <gregory.kurz@free.fr>" # gpg: aka "[jpeg image of size 3330]" # Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6 * remotes/gkurz/tags/for-upstream: MAINTAINERS: Drop Aneesh as 9pfs maintainer 9pfs: deprecate handle backend fsdev: improve error handling of backend init fsdev: improve error handling of backend opts parsing tests: virtio-9p: set DRIVER_OK before using the device tests: virtio-9p: fix ISR dependence 9pfs: make pdu_marshal() and pdu_unmarshal() static functions 9pfs: fix error path in pdu_submit() 9pfs: fix type in *_parse_opts declarations 9pfs: handle: fix type definition 9pfs: fix some type definitions fsdev: fix some type definitions 9pfs: fix XattrOperations typedef virtio-9p: move unrealize/realize after virtio_9p_transport definition Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
ee98a6b089
14 changed files with 161 additions and 149 deletions
|
@ -18,6 +18,8 @@
|
|||
#include "standard-headers/linux/virtio_pci.h"
|
||||
#include "hw/9pfs/9p.h"
|
||||
|
||||
#define QVIRTIO_9P_TIMEOUT_US (10 * 1000 * 1000)
|
||||
|
||||
static const char mount_tag[] = "qtest";
|
||||
|
||||
typedef struct {
|
||||
|
@ -73,6 +75,9 @@ static QVirtIO9P *qvirtio_9p_pci_start(void)
|
|||
qvirtio_set_driver(v9p->dev);
|
||||
|
||||
v9p->vq = qvirtqueue_setup(v9p->dev, v9p->qs->alloc, 0);
|
||||
|
||||
qvirtio_set_driver_ok(v9p->dev);
|
||||
|
||||
return v9p;
|
||||
}
|
||||
|
||||
|
@ -111,6 +116,7 @@ typedef struct {
|
|||
/* No r_size, it is hardcoded to P9_MAX_SIZE */
|
||||
size_t t_off;
|
||||
size_t r_off;
|
||||
uint32_t free_head;
|
||||
} P9Req;
|
||||
|
||||
static void v9fs_memwrite(P9Req *req, const void *addr, size_t len)
|
||||
|
@ -124,11 +130,6 @@ static void v9fs_memskip(P9Req *req, size_t len)
|
|||
req->r_off += len;
|
||||
}
|
||||
|
||||
static void v9fs_memrewind(P9Req *req, size_t len)
|
||||
{
|
||||
req->r_off -= len;
|
||||
}
|
||||
|
||||
static void v9fs_memread(P9Req *req, void *addr, size_t len)
|
||||
{
|
||||
memread(req->r_msg + req->r_off, addr, len);
|
||||
|
@ -227,12 +228,12 @@ static P9Req *v9fs_req_init(QVirtIO9P *v9p, uint32_t size, uint8_t id,
|
|||
static void v9fs_req_send(P9Req *req)
|
||||
{
|
||||
QVirtIO9P *v9p = req->v9p;
|
||||
uint32_t free_head;
|
||||
|
||||
req->r_msg = guest_alloc(v9p->qs->alloc, P9_MAX_SIZE);
|
||||
free_head = qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, false, true);
|
||||
req->free_head = qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, false,
|
||||
true);
|
||||
qvirtqueue_add(v9p->vq, req->r_msg, P9_MAX_SIZE, true, false);
|
||||
qvirtqueue_kick(v9p->dev, v9p->vq, free_head);
|
||||
qvirtqueue_kick(v9p->dev, v9p->vq, req->free_head);
|
||||
req->t_off = 0;
|
||||
}
|
||||
|
||||
|
@ -250,19 +251,13 @@ static void v9fs_req_recv(P9Req *req, uint8_t id)
|
|||
{
|
||||
QVirtIO9P *v9p = req->v9p;
|
||||
P9Hdr hdr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
qvirtio_wait_queue_isr(v9p->dev, v9p->vq, 1000 * 1000);
|
||||
qvirtio_wait_used_elem(v9p->dev, v9p->vq, req->free_head,
|
||||
QVIRTIO_9P_TIMEOUT_US);
|
||||
|
||||
v9fs_memread(req, &hdr, 7);
|
||||
hdr.size = ldl_le_p(&hdr.size);
|
||||
hdr.tag = lduw_le_p(&hdr.tag);
|
||||
if (hdr.size >= 7) {
|
||||
break;
|
||||
}
|
||||
v9fs_memrewind(req, 7);
|
||||
}
|
||||
v9fs_memread(req, &hdr, 7);
|
||||
hdr.size = ldl_le_p(&hdr.size);
|
||||
hdr.tag = lduw_le_p(&hdr.tag);
|
||||
|
||||
g_assert_cmpint(hdr.size, >=, 7);
|
||||
g_assert_cmpint(hdr.size, <=, P9_MAX_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue