Added stuff
This commit is contained in:
@ -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>"""
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user