From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 2/2] S390: Add virtio hotplug add support Date: Tue, 24 Aug 2010 09:13:24 +0200 Message-ID: <4C737114.60606@de.ibm.com> References: <1282599077-29857-1-git-send-email-agraf@suse.de> <1282599077-29857-2-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: virtualization@lists.linux-foundation.org, Rusty Russell , Christian Ehrhardt , Carsten Otte , KVM list To: Alexander Graf Return-path: Received: from mtagate5.de.ibm.com ([195.212.17.165]:45943 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555Ab0HXHN3 (ORCPT ); Tue, 24 Aug 2010 03:13:29 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.1/8.13.1) with ESMTP id o7O7DSgU030275 for ; Tue, 24 Aug 2010 07:13:28 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7O7DSFF3874920 for ; Tue, 24 Aug 2010 09:13:28 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o7O7DRWA014460 for ; Tue, 24 Aug 2010 09:13:27 +0200 In-Reply-To: <1282599077-29857-2-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Am 23.08.2010 23:31, schrieb Alexander Graf: > The one big missing feature in s390-virtio was hotplugging. This is no more. > This patch implements hotplug add support, so you can on the fly add new devices > in the guest. Nice :-) > Keep in mind that this needs a patch for qemu to actually leverage the > functionality. > > Signed-off-by: Alexander Graf With the minor nits below fixed: Acked-by: Christian Borntraeger > #define VIRTIO_PARAM_MASK 0xff > #define VIRTIO_PARAM_VRING_INTERRUPT 0x0 > #define VIRTIO_PARAM_CONFIG_CHANGED 0x1 > +#define VIRTIO_PARAM_DEV_ADD 0x2 See the other patch. This becomes an interface and should go into a header file. > > /* > * The pointer to our (page) of device descriptions. > */ > static void *kvm_devices; > +struct work_struct hotplug_work; > > struct kvm_device { > struct virtio_device vdev; > @@ -331,6 +333,47 @@ static void scan_devices(void) > } > > /* > + * match for a kvm device with a specific desc pointer > + */ > +static int match_desc(struct device *dev, void *data) > +{ > + if ((ulong)to_kvmdev(dev_to_virtio(dev))->desc == (ulong)data) ulong doesnt look like kernel coding style.