Received: from eggs.gnu.org ([2001:4830:134:3::10]:44880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Dok-0004H7-Fo for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Doe-0004KO-8U for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:10 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:33033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Dod-0004Iw-VL for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:04 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jun 2015 19:55:02 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id EC2BD17D805D for ; Wed, 3 Jun 2015 19:55:58 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t53It0Mw24838362 for ; Wed, 3 Jun 2015 18:55:00 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t53Isxjd005606 for ; Wed, 3 Jun 2015 12:55:00 -0600 From: Christian Borntraeger Date: Wed, 3 Jun 2015 20:55:19 +0200 Message-Id: <1433357720-75778-3-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1433357720-75778-1-git-send-email-borntraeger@de.ibm.com> References: <1433357720-75778-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 2/3] virtio-ccw/migration: Migrate config vector for virtio devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: "Michael S. Tsirkin" , Alexander Graf , Christian Borntraeger , Jens Freimann , "Jason J. Herne" , Cornelia Huck , Sascha Silbe From: "Jason J. Herne" virtio_ccw_{save|load}_config are missing code to save and restore a vdev's config_vector value. This causes some virtio devices to become disabled following a migration. This patch fixes a bug whereby the qmp/hmp balloon command (virsh setmem) silently fails to update the guest's available memory because the device was not properly migrated. This will break compatibility, but vmstate_s390_cpu was bumped from version 2 to version 4 between v2.3.0 and v2.4.0 without a compat handler. Furthermore, there is no production environment yet so migration is fenced anyway between any relevant version of 2.3 and 2.4. Signed-off-by: Jason J. Herne Message-Id: <1433343843-803-1-git-send-email-jjherne@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Christian Borntraeger --- hw/s390x/virtio-ccw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index ab629fe..ab5fc7f 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1311,6 +1311,7 @@ static void virtio_ccw_save_config(DeviceState *d, QEMUFile *f) { VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); SubchDev *s = dev->sch; + VirtIODevice *vdev = virtio_ccw_get_vdev(s); subch_device_save(s, f); if (dev->indicators != NULL) { @@ -1334,6 +1335,7 @@ static void virtio_ccw_save_config(DeviceState *d, QEMUFile *f) qemu_put_be32(f, 0); qemu_put_be64(f, 0UL); } + qemu_put_be16(f, vdev->config_vector); qemu_put_be64(f, dev->routes.adapter.ind_offset); qemu_put_byte(f, dev->thinint_isc); } @@ -1342,6 +1344,7 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f) { VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); SubchDev *s = dev->sch; + VirtIODevice *vdev = virtio_ccw_get_vdev(s); int len; s->driver_data = dev; @@ -1367,6 +1370,7 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f) qemu_get_be64(f); dev->summary_indicator = NULL; } + qemu_get_be16s(f, &vdev->config_vector); dev->routes.adapter.ind_offset = qemu_get_be64(f); dev->thinint_isc = qemu_get_byte(f); if (s->thinint_active) { -- 2.3.0