AshleyYakeley/NixVirt

How to disable default entries in domain.writeXml?

Closed this issue · 5 comments

I'm currently setting up MacOS (OSX-KVM) in nixvirt and I see that I get some unwanted devices, like a keyboard, mouse, two additional pci root ports and a membaloon (whatewer that is). Is it possible to disable this behavior.

(I still haven't finished it, so I don't know if these would prevent the OS from booting, but still)

generated-domain-xml.xml.txt
maxos-source.nix.txt
target-config.xml.txt

Their diff:

-=- some path changes -=-
>     <boot dev='hd'/>
52a18,20
>   <cpu mode='custom' match='exact' check='none'>
>     <model fallback='forbid'>qemu64</model>
>   </cpu>
-=- some more path changes -=-
<     <!-- Make sure you put your nic in bus 0x0 and slot 0x0y(y is numeric), this will make nic built-in and apple-store work-->
<     <interface type="bridge">
<       <mac address="52:54:00:e6:85:40"/>
<       <source bridge="virbr0"/>                                 <       <model type="vmxnet3"/>
<       <address type="pci" domain="0x0000" bus="0x00" slot="0x00" function="0x0"/>                                                 ---
>     <controller type='pci' index='8' model='pcie-root-port'>
>       <model name='pcie-root-port'/>
>       <target chassis='8' port='0xf'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x7'/>
>     </controller>
>     <controller type='pci' index='9' model='pcie-to-pci-bridge'>
>       <model name='pcie-pci-bridge'/>
>       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
>     </controller>
>     <interface type='bridge'>
>       <mac address='52:54:00:e6:85:40'/>
>       <source bridge='virbr0'/>
>       <model type='vmxnet3'/>
>       <address type='pci' domain='0x0000' bus='0x09' slot='0x01' function='0x0'/>
156,190c129,135
<     <channel type='unix'>
-=- stuff I haven't yet moved -=-
---                                                               >     <input type='mouse' bus='ps2'/>
>     <input type='keyboard' bus='ps2'/>
>     <audio id='1' type='none'/>
>     <watchdog model='itco' action='reset'/>
>     <memballoon model='virtio'>
>       <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
>     </memballoon>                                               

libvirt adds in a whole bunch of stuff to your domains (like a memballoon), so the XML you get out will contain a lot more than the XML you define. I think that's what's going on?

To clarify, target-config.xml.txt is the domain XML you want to pass into libvirt, not the domain XML you would get out of libvirt when examining the domain, is that correct?

To clarify, target-config.xml.txt is the domain XML you want to pass into libvirt, not the domain XML you would get out of libvirt when examining the domain, is that correct?

Yes

libvirt adds in a whole bunch of stuff to your domains (like a memballoon), so the XML you get out will contain a lot more than the XML you define. I think that's what's going on?

Also yes

So as I understand it now it's libvirtd who is adding all these devices, not nixvirt. Right?

So as I understand it now it's libvirtd who is adding all these devices, not nixvirt. Right?

Yes, that's correct.