qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 30/30] virtio: Convert exit to unrealize


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PULL 30/30] virtio: Convert exit to unrealize
Date: Thu, 19 Dec 2013 16:32:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 19/12/2013 16:25, Stefan Hajnoczi ha scritto:
> On Mon, Dec 9, 2013 at 9:48 PM, Paolo Bonzini <address@hidden> wrote:
>> From: Andreas Färber <address@hidden>
>>
>> Signed-off-by: Andreas Färber <address@hidden>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>> ---
>>  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)
> --- 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},
> "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!

Ugh, that's a rebase snafu. :(  I'll send a patch tomorrow.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]