From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMEr2-0002mI-NC for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMEqr-0008W6-Iu for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:28 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:51027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMEqr-0008Ux-A5 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:17 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Sep 2013 11:19:15 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 60F531B08066 for ; Wed, 18 Sep 2013 11:19:13 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8IAJ0h056230094 for ; Wed, 18 Sep 2013 10:19:00 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8IAJB2l012348 for ; Wed, 18 Sep 2013 04:19:12 -0600 From: Christian Borntraeger Date: Wed, 18 Sep 2013 12:19:27 +0200 Message-Id: <1379499572-49737-7-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1379499572-49737-1-git-send-email-borntraeger@de.ibm.com> References: <1379499572-49737-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 06/11] s390/eventfacility: fix multiple Read Event Data sources List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , Jens Freimann , Heinz Graalfs , Ralf Hoppe , qemu-devel From: Ralf Hoppe Make the handler for SCLP Read Event Data deal with notifications for multiple sources correctly. Signed-off-by: Ralf Hoppe Reviewed-by: Thomas Huth Signed-off-by: Christian Borntraeger [split bigger patch into smaller independent chunks] --- hw/s390x/event-facility.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index c8f62bf..4347a48 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -183,7 +183,7 @@ static uint16_t handle_sccb_read_events(SCLPEventFacility *ef, SCCB *sccb, { uint16_t rc; int slen; - unsigned elen = 0; + unsigned elen; BusChild *kid; SCLPEvent *event; SCLPEventClass *ec; @@ -203,11 +203,11 @@ static uint16_t handle_sccb_read_events(SCLPEventFacility *ef, SCCB *sccb, if (mask & ec->get_send_mask()) { if (ec->read_event_data(event, event_buf, &slen)) { + elen = be16_to_cpu(event_buf->length); + event_buf = (EventBufferHeader *) ((char *)event_buf + elen); rc = SCLP_RC_NORMAL_COMPLETION; } } - elen = be16_to_cpu(event_buf->length); - event_buf = (void *) event_buf + elen; } if (sccb->h.control_mask[2] & SCLP_VARIABLE_LENGTH_RESPONSE) { -- 1.8.3.1