From patchwork Fri Jan 15 16:04:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8043101 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95CD7BEEE5 for ; Fri, 15 Jan 2016 16:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAA762041A for ; Fri, 15 Jan 2016 16:11:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA83F2040F for ; Fri, 15 Jan 2016 16:11:44 +0000 (UTC) Received: from localhost ([::1]:47850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6yW-0003js-56 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 11:11:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6rt-0007pf-Mp for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:04:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK6rn-0003JN-PP for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:04:53 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:34190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6rn-0003J7-7N for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:04:47 -0500 Received: by mail-wm0-x22b.google.com with SMTP id u188so28955778wmu.1 for ; Fri, 15 Jan 2016 08:04:47 -0800 (PST) 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=aFcPDMkW+1+zK20FccR0X573rFgJpnOvLtd2QNbU4HM=; b=dZCUc7j+kkqUcSvHyNShmwYuSluQBJyfi7fDdgZMz6mkJ+YZrTpiilIlEz0OjhmM8c zujJaPMD8HqOGEv46P7uOnkh2y4cKPqbcnTPQhgjonvR6OhpUpLUkUo12Hw9AR3F2N/r eWIkRq/aPi7WYSN8BpChI2Ds2Fpr9oLxSN1hmhytFssY+yF9IBQUrpM08FlMaG7Na8vz nN0FRz1bbzF/+ipGtsQlfXQa28OONPpIasbCP1YWjZT1t7lC2szopWYgQZdDFgvoFGJf BffO0sauCh3yCL+T3X8RKvlkCWJH/rbkeg7rHOJs18qyvXnG1ZKahIhQJ7cvLTCf7v7w bpJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=aFcPDMkW+1+zK20FccR0X573rFgJpnOvLtd2QNbU4HM=; b=kDPoqDU9beiRhSPtNKVG4kGpcuRHc4nNZ2Qa+PIrYp2fpFmSHj+eA0QRES3pJLxvPE gjYBroilubUxc9pqOeGBf3JsSCS54WmDi4DOxuEb7i6JILK2YG8LkOendzf0GJPR/Kfe XUugtyJSM1HX7J5kMZLGmaMpof27srA/ojpEZx9CXVv2Pyzj+ljmCkr6yzoqRREa5WN+ 7aqeLacDG5C0beRH1gt45C54jjbuX7r7a23++kSRacOjsXC6b3QFHsOtfmUUctDOvIOv /lGn4z8EGH+G9BUl4qrFLJ6/qHZKJBv5YWInExTsbrJd3HiwdfzEozZBdtYnP4HABQHI 51Mw== X-Gm-Message-State: AG10YOT5RISLn4TCe6K/r+yY7y4wNI2h7MWRH21bl/jUblJ/78wrimuO35gxqyexzpn2iA== X-Received: by 10.28.64.131 with SMTP id n125mr3942927wma.65.1452873886656; Fri, 15 Jan 2016 08:04:46 -0800 (PST) Received: from 640k.lan (94-39-195-126.adsl-ull.clienti.tiscali.it. [94.39.195.126]) by smtp.gmail.com with ESMTPSA id c15sm3103036wmd.19.2016.01.15.08.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2016 08:04:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 15 Jan 2016 17:04:24 +0100 Message-Id: <1452873871-138914-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1452873871-138914-1-git-send-email-pbonzini@redhat.com> References: <1452873871-138914-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b Cc: Cao jin Subject: [Qemu-devel] [PULL 08/15] SCSI device: fix to incomplete QOMify 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Cao jin Signed-off-by: Cao jin Acked-by: Michael S. Tsirkin Message-Id: <1452073066-28319-1-git-send-email-caoj.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini --- hw/scsi/megasas.c | 12 ++++++------ hw/scsi/scsi-bus.c | 4 ++-- hw/scsi/virtio-scsi.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 576f56c..60c0e6c 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -744,7 +744,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) info.device.type = MFI_INFO_DEV_SAS3G; info.device.port_count = 8; QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); uint16_t pd_id; if (num_pd_disks < 8) { @@ -960,7 +960,7 @@ static int megasas_dcmd_pd_get_list(MegasasState *s, MegasasCmd *cmd) max_pd_disks = MFI_MAX_SYS_PDS; } QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); uint16_t pd_id; if (num_pd_disks >= max_pd_disks) @@ -1136,7 +1136,7 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd) max_ld_disks = MFI_MAX_LD; } QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); if (num_ld_disks >= max_ld_disks) { break; @@ -1187,7 +1187,7 @@ static int megasas_dcmd_ld_list_query(MegasasState *s, MegasasCmd *cmd) max_ld_disks = MFI_MAX_LD; } QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); if (num_ld_disks >= max_ld_disks) { break; @@ -1327,7 +1327,7 @@ static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd) ld_offset = array_offset + sizeof(struct mfi_array) * num_pd_disks; QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); uint16_t sdev_id = ((sdev->id & 0xFF) << 8) | (sdev->lun & 0xFF); struct mfi_array *array; struct mfi_ld_config *ld; @@ -2237,7 +2237,7 @@ static void megasas_soft_reset(MegasasState *s) * after the initial reset. */ QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + SCSIDevice *sdev = SCSI_DEVICE(kid->child); sdev->unit_attention = SENSE_CODE(NO_SENSE); scsi_device_unit_attention_reported(sdev); diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 378bf4d..164af87 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1861,7 +1861,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense) static char *scsibus_get_dev_path(DeviceState *dev) { - SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev); + SCSIDevice *d = SCSI_DEVICE(dev); DeviceState *hba = dev->parent_bus->parent; char *id; char *path; @@ -2034,7 +2034,7 @@ static void scsi_device_class_init(ObjectClass *klass, void *data) static void scsi_dev_instance_init(Object *obj) { DeviceState *dev = DEVICE(obj); - SCSIDevice *s = DO_UPCAST(SCSIDevice, qdev, dev); + SCSIDevice *s = SCSI_DEVICE(dev); device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", NULL, diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 3a4f520..607593c 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -352,7 +352,7 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req) target = req->req.tmf.lun[1]; s->resetting++; QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { - d = DO_UPCAST(SCSIDevice, qdev, kid->child); + d = SCSI_DEVICE(kid->child); if (d->channel == 0 && d->id == target) { qdev_reset_all(&d->qdev); }