From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43189 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OntuK-0005Uh-2s for qemu-devel@nongnu.org; Tue, 24 Aug 2010 09:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OntuI-00049M-Jw for qemu-devel@nongnu.org; Tue, 24 Aug 2010 09:51:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63480) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OntuI-00049A-E0 for qemu-devel@nongnu.org; Tue, 24 Aug 2010 09:51:18 -0400 Date: Tue, 24 Aug 2010 14:51:05 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH 4/5] Add generic drive hotplugging Message-ID: <20100824135105.GN7376@redhat.com> References: <1282600951-30803-1-git-send-email-agraf@suse.de> <1282600951-30803-5-git-send-email-agraf@suse.de> <20100824093155.GB7376@redhat.com> <4C73A2BF.2050605@suse.de> <20100824105154.GH7376@redhat.com> <4C73CBC9.4050602@suse.de> <20100824134446.GM7376@redhat.com> <4C73CD26.90408@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C73CD26.90408@suse.de> Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Markus Armbruster , Luiz Capitulino , qemu-devel List , Aurelien Jarno , Gerd Hoffmann On Tue, Aug 24, 2010 at 03:46:14PM +0200, Alexander Graf wrote: > Daniel P. Berrange wrote: > > On Tue, Aug 24, 2010 at 03:40:25PM +0200, Alexander Graf wrote: > > > >> Daniel P. Berrange wrote: > >> > >>> On Tue, Aug 24, 2010 at 12:45:19PM +0200, Alexander Graf wrote: > >>> > >>>>> The key is that you should use if=none for all cases. Here are two > >>>>> examples of how libvirt does it currently: > >>>>> > >>>>> VirtIO: > >>>>> > >>>>> drive_add dummy file=/var/lib/libvirt/images/data.img,if=none,id=drive-virtio-disk1,format=raw > >>>>> device_add virtio-blk-pci,bus=pci.0,addr=0x0,drive=drive-virtio-disk1,id=virtio-disk1' > >>>>> > >>>>> SCSI: > >>>>> > >>>>> drive_add dummy file=/var/lib/libvirt/images/data.img,if=none,id=drive-scsi0-0-1,format=raw' > >>>>> device_add scsi-disk,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1 > >>>>> > >>>>> The 'dummy' value there can be absolutely anything you want. > >>>>> It is totaly ignored when QEMU sees if=none in 2nd arg. > >>>>> > >>>>> > >>>>> > >>>> I'd be all for removing the pci-hotplug.c version of drive_add then. But > >>>> I think the IF_SCSI option there is to append a drive to an existing > >>>> SCSI bus, no? > >>>> > >>>> > >>> Actually this SCSI example I give above is appending a drive to an existing > >>> bus (scsi0), in slot 1 (scsi-id=1). To best of my knowledge there is no > >>> remaining use case that requires use of IF_SCSI, IF_IDE, etc. The IF_NONE > >>> approach can cope with all, modulo bugs that appear periodically with code > >>> that mistakenly checks for a particular IF_XXX constant. > >>> > >>> If you wanted to also create a new SCSI bus, before creating the drive on > >>> it, you'd need to run three commands in total: > >>> > >>> device_add lsi,id=scsi0,bus=pci.0,addr=0x7 > >>> drive_add dummy file=/var/lib/libvirt/images/data.img,if=none,id=drive-scsi0-0-1,format=raw > >>> device_add scsi-disk,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1 > >>> > >>> > >> Nice - so we can just deprecate if=!none? > >> > > > > In theory yes, but its not nice to tell users to switch everything over to > > use if=none, if we're going to deprecate that too in the next release when > > blockdev appears. Might as well just deprecate entire of drive_add/-drive > > at once. > > > > I guess I still fail to see the reason for blockdev when we force > drive_add to if=none... Markus can no doubt explain better than me, but off the top of my head - 'drive' has guest properties that should be against the device not the drive which is for host properties (eg serial=, if=) - 'file' is mangled to include protocol/format which means that it can't be unambigously parsed. (eg filenames containing :) Fixing those, particularly the latter, would breaks back-compat so we really need a new arg with sensible definition. This is what blockdev is intended todo (as well as a internal code cleanup) Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|