<span class="since">Since 0.9.5</span>
</p>
+ <h5><a name="mtu">MTU configuration</a></h5>
+<pre>
+...
+<devices>
+ <interface type='network'>
+ <source network='default'/>
+ <target dev='vnet0'/>
+ <b><mtu size='1500'/></b>
+ </interface>
+</devices>
+...</pre>
+
+ <p>
+ This element provides means of setting MTU of the virtual network link.
+ Currently there is just one attribute <code>size</code> which accepts a
+ non-negative integer which specifies the MTU size for the interface.
+ <span class="since">Since 3.1.0</span>
+ </p>
+
<h5><a name="ipconfig">IP configuration</a></h5>
<pre>
...
options in order to print just the --name and/or --uuid of pools.
</description>
</change>
+ <change>
+ <summary>
+ Introduce MTU to domain <interface/>
+ </summary>
+ <description>
+ Allow setting MTU size for some types of domain interface.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
<change>
<empty/>
</element>
</optional>
+ <optional>
+ <ref name="mtu"/>
+ </optional>
<optional>
<element name="target">
<attribute name="dev">
</optional>
</element>
</define>
+
<define name="macTableManager">
<choice>
<value>kernel</value>
<value>libvirt</value>
</choice>
</define>
+
+ <define name="mtu">
+ <element name="mtu">
+ <attribute name="size">
+ <ref name="unsignedShort"/>
+ </attribute>
+ </element>
+ </define>
</grammar>
goto error;
}
+ if (virXPathUInt("string(./mtu/@size)", ctxt, &def->mtu) < -1) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed mtu size"));
+ goto error;
+ }
+
cleanup:
ctxt->node = oldnode;
VIR_FREE(macaddr);
virBufferAsprintf(buf, "<link state='%s'/>\n",
virDomainNetInterfaceLinkStateTypeToString(def->linkstate));
}
+
+ if (def->mtu)
+ virBufferAsprintf(buf, "<mtu size='%u'/>\n", def->mtu);
+
if (virDomainDeviceInfoFormat(buf, &def->info,
flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT
| VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM) < 0)
virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */
int linkstate;
+ unsigned int mtu;
};
/* Used for prefix of ifname of any network name generated dynamically
_("rx_queue_size has to be a power of two"));
goto cleanup;
}
+
+ if (net->mtu &&
+ !qemuDomainNetSupportsMTU(net->type)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("setting MTU on interface type %s is not supported yet"),
+ virDomainNetTypeToString(net->type));
+ goto cleanup;
+ }
}
ret = 0;
return virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV);
}
+bool
+qemuDomainNetSupportsMTU(virDomainNetType type)
+{
+ switch (type) {
+ case VIR_DOMAIN_NET_TYPE_USER:
+ case VIR_DOMAIN_NET_TYPE_ETHERNET:
+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
+ case VIR_DOMAIN_NET_TYPE_SERVER:
+ case VIR_DOMAIN_NET_TYPE_CLIENT:
+ case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_NETWORK:
+ case VIR_DOMAIN_NET_TYPE_BRIDGE:
+ case VIR_DOMAIN_NET_TYPE_INTERNAL:
+ case VIR_DOMAIN_NET_TYPE_DIRECT:
+ case VIR_DOMAIN_NET_TYPE_HOSTDEV:
+ case VIR_DOMAIN_NET_TYPE_UDP:
+ case VIR_DOMAIN_NET_TYPE_LAST:
+ break;
+ }
+ return false;
+}
int
qemuDomainNetVLAN(virDomainNetDefPtr def)
virQEMUCapsPtr qemuCaps,
virDomainNetDefPtr net);
+bool qemuDomainNetSupportsMTU(virDomainNetType type);
+
int qemuDomainNetVLAN(virDomainNetDefPtr def);
int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
--- /dev/null
+<domain type='qemu'>
+ <name>test</name>
+ <uuid>15d091de-0181-456b-9554-e4382dc1f1ab</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-0.13'>hvm</type>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ <bootmenu enable='yes'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2' event_idx='on'/>
+ <source file='/var/lib/libvirt/images/f14.img'/>
+ <target dev='vda' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source file='/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </controller>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='network'>
+ <source network='default'/>
+ <mac address='52:54:00:e5:48:58'/>
+ <model type='virtio'/>
+ <mtu size='1500'/>
+ </interface>
+ <interface type='network'>
+ <source network='default'/>
+ <mac address='52:54:00:e5:48:59'/>
+ <model type='virtio'/>
+ <mtu size='9000'/>
+ </interface>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>