Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora/Linux Management Tools (http://www.linux-archive.org/fedora-linux-management-tools/)
-   -   virt-install: support host device assignment (http://www.linux-archive.org/fedora-linux-management-tools/255205-virt-install-support-host-device-assignment.html)

Cole Robinson 03-02-2009 03:41 AM

virt-install: support host device assignment
 
The following patches add support for host device assignment to virtinst
and virt-install.

The patches aren't complete, since I'm not entirely sure how managed or
unmanaged devices coincide with HostDeviceDetach and HostDeviceReset,
and how this relates to PCI vs. USB. But it shouldn't be a big change
from what's posted.

The patches are:

01 - Support for parsing libvirt nodedev xml
02 - Support for building domain 'hostdev' device xml
03 - virt-install --host-device option

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

"Daniel P. Berrange" 03-02-2009 07:32 AM

virt-install: support host device assignment
 
On Sun, Mar 01, 2009 at 11:41:11PM -0500, Cole Robinson wrote:
> The following patches add support for host device assignment to virtinst
> and virt-install.
>
> The patches aren't complete, since I'm not entirely sure how managed or
> unmanaged devices coincide with HostDeviceDetach and HostDeviceReset,
> and how this relates to PCI vs. USB. But it shouldn't be a big change
> from what's posted.

If 'managed=yes' then libvirt will automatically detach the device
from the host driver. This is nice & simple, but also nice & easy
to shoot yourself in the foot - don't mix up the PCI id for the NIC
you want to pasthrough with your SATA controller ;-)

If 'managed=no' then libvirt expects that the caller has already ensured
the device is detached from the host before *ALL* attempts to start the
guest, now & in the future. The app can use HostDeviceDetach todo this
but remember it has to be manually run every time, which probably is not
what you want. The more likely case for using managed=no, is if you have
statically assigned the PCI device ID to pcistub.ko in /etc/modprobe.conf
so that is guarenteed detached from the moment you boot.

I'd strongly recommend virt-install only use managed=yes, and don't make
the use pick PCI ids off the list, rather present them with the human
readable vendor and product names. When picking PCI devices you can
also use the node device APIs to query for any other devices which are
children of that PCI device - so if there are 2 identical NICs in the
machine, you can show the user that one is eth0 and the other is eth1
to help them pick the right one.

Regards,
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

Cole Robinson 03-02-2009 09:50 PM

virt-install: support host device assignment
 
Daniel P. Berrange wrote:
> On Sun, Mar 01, 2009 at 11:41:11PM -0500, Cole Robinson wrote:
>> The following patches add support for host device assignment to virtinst
>> and virt-install.
>>
>> The patches aren't complete, since I'm not entirely sure how managed or
>> unmanaged devices coincide with HostDeviceDetach and HostDeviceReset,
>> and how this relates to PCI vs. USB. But it shouldn't be a big change
>> from what's posted.
>
> If 'managed=yes' then libvirt will automatically detach the device
> from the host driver. This is nice & simple, but also nice & easy
> to shoot yourself in the foot - don't mix up the PCI id for the NIC
> you want to pasthrough with your SATA controller ;-)
>
> If 'managed=no' then libvirt expects that the caller has already ensured
> the device is detached from the host before *ALL* attempts to start the
> guest, now & in the future. The app can use HostDeviceDetach todo this
> but remember it has to be manually run every time, which probably is not
> what you want. The more likely case for using managed=no, is if you have
> statically assigned the PCI device ID to pcistub.ko in /etc/modprobe.conf
> so that is guarenteed detached from the moment you boot.
>
> I'd strongly recommend virt-install only use managed=yes, and don't make
> the use pick PCI ids off the list, rather present them with the human
> readable vendor and product names. When picking PCI devices you can
> also use the node device APIs to query for any other devices which are
> children of that PCI device - so if there are 2 identical NICs in the
> machine, you can show the user that one is eth0 and the other is eth1
> to help them pick the right one.
>

Thanks. I updated patch 2 to attempt a Detach and Reset simply as a
sanity check (so if adding a PCI device via virt-manager the user can
find out it will fail at attach time, rather then the next VM boot).

- Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

Cole Robinson 03-03-2009 08:51 PM

virt-install: support host device assignment
 
Cole Robinson wrote:
> The following patches add support for host device assignment to virtinst
> and virt-install.
>
> The patches aren't complete, since I'm not entirely sure how managed or
> unmanaged devices coincide with HostDeviceDetach and HostDeviceReset,
> and how this relates to PCI vs. USB. But it shouldn't be a big change
> from what's posted.
>
> The patches are:
>
> 01 - Support for parsing libvirt nodedev xml
> 02 - Support for building domain 'hostdev' device xml
> 03 - virt-install --host-device option
>

I've committed this series with the updated 02 and 03.

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


All times are GMT. The time now is 12:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.