feat(qemu): support two CD/DVD images and consistent ISO handling
This commit is contained in:
Jeremy Grossmann authored and GitHub committed 2026-10-19 04:42:18 +02:00
commit e57acfb7b1
22 files changed
+799 -53

No files matched your search

+7 -1
View File
@@ -23,6 +23,7 @@ from uuid import UUID
from pydantic import AnyUrl, BaseModel, BeforeValidator, Discriminator, EmailStr, Field, Tag
from ..common import ExtraConfig
from ..compute.qemu_nodes import QemuCdromInterface
# ============================================================================
# Shared Enums
@@ -398,6 +399,8 @@ class Qemu(BaseModel):
hdc_disk_interface: Optional[QemuDiskInterface] = Field(
None, title="Disk interface for the installed hdc_disk_image"
)
cdrom_interface: Optional[QemuCdromInterface] = Field(None, title="First CD/DVD interface")
cdrom2_interface: Optional[QemuCdromInterface] = Field(None, title="Second CD/DVD interface")
hdd_disk_interface: Optional[QemuDiskInterface] = Field(
None, title="Disk interface for the installed hdd_disk_image"
)
@@ -425,7 +428,8 @@ class ApplianceVersionImages(BaseModel):
hdb_disk_image: Optional[str] = Field(None, title="Hdc disk image")
hdc_disk_image: Optional[str] = Field(None, title="Hdd disk image")
hdd_disk_image: Optional[str] = Field(None, title="Hdd diskimage")
cdrom_image: Optional[str] = Field(None, title="cdrom image")
cdrom_image: Optional[str] = Field(None, title="First cdrom image")
cdrom2_image: Optional[str] = Field(None, title="Second cdrom image")
class ApplianceVersion(BaseModel):
@@ -578,6 +582,8 @@ class QemuPropertiesV8(BaseModel):
hdc_disk_interface: Optional[QemuDiskInterface] = Field(
None, title="Disk interface for the installed hdc_disk_image"
)
cdrom_interface: Optional[QemuCdromInterface] = Field(None, title="First CD/DVD interface")
cdrom2_interface: Optional[QemuCdromInterface] = Field(None, title="Second CD/DVD interface")
hdd_disk_interface: Optional[QemuDiskInterface] = Field(
None, title="Disk interface for the installed hdd_disk_image"
)
+3
View File
@@ -37,6 +37,9 @@ class ImageBase(BaseModel):
filename: str = Field(..., description="Image filename")
path: str = Field(..., description="Image path")
reference: Optional[str] = Field(
None, description="Image reference relative to its emulator directory, or an absolute additional-root path"
)
image_type: ImageType = Field(..., description="Image type")
image_size: int = Field(..., description="Image size in bytes")
checksum: str = Field(..., description="Checksum value")
@@ -23,6 +23,7 @@ from gns3server.schemas.compute.qemu_nodes import (
CustomAdapter,
QemuAdapterType,
QemuBootPriority,
QemuCdromInterface,
QemuConsoleType,
QemuDiskInterfaceType,
QemuOnCloseAction,
@@ -79,7 +80,10 @@ class QemuTemplate(TemplateBase):
hdd_disk_interface: Optional[QemuDiskInterfaceType] = Field(
QemuDiskInterfaceType.none, description="QEMU hdd interface"
)
cdrom_image: Optional[str] = Field("", description="QEMU cdrom image path")
cdrom_image: Optional[str] = Field("", description="QEMU first cdrom image path")
cdrom_interface: QemuCdromInterface = Field("ide", description="First CD/DVD interface")
cdrom2_interface: QemuCdromInterface = Field("ide", description="Second CD/DVD interface")
cdrom2_image: Optional[str] = Field("", description="QEMU second cdrom image path")
initrd: Optional[str] = Field("", description="QEMU initrd path")
kernel_image: Optional[str] = Field("", description="QEMU kernel image path")
bios_image: Optional[str] = Field("", description="QEMU bios image path")