Re: [PATCH 3/7] qemu: domain: Add XML namespace code for overriding device config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 21, 2022 at 04:24:36PM +0100, Peter Krempa wrote:
> Implement the XML parser and formatter for overriding of device
> properties such as:
> 
>   <qemu:deviceOverride>

s/deviceOverride/devices/ 

>     <qemu:device alias='ua-disk'>
>       <qemu:property name='prop1' type='string' value='propval1'/>
>       <qemu:property name='prop2' type='signed' value='-321'/>
>       <qemu:property name='prop3' type='unsigned' value='123'/>
>       <qemu:property name='prop4' type='bool' value='true'/>
>       <qemu:property name='prop5' type='bool' value='false'/>
>       <qemu:property name='prop6' type='bool' value='false'/>
>       <qemu:property name='prop6' type='remove'/>
>     </qemu:device>
>   </qemu:deviceOverride>

This all applies to the frontend. Could we make this work
with the backend too ? Obviously there are many different
types of backend, so it is less convenient to implement
that, but would at least be nice to have a thought about
how we could represent it in the XML config.

Some ideas:

 1. Type specific backend at the top level

     <qemu:device alias='ua-disk'>
       <qemu:property name='prop1' type='string' value='propval1'/>
       <qemu:property name='prop2' type='signed' value='-321'/>
     </qemu:device>
     <qemu:blockdev alias='ua-disk'>
       <qemu:property name='prop1' type='string' value='propval1'/>
       <qemu:property name='prop2' type='signed' value='-321'/>
     </qemu:blockdev>


 2. Type specific backend at the inner level

     <qemu:device alias='ua-disk'>
       <qemu:property name='prop1' type='string' value='propval1'/>
       <qemu:property name='prop2' type='signed' value='-321'/>
       
       <qemu:blockdev alias='ua-disk'>
         <qemu:property name='prop1' type='string' value='propval1'/>
         <qemu:property name='prop2' type='signed' value='-321'/>
       </qemu:blockdev>
     </qemu:device>

 3. Inner generic backends/frontends:

     <qemu:device alias='ua-disk'>
       <qemu:frontend>
         <qemu:property name='prop1' type='string' value='propval1'/>
         <qemu:property name='prop2' type='signed' value='-321'/>
       </qemu:frontend>
       <qemu:backend>
         <qemu:property name='prop1' type='string' value='propval1'/>
         <qemu:property name='prop2' type='signed' value='-321'/>
       </qemu:backend>
     </qemu:device>

 4. Inner generic backends:

     <qemu:device alias='ua-disk'>
       <qemu:property name='prop1' type='string' value='propval1'/>
       <qemu:property name='prop2' type='signed' value='-321'/>
       <qemu:backend>
         <qemu:property name='prop1' type='string' value='propval1'/>
         <qemu:property name='prop2' type='signed' value='-321'/>
       </qemu:backend>
     </qemu:device>


I'd probably lean slightly towards options (3)/(4), which happens
to be possible to retrofit with this series as.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux