Added stuff

This commit is contained in:
2021-11-11 23:56:09 +01:00
parent f67835393f
commit a306d9e56c
73 changed files with 4021 additions and 16 deletions

View File

@ -216,10 +216,20 @@ def run_xml(outdir:str, hostname:str, ram:int, net:str, ipaddr:str):
interfacecfg = ""
for n in net.split(','):
interfaces=list(net.split(','))
for i, n in enumerate(interfaces):
multi = ""
if i == 0 and len(interfaces) > 1:
multi = 'multifunction="on"'
# Defining address like this fixes the interface to be enp1s0
# And consequitive interfaces will be enp1s0f{n}
interfacecfg += f""" <interface type="network">
<source network="{n}"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x{i}" {multi} />
</interface>"""