<div dir="ltr">Thanks for the quick response. I was able to use udev to control the names in the guest. Reg patch, i am new to this codebase and sure if you give me pointers on which file to look into I can give it a shot.<div><br></div><div>Thanks</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 4, 2019 at 2:35 PM 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 4/4/19 2:02 PM, PR PR wrote:<br>
> Hi,<br>
> <br>
> I am creating a guest with following description for interfaces in the <br>
> xml using virsh create xml command. For some reason, the guest interface <br>
> names in the VM dont match the names specified in the xml. Is there a <br>
> way to make guest interface names predictable?<br>
<br>
For qemu (which you've indicating you're using) there isn't any way to <br>
set the name of the network device in the guest from the libvirt config. <br>
There is no visibility of the <guest dev='xxx'> element into the guest <br>
OS; all that the guest can know is that there is an e1000 ethernet <br>
device plugged into PCI bus 0 slot 3, and it has MAC address <br>
52:54:00:17:0b:e7. Any determination of name must be done within the <br>
guest OS.<br>
<br>
The <guest dev='blah'> element is only used by the LXC and openvz <br>
drivers. It really should be flagged as an error during validation for <br>
other drivers (patches welcome :-).<br>
<br>
<br>
> <br>
> Following is the qemu version on host<br>
> <br>
> dpkg --list | grep -i qemu<br>
> ii  qemu-kvm                              1:2.11+dfsg-1ubuntu7.10        <br>
>          amd64        QEMU Full virtualization on x86 hardware<br>
> <br>
>      <interface type='user'><br>
>        <mac address='52:54:00:17:0b:e7'/><br>
>        <guest dev='eth0'/><br>
>        <model type='e1000'/><br>
>        <alias name='net0'/><br>
>        <address type='pci' domain='0x0000' bus='0x00' slot='0x03' <br>
> function='0x0'/><br>
>      </interface><br>
>      <interface type='ethernet'><br>
>        <mac address='52:54:00:ee:70:34'/><br>
>        <target dev='net0'/><br>
>        <guest dev='Ethernet0'/><br>
>        <model type='rtl8139'/><br>
>        <alias name='net1'/><br>
>        <address type='pci' domain='0x0000' bus='0x00' slot='0x05' <br>
> function='0x0'/><br>
>      </interface><br>
> <br>
> Thanks<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>