<div dir="ltr"><div dir="ltr">Thanks-- i get this eco-system setup isn't mainstream (yet).  just wanted to double check to see if there was some pre-existing way to use the function aspect.  <div><br></div><div>B</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 2, 2019 at 9:29 AM Laine Stump <<a href="mailto:laine@redhat.com">laine@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/26/18 6:59 PM, b f31415 wrote:<br>
> Thanks.  Maybe I'm missing something but when I try virt-install <br>
> --dry-run --print-xml it generates this snippet of XML:<br>
> <br>
> <interface type="bridge"><br>
> <br>
> <source bridge="ge_0_0_0_77"/><br>
> <br>
> <mac address="52:54:00:01:00:4e"/><br>
> <br>
> <model type="virtio"/><br>
> <br>
> </interface><br>
> <br>
> <br>
> but what i need (and get from virsh dumpxml) has this extra PCI line.<br>
> <br>
> <interface type='bridge'><br>
> <br>
> <mac address='52:54:00:01:00:4e'/><br>
> <br>
> <source bridge='ge_0_0_0_77'/><br>
> <br>
> <target dev='vnet78'/><br>
> <br>
> <model type='virtio'/><br>
> <br>
> <alias name='net78'/><br>
> <br>
> <address type='pci' domain='0x0000' bus='0x01' slot='0x0a' function='0x6' /><br>
> <br>
> </interface><br>
> <br>
> <br>
> Did I miss something?  Do you see PCI in the XML when you do the <br>
> virt-install --dryrun approach?<br>
<br>
virt-install never explicitly specifies a PCI address in the XML it <br>
creates and sends to libvirt, and what you're seeing as the output from <br>
--print-xml is the XML before it has been sent to libvirt.<br>
<br>
Additionally, in response to a question in the original mail, there is <br>
no way to tell virt-install (or libvirt itself) to use non-0 functions <br>
for devices (except to manually specify the entire PCI address).<br>
<br>
Since 99 44/100% of users (probably much higher, but that number has <br>
such a nice ring to anyone who recalls the old Ivory Soap commercials <br>
:-) never need more devices than are possible using only function 0, <br>
there has been no effort made to automate assignment of non-0 functions.<br>
<br>
So if you need this many devices, you should probably consider just <br>
using virt-install once to generate proto-template XML, then "virsh <br>
define" that template to get an XML that has an <address...> element for <br>
every device that needs it, write a script that condenses all the device <br>
PCI addresses into less slots by using non-0 functions (and saves that <br>
as the "final" template), and finally modify your installation to do a <br>
series of virsh commands using that template XML as a start.<br>
<br>
<br>
I know it sounds awkward, but there is really nothing in libvirt or <br>
virt-install to automate assignment of PCI devices to non-0 functions.<br>
<br>
<br>
> On Wed, Dec 26, 2018 at 2:57 PM Peter Crowther <br>
> <<a href="mailto:peter.crowther@melandra.com" target="_blank">peter.crowther@melandra.com</a> <mailto:<a href="mailto:peter.crowther@melandra.com" target="_blank">peter.crowther@melandra.com</a>>> wrote:<br>
> <br>
>     On Wed, 26 Dec 2018 at 16:26, b f31415 <<a href="mailto:bf31415@gmail.com" target="_blank">bf31415@gmail.com</a><br>
>     <mailto:<a href="mailto:bf31415@gmail.com" target="_blank">bf31415@gmail.com</a>>> wrote:<br>
> <br>
>         If not, is there a way with one of the virt command line tools<br>
>         to create the XML (with the PCI addresses specified) so that I<br>
>         can process that XML and re-write the PCI addressing values? <br>
>         Right now the only way I’ve been able to get that detailed XML<br>
>         file is to 1) virt-install and let the VM begin the boot process<br>
>         and then do a 2) virsh dumpxml and then 3) virsh<br>
>         destroy/undefine that VM, 4) modify the XML and then 5) virsh<br>
>         create ./modified.xml.  Is there a cleaner way to do this?<br>
> <br>
> <br>
>     It won't do everything you want, but check out virt-install<br>
>     --print-step --dry-run.  This should at least allow you to get at<br>
>     the XML for the intermediate steps and remove the brittleness of<br>
>     defining, destroying, undefining the VM.<br>
> <br>
>     Cheers,<br>
> <br>
>     - Peter<br>
> <br>
> <br>
> _______________________________________________<br>
> libvirt-users mailing list<br>
> <a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
> <br>
<br>
</blockquote></div></div>