Skip to content

Commit

Permalink
lxd/instance/drivers: Update QEMU device id generation
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
  • Loading branch information
hamistao committed Jun 13, 2024
1 parent cb67a21 commit ccebeff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lxd/instance/drivers/driver_qemu_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ func qemuHostDrive(opts *qemuHostDriveOpts) []cfgSection {
var extraDeviceEntries []cfgEntry
var driveSection cfgSection
deviceOpts := qemuDevEntriesOpts{dev: opts.dev}
nameWithPrefix := fmt.Sprintf("%s%s", opts.namePrefix, opts.name) // Use the lxd_ prefix to specify a user named device.
nameWithPrefix := generateQemuDirDriveName(opts.name, opts.namePrefix, "")

if opts.protocol == "9p" {
var readonly string
Expand Down Expand Up @@ -723,7 +723,7 @@ func qemuHostDrive(opts *qemuHostDriveOpts) []cfgSection {
return []cfgSection{
driveSection,
{
name: fmt.Sprintf(`device "dev-%s%s-%s"`, opts.name, opts.nameSuffix, opts.protocol),
name: fmt.Sprintf(`device "dev-%s"`, generateQemuDirDriveName(opts.name, opts.namePrefix, opts.nameSuffix)),
entries: append(qemuDeviceEntries(&deviceOpts), extraDeviceEntries...),
},
}
Expand Down

0 comments on commit ccebeff

Please sign in to comment.