From patchwork Tue Jul 1 08:22:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 365899 Return-Path: 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]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C13001400D5 for ; Tue, 1 Jul 2014 18:25:04 +1000 (EST) Received: from localhost ([::1]:39390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tN8-00035n-Ke for incoming@patchwork.ozlabs.org; Tue, 01 Jul 2014 04:25:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tL5-00083C-LF for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:23:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1tKw-0003x4-88 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:22:55 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:61370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tKw-0003wr-0g for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:22:46 -0400 Received: by mail-wg0-f41.google.com with SMTP id a1so9259203wgh.12 for ; Tue, 01 Jul 2014 01:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wElEQ3uO1hnKjy5afVcAmPaHdgs1xhGL2plCIKDRFTY=; b=YrZ0rEViLQZcliq3FfgiSLp0Wa/QntaNP7nJZSi4dVRXFwNNpH1NwhyirPVXQxy02n Uq3ZibluHkNao/8iin4Y6Ngk1Wf7t0JLasV6Dy3FEV7iQX6hr9YHjezMw0YrfHkW4QqM XVqDlatnuS/SjRPkZG04nc1JsqiIXibMIsLkuhfLY9pFJ3XnjU2pEaMtHsONVHtrf+AY hzxp3hK4v4vvWYJb+8yw9LLAf4pOWfkrHqsFhGMZZ5eAyAFdStbXCAMMZc/PVkglKhrq 1zbuYFyGEY+/Q6oYDJw/BpZ5O9dIXFIHZts9piXzNEjvVKOjcupgPFxVJ2ebn95UWNQl PAnA== X-Received: by 10.195.11.132 with SMTP id ei4mr9554067wjd.95.1404202965256; Tue, 01 Jul 2014 01:22:45 -0700 (PDT) Received: from playground.station (net-37-116-207-238.cust.vodafonedsl.it. [37.116.207.238]) by mx.google.com with ESMTPSA id o3sm40596227wiz.24.2014.07.01.01.22.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 01:22:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 1 Jul 2014 10:22:34 +0200 Message-Id: <1404202956-30657-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1404202956-30657-1-git-send-email-pbonzini@redhat.com> References: <1404202956-30657-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::229 Cc: Greg Kurz Subject: [Qemu-devel] [PULL 1/3] virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Greg Kurz Hotplug of a virtio scsi disk is currently broken: no disk appears in the guest (verified with a fedora 20 host running a fedora 20 guest with KVM). Bisect leeds to Paolo's patches to support any_layout, especially this commit: commit 36b15c79aa1bef5fe7543f9f2629b6413720bbfb Author: Paolo Bonzini Date: Tue Jun 10 16:21:18 2014 +0200 virtio-scsi: start preparing for any_layout It modifies virtio_scsi_pop_req() so that it is up to the callers to parse the virtio scsi request. It seems that virtio_scsi_push_event() was not modified accordingly... This patch adds a call to virtio_scsi_parse_req(). It also drops some sanity checks that are already performed by virtio_scsi_parse_req(). Signed-off-by: Greg Kurz Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 04ecfa7..3fecdca 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -565,7 +565,6 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, VirtIOSCSIReq *req; VirtIOSCSIEvent *evt; VirtIODevice *vdev = VIRTIO_DEVICE(s); - int in_size; if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) { return; @@ -577,17 +576,12 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, return; } - if (req->elem.out_num) { - virtio_scsi_bad_req(); - } - if (s->events_dropped) { event |= VIRTIO_SCSI_T_EVENTS_MISSED; s->events_dropped = false; } - in_size = iov_size(req->elem.in_sg, req->elem.in_num); - if (in_size < sizeof(VirtIOSCSIEvent)) { + if (virtio_scsi_parse_req(req, 0, sizeof(VirtIOSCSIEvent))) { virtio_scsi_bad_req(); }