Make USB accessories opt-in for Tart VMs (#502)

This commit is contained in:
Yibo Zhuang
2026-09-23 12:24:57 -07:00
committed by GitHub
parent 7e31732df6
commit f716825279
8 changed files with 145 additions and 1 deletions
+4
View File
@@ -238,6 +238,10 @@ func (controller *Controller) updateVMSpec(ctx *gin.Context) responder.Responder
return responder.JSON(http.StatusPreconditionFailed, NewErrorResponse("\"netSoftnet\" cannot be "+
"toggled for suspendable VMs"))
}
if dbVM.Suspendable && dbVM.USBAccessories != userVM.USBAccessories {
return responder.JSON(http.StatusPreconditionFailed, NewErrorResponse("\"usbAccessories\" cannot be "+
"toggled for suspendable VMs"))
}
// Power state-specific sanity checks
if !userVM.PowerState.Valid() {