On Thu, Jul 19, 2007 at 02:28:00PM +0100, Daniel P. Berrange wrote: > On Thu, Jul 19, 2007 at 06:17:29AM -0400, Daniel Veillard wrote: > > > > IMHO you should output both, then depending how you will reuse that XML > > fragment one or the other may be used, this could actually be one argument to > > split the device definition entry point and the device modification. For > > the definition you would use the vendor/product identifiers, while for example > > to simulate a disk change on an USB CDRom reader you would use device numbers. > > > > <host bus='usb'> > > <device vendor='0471' product='0311' name='Philips PCVC740K ToUcam Pro'/> > > <source dev='003.001'/> > > <target dev='001.005'/> > > </host> > > > > At the XML format you would require device or source to be present, possibly > > both and name would be an optional attribute (which need to be XML escaped). > > The name doesn't belong here. I've got a separate email to write about a way > to enumerate devices on the host - currently virt-manager just calls HAL which > obviously doesn't work for remote management. So we need an API for enumerating > physical devices - the 'name' attribute for the devices is better placed in > there, rather the duplicating in the per-VM config. Well, to me it's a way to express you want such or such functionality in a VM. I would not expect duplication in all instances. But if the user visible string can be accessed from somewhere else, fine, as I said I consider this optional. > > > Now PCI would be similar - no hotplug to worry about here though, and no > > > need (or availability) or target info. So the XML would simply be > > > > > > <host bus='pci'> > > > <source dev='00:1f.3'/> > > > </host> > > > > > > > You may still have twice the same kind of card plugged on a PCI bus > > so just vendor/product doesn't sound sufficient to me. PCI device are > > more likely to be static, I would consider vendor/product to be user > > informations, but the code would always use the device if present. > > That PCI dev ID is unique AFAIK - the 3 components uniquely identify the > PCI device encoding bus+slot or something like that - this is basically > the info from 'lspci' on Linux. Agreed you can use it as the identifier, that should not change (unless card is unplugged/replugged). Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@xxxxxxxxxx | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list