From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VON2A-000149-M3 for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VON21-0005ja-Vb for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:46 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:59047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VON21-0005j6-Lg for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:37 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Sep 2013 08:27:36 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id F2A46219005A for ; Tue, 24 Sep 2013 08:27:33 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8O7RLUk65077376 for ; Tue, 24 Sep 2013 07:27:21 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8O7RW7H026037 for ; Tue, 24 Sep 2013 01:27:33 -0600 From: Christian Borntraeger Date: Tue, 24 Sep 2013 09:27:46 +0200 Message-Id: <1380007671-18976-13-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1380007671-18976-1-git-send-email-borntraeger@de.ibm.com> References: <1380007671-18976-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 12/17] s390/eventfacility: fix multiple Read Event Data sources List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel , Christian Borntraeger , Ralf Hoppe , Alexander Graf , Richard Henderson 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] Reviewed-by: Alexander Graf --- 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 d45968f..d2fd227 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