Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/284077/?format=api
{ "id": 284077, "url": "http://patchwork.ozlabs.org/api/patches/284077/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1381982022-19291-7-git-send-email-rusty@rustcorp.com.au/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1381982022-19291-7-git-send-email-rusty@rustcorp.com.au>", "list_archive_url": null, "date": "2013-10-17T03:53:41", "name": "[6/7] hw/scsi/virtio-scsi: use virtio wrappers to access headers.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8584a4473e97fb9f20d93f3d10152322ccda5c8f", "submitter": { "id": 553, "url": "http://patchwork.ozlabs.org/api/people/553/?format=api", "name": "Rusty Russell", "email": "rusty@rustcorp.com.au" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1381982022-19291-7-git-send-email-rusty@rustcorp.com.au/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/284077/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/284077/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id A64712C00B6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 17 Oct 2013 15:01:44 +1100 (EST)", "from localhost ([::1]:50225 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1VWemM-0002Xo-L6\n\tfor incoming@patchwork.ozlabs.org; Thu, 17 Oct 2013 00:01:42 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:59629)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWejj-0007ab-Jn\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:59:00 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWeji-0001Er-Lt\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:58:59 -0400", "from ozlabs.org ([2402:b800:7003:1:1::1]:33238)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWeji-0001Ec-29\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:58:58 -0400", "by ozlabs.org (Postfix, from userid 1011)\n\tid E5EF32C00DC; Thu, 17 Oct 2013 14:58:50 +1100 (EST)" ], "From": "Rusty Russell <rusty@rustcorp.com.au>", "To": "\"Marc Zyngier\" <marc.zyngier@arm.com>,\n\tqemu-devel@nongnu.org", "Date": "Thu, 17 Oct 2013 14:23:41 +1030", "Message-Id": "<1381982022-19291-7-git-send-email-rusty@rustcorp.com.au>", "X-Mailer": "git-send-email 1.8.1.2", "In-Reply-To": "<1381982022-19291-1-git-send-email-rusty@rustcorp.com.au>", "References": "<1381982022-19291-1-git-send-email-rusty@rustcorp.com.au>", "X-detected-operating-system": "by eggs.gnu.org: Error: Malformed IPv6 address\n\t(bad octet value).", "X-Received-From": "2402:b800:7003:1:1::1", "Cc": "Rusty Russell <rusty@rustcorp.com.au>", "Subject": "[Qemu-devel] [PATCH 6/7] hw/scsi/virtio-scsi: use virtio wrappers\n\tto access headers.", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.14", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.\n\nSigned-off-by: Rusty Russell <rusty@rustcorp.com.au>\nReviewed-by: Anthony Liguori <aliguori@us.ibm.com>\n---\n hw/scsi/virtio-scsi.c | 33 +++++++++++++++++----------------\n 1 file changed, 17 insertions(+), 16 deletions(-)", "diff": "diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c\nindex 26d95a1..e581dd0 100644\n--- a/hw/scsi/virtio-scsi.c\n+++ b/hw/scsi/virtio-scsi.c\n@@ -18,6 +18,7 @@\n #include <hw/scsi/scsi.h>\n #include <block/scsi.h>\n #include <hw/virtio/virtio-bus.h>\n+#include \"hw/virtio/virtio-access.h\"\n \n typedef struct VirtIOSCSIReq {\n VirtIOSCSI *dev;\n@@ -309,12 +310,12 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,\n req->resp.cmd->response = VIRTIO_SCSI_S_OK;\n req->resp.cmd->status = status;\n if (req->resp.cmd->status == GOOD) {\n- req->resp.cmd->resid = tswap32(resid);\n+ req->resp.cmd->resid = virtio_tswap32(resid);\n } else {\n req->resp.cmd->resid = 0;\n sense_len = scsi_req_get_sense(r, req->resp.cmd->sense,\n VIRTIO_SCSI_SENSE_SIZE);\n- req->resp.cmd->sense_len = tswap32(sense_len);\n+ req->resp.cmd->sense_len = virtio_tswap32(sense_len);\n }\n virtio_scsi_complete_req(req);\n }\n@@ -410,16 +411,16 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,\n VirtIOSCSIConfig *scsiconf = (VirtIOSCSIConfig *)config;\n VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(vdev);\n \n- stl_raw(&scsiconf->num_queues, s->conf.num_queues);\n- stl_raw(&scsiconf->seg_max, 128 - 2);\n- stl_raw(&scsiconf->max_sectors, s->conf.max_sectors);\n- stl_raw(&scsiconf->cmd_per_lun, s->conf.cmd_per_lun);\n- stl_raw(&scsiconf->event_info_size, sizeof(VirtIOSCSIEvent));\n- stl_raw(&scsiconf->sense_size, s->sense_size);\n- stl_raw(&scsiconf->cdb_size, s->cdb_size);\n- stw_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);\n- stw_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);\n- stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN);\n+ virtio_stl_p(&scsiconf->num_queues, s->conf.num_queues);\n+ virtio_stl_p(&scsiconf->seg_max, 128 - 2);\n+ virtio_stl_p(&scsiconf->max_sectors, s->conf.max_sectors);\n+ virtio_stl_p(&scsiconf->cmd_per_lun, s->conf.cmd_per_lun);\n+ virtio_stl_p(&scsiconf->event_info_size, sizeof(VirtIOSCSIEvent));\n+ virtio_stl_p(&scsiconf->sense_size, s->sense_size);\n+ virtio_stl_p(&scsiconf->cdb_size, s->cdb_size);\n+ virtio_stw_p(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);\n+ virtio_stw_p(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);\n+ virtio_stl_p(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN);\n }\n \n static void virtio_scsi_set_config(VirtIODevice *vdev,\n@@ -428,14 +429,14 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,\n VirtIOSCSIConfig *scsiconf = (VirtIOSCSIConfig *)config;\n VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev);\n \n- if ((uint32_t) ldl_raw(&scsiconf->sense_size) >= 65536 ||\n- (uint32_t) ldl_raw(&scsiconf->cdb_size) >= 256) {\n+ if ((uint32_t) virtio_ldl_p(&scsiconf->sense_size) >= 65536 ||\n+ (uint32_t) virtio_ldl_p(&scsiconf->cdb_size) >= 256) {\n error_report(\"bad data written to virtio-scsi configuration space\");\n exit(1);\n }\n \n- vs->sense_size = ldl_raw(&scsiconf->sense_size);\n- vs->cdb_size = ldl_raw(&scsiconf->cdb_size);\n+ vs->sense_size = virtio_ldl_p(&scsiconf->sense_size);\n+ vs->cdb_size = virtio_ldl_p(&scsiconf->cdb_size);\n }\n \n static uint32_t virtio_scsi_get_features(VirtIODevice *vdev,\n", "prefixes": [ "6/7" ] }