From patchwork Thu Dec 19 15:25:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 303576 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 9DC122C0085 for ; Fri, 20 Dec 2013 02:25:53 +1100 (EST) Received: from localhost ([::1]:44856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtfTx-0002dK-R2 for incoming@patchwork.ozlabs.org; Thu, 19 Dec 2013 10:25:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtfTK-0002d8-76 for qemu-devel@nongnu.org; Thu, 19 Dec 2013 10:25:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtfTF-0004sR-77 for qemu-devel@nongnu.org; Thu, 19 Dec 2013 10:25:10 -0500 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:65483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtfTE-0004pQ-VZ for qemu-devel@nongnu.org; Thu, 19 Dec 2013 10:25:05 -0500 Received: by mail-ob0-f177.google.com with SMTP id vb8so1267886obc.8 for ; Thu, 19 Dec 2013 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=hlu3tpnAgAQlu34DMTrFu8pL464AIeHEWM4wHkZgFQw=; b=bd48s/fFl+0IAFdoDKtbUliYsEajs3uLgTXwG1cTTGq5ypEdAWeSuiMLl+ZCx9u9YG ykL4o5i98T+wPBkNVzD16xdd6rDwEF1IF262pGUFwLX0nzGQ0zAdIKVegDy/hcy8b2I5 LNJAXllmfOddNA1H2k8xoIQ6KbPw6Vl0ypUeSVb5ApGMX9dUIrlz3eR2Ud37UkqRIiOz l1729gWngdb+gdVnU5brO5O5XdFhrPR2g/vMQUVsUoabuk2NEW0B0X05AS5Ev9/8lPtb wibAqUqyl1OCHtC6UlHbNViL/mypR9jeqZqbwMDh6Ps0lXKfM+oRA+5EOc9Jnc9gKLyv 2RqA== MIME-Version: 1.0 X-Received: by 10.182.146.104 with SMTP id tb8mr1652613obb.54.1387466703834; Thu, 19 Dec 2013 07:25:03 -0800 (PST) Received: by 10.76.74.135 with HTTP; Thu, 19 Dec 2013 07:25:03 -0800 (PST) In-Reply-To: <1386622112-27257-31-git-send-email-pbonzini@redhat.com> References: <1386622112-27257-1-git-send-email-pbonzini@redhat.com> <1386622112-27257-31-git-send-email-pbonzini@redhat.com> Date: Thu, 19 Dec 2013 16:25:03 +0100 Message-ID: From: Stefan Hajnoczi To: =?ISO-8859-1?Q?Andreas_F=E4rber?= X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::231 Cc: Cornelia Huck , Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel , =?ISO-8859-1?Q?Andreas_F=E4rber?= Subject: Re: [Qemu-devel] [PULL 30/30] virtio: Convert exit to unrealize 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 On Mon, Dec 9, 2013 at 9:48 PM, Paolo Bonzini wrote: > From: Andreas Färber > > Signed-off-by: Andreas Färber > Signed-off-by: Paolo Bonzini > --- > hw/block/virtio-blk.c | 10 ++++++---- > hw/char/virtio-serial-bus.c | 9 +++++---- > hw/net/virtio-net.c | 9 +++++---- > hw/scsi/vhost-scsi.c | 11 ++++++----- > hw/scsi/virtio-scsi.c | 17 +++++++++-------- > hw/virtio/virtio-balloon.c | 9 +++++---- > hw/virtio/virtio-rng.c | 9 +++++---- > hw/virtio/virtio.c | 13 ++++++++----- > include/hw/virtio/virtio-scsi.h | 2 +- > include/hw/virtio/virtio.h | 2 +- > 10 files changed, 51 insertions(+), 40 deletions(-) This commit breaks qemu-iotests 067: 067 1s ... - output mismatch (see 067.out.bad) "event": "RESET"} -{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]} +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}} > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 1dba284..144b9ca 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -1169,12 +1169,15 @@ static void virtio_device_realize(DeviceState *dev, Error **errp) > static void virtio_device_unrealize(DeviceState *dev, Error **errp) > { > VirtIODevice *vdev = VIRTIO_DEVICE(dev); > - VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(dev); > - > - virtio_bus_device_unplugged(vdev); > + VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev); > + Error *err = NULL; > > - if (k->exit != NULL) { > - k->exit(vdev); > + if (vdc->unrealize != NULL) { > + vdc->unrealize(dev, &err); > + if (err != NULL) { > + error_propagate(errp, err); > + return; > + } > } We no longer call virtio_bus_device_unplugged(dev). I don't see it called from anywhere else in the codebase! Stefan --- 067.out 2013-12-11 09:44:01.509447778 +0100 +++ 067.out.bad 2013-12-19 16:02:39.582984141 +0100 @@ -12,7 +12,7 @@ {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/virtio0/virtio-backend"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_DELETED", "data": {"device": "virtio0", "path": "/machine/peripheral/virtio0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},