[virt-tools-list] How to load QEMU Firmware Configuration Device in virt-manager?

Pavel Hrdina phrdina at redhat.com
Tue Jun 20 10:37:35 UTC 2017


On Tue, Jun 20, 2017 at 10:57:34AM +0100, Narunas Krasauskas wrote:
> Hi Pavel,
> 
> I've found a blog post, which claims otherwise, here's excerpt from it:
> 
> The <qemu:commandline> domain XML tagThere is a special namespace for
> QEMU-specific tags in libvirt domain XML. You
> cannot use QEMU-specific tags without first declaring the namespace. To
> enable
> it use the following:
> 
> <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
> 
> 
> Now you can *add command-line arguments* to the QEMU invocation. For
> example, to load an option ROM with -option-rom:
> 
> <qemu:commandline>
>    <qemu:arg value='-option-rom'/>
>    <qemu:arg value='path/to/my.rom'/>
> </qemu:commandline>
> 
> 
> It is also possible to *add environment variables* to the QEMU invocation:
> 
> <qemu:commandline>
>    <qemu:env name='MY_VAR' value='my_value'/>
> </qemu:commandline>
> 
> 
> 
> Can you please comment regarding this approach?

This is only for testing purposes and they are unsupported so you are on
your own :) [1].  So if you think that this is a valid feature and could
be useful, you should create a new bug to track it and give it a chance
to have it properly implemented in libvirt and
virt-manager/virt-install/virt-xml.

Anyway, it's possible to set this only via virt-xml/virt-install, this
will never be implemented into the virt-manager GUI.

Refer to man virt-xml and man virt-install and look for
"qemu-commandline".

TL;DR this should work for you:

when installing new guest using virt-install:

    virt-install ... --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=some/file.json"

or to modify existing domain:

    virt-xml DOMAIN-NAME --edit --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=some/file.json"

Pavel

[1] <http://libvirt.org/drvqemu.html#qemucommand>

> 
> 
> Regards
> 
> Narunas
> 
> 
> 
> 
> On Tue, Jun 20, 2017 at 10:44 AM, Pavel Hrdina <phrdina at redhat.com> wrote:
> 
> > On Tue, Jun 20, 2017 at 10:20:01AM +0100, Narunas Krasauskas wrote:
> > > Is there a way to load *fw_cfg* file in *virt-manager* (v1.4.1)?
> > >
> > > On the plain *QEMU* command line I can do it like so:
> > >
> > > -fw_cfg name=opt/com.coreos/config,file=some/file.json
> > >
> > > I cannot find equivalent option in the *virt-manager*.
> > >
> > > Thanks, Narunas
> >
> > Hi, no there is no way to use *fw_cfg* in virt-manager.  Virt-manager
> > controls libvirt an this is not even implemented in libvirt.
> >
> > To allow setting it via virt-manager/virt-xml/virt-install it needs
> > to be implemented in libvirt as well.
> >
> > Feel free to create a Bug to track this feature, both libvirt and
> > virt-manager uses this site to track bugs [1].  As a product you should
> > select "Virtualization Tools" and component is libvirt or virt-manager.
> >
> > Pavel
> >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20170620/0bfcdacf/attachment.sig>


More information about the virt-tools-list mailing list