Skip to content

Commit

Permalink
incusd/instance/qemu: Handle USB NIC hotremove
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 29, 2023
1 parent 1252d03 commit 280e5c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,13 @@ func (d *qemu) deviceStop(dev device.Device, instanceRunning bool, _ string) err
if instanceRunning {
// Detach NIC from running instance.
if configCopy["type"] == "nic" {
for _, usbDev := range runConf.USBDevice {
err = d.deviceDetachUSB(usbDev)
if err != nil {
return err
}
}

err = d.deviceDetachNIC(dev.Name())
if err != nil {
return err
Expand Down

0 comments on commit 280e5c4

Please sign in to comment.