Thanks, that's very helpful.

On 9/4/2013 10:36 PM, hongming wrote:


On 08/28/2013 05:25 AM, Brian Rak wrote:
If I'm using the SR-IOV Pool assignment method (from http://wiki.libvirt.org/page/Networking#Assignment_from_a_pool_of_SRIOV_VFs_in_a_libvirt_.3Cnetwork.3E_definition ), how would I check how many virtual functions are already in use?

Hi Brian

Hope the following can help you.


[root@sriov2 images]# virsh net-dumpxml hostnet
<network>
  <name>hostnet</name>
  <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid>
  <forward mode='hostdev' managed='yes'>
    <pf dev='eth2'/>
  </forward>
</network>

[root@sriov2 images]# virsh start r6
Domain r6 started

[root@sriov2 images]# virsh attach-device r6 vfpool.xml
Device attached successfully

[root@sriov2 images]# virsh attach-device r6 vfpool.xml
Device attached successfully

[root@sriov2 images]# virsh net-dumpxml hostnet
<network connections='2' <=====the value of connections means how many VFs in the pool are using.
  <name>hostnet</name>
  <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid>
  <forward mode='hostdev' managed='yes'>
    <pf dev='eth2'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x0'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x2'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x4'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x10' function='0x6'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x11' function='0x0'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x11' function='0x2'/>
    <address type='pci' domain='0x0000' bus='0x0f' slot='0x11' function='0x4'/>
  </forward>
</network>



Is there a method other then looping through all the active guests and determining if they're using the SR-IOV interface?

[root@sriov2 images]# virsh dumpxml r6|grep interface -A 4
    <interface type='network'>
      <mac address='52:54:00:0a:16:28'/>
      <source network='hostnet'/>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:08:62:66'/>
      <source network='hostnet'/>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>

_______________________________________________
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users