Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incusd/instance/qemu: Support LXD virtual machines #57

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions incusd/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2454,6 +2454,11 @@ func (d *qemu) generateConfigShare() error {
} else {
d.logger.Debug("Skipping incus-agent install as unchanged", logger.Ctx{"srcPath": agentSrcPath, "installPath": agentInstallPath})
}

err = os.Symlink("incus-agent", filepath.Join(configDrivePath, "lxd-agent"))
if err != nil && !os.IsExist(err) {
return err
}
}

agentCert, agentKey, clientCert, _, err := d.generateAgentCert()
Expand Down
5 changes: 5 additions & 0 deletions incusd/instance/drivers/driver_qemu_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func TestQemuConfigTemplates(t *testing.T) {
chardev = "qemu_serial-chardev"
bus = "dev-qemu_serial.0"

[device "qemu_serial_legacy"]
driver = "virtserialport"
name = "org.linuxcontainers.lxd"
bus = "dev-qemu_serial.0"

# Spice agent
[chardev "qemu_spice-chardev"]
backend = "spicevmc"
Expand Down
7 changes: 7 additions & 0 deletions incusd/instance/drivers/driver_qemu_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ func qemuSerial(opts *qemuSerialOpts) []cfgSection {
{key: "chardev", value: opts.charDevName},
{key: "bus", value: "dev-qemu_serial.0"},
},
}, {
name: `device "qemu_serial_legacy"`,
entries: []cfgEntry{
{key: "driver", value: "virtserialport"},
{key: "name", value: "org.linuxcontainers.lxd"},
{key: "bus", value: "dev-qemu_serial.0"},
},
}, {
name: `chardev "qemu_spice-chardev"`,
comment: "Spice agent",
Expand Down