Disallow using "legacy networking mode" with Qemu >= 2.9.0

This commit is contained in:
grossmj 2020-01-24 19:06:24 +08:00
parent d796f8d112
commit 667d50aa4a

View File

@ -1723,8 +1723,11 @@ class QemuVM(BaseNode):
patched_qemu = False
if self._legacy_networking:
version = await self.manager.get_qemu_version(self.qemu_path)
if version and parse_version(version) < parse_version("1.1.0"):
qemu_version = await self.manager.get_qemu_version(self.qemu_path)
if qemu_version:
if parse_version(qemu_version) >= parse_version("2.9.0"):
raise QemuError("Qemu version 2.9.0 and later doesn't support legacy networking mode")
if parse_version(qemu_version) < parse_version("1.1.0"):
# this is a patched Qemu if version is below 1.1.0
patched_qemu = True