________________________________
From: Peter Krempa <[email protected]>
Sent: Tuesday, March 30, 2021 01:42 PM
To: Waleed Musa <[email protected]>
Cc: [email protected] <[email protected]>; Moshe Levi 
<[email protected]>; Adrian Chiris <[email protected]>
Subject: Re: [Libvirt] Attach qemu commands to an running xml domain

External email: Use caution opening links or attachments


On Tue, Mar 30, 2021 at 09:35:48 +0000, Waleed Musa wrote:
> Hi all,
>
> I see in libvirt you are supporting attach/detach devices to existing xml 
> domain using attachDeviceFlags and detachDeviceFlags APIs.
> Now we are adding some qemu command to the xml domain related to some 
> interfaces using alias names before starting the VM, but we will face an 
> issue with hot plug such devices, so I have two question here:
>
>   1.  Is it applicable to set the alias names for interfaces because I saw 
> it's ignored when I add it to xml domain before starting the VM?

User specified aliases are possible with 'ua-' prefix:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.libvirt.org%2Fformatdomain.html%23devices&amp;data=04%7C01%7Cwaleedm%40nvidia.com%7C72e7134a4ea6450695c108d8f368917a%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C1%7C637526977746721327%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=xPxNJBFbsO4BFB3zkTGR4W9AruwHttjKOxYVyxF9XpI%3D&amp;reserved=0
> Thanks, I'll try it

>   2.  Is there a way or API to attach qemu commands to running domain as you 
> are doing in attaching the device using  attachDeviceFlags?

No. For VMs which use <qemu:commandline> we don't formally provide
support. I suggest that if you have a good use case for the attributes
below, you send patches adding the functionality to libvirt if you want
to have it on device hotplug.
> We can't implement hot-plug
>
> Example of my xml
> <domain type='kvm' id='5' 
> xmlns:qemu='https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibvirt.org%2Fschemas%2Fdomain%2Fqemu%2F1.0&amp;data=04%7C01%7Cwaleedm%40nvidia.com%7C72e7134a4ea6450695c108d8f368917a%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C1%7C637526977746721327%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=AK2tXXVGhKiJgFOZyKwiVOcOKCU49jSscbwQduaXSww%3D&amp;reserved=0'>
>   <devices>
>     <interface type='vhostuser'>
>       <mac address='fa:16:3e:ac:12:4c'/>
>       <source type='unix' path='/var/lib/vhost_sockets/sockbbb6bbe9-eb5' 
> mode='server'/>
>       <target dev='tapbbb6bbe9-eb'/>
>       <model type='virtio'/>
>       <driver queues='4' rx_queue_size='512' tx_queue_size='512'/>
>       <alias name='net0'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
> function='0x0'/>
>     </interface>
>   </devices>
>   <qemu:commandline>
>     <qemu:arg value='-set'/>
>     <qemu:arg value='device.net0.page-per-vq=on'/>
>     <qemu:arg value='-set'/>
>     <qemu:arg value='device.net0.host_mtu=8942'/>
>   </qemu:commandline>
> </domain>
>
>
> Regards,
> Waleed Mousa
> Software Engineer,
> Nvidia <https://www.nvidia.com/en-me/geforce/>
>

Reply via email to