vmm: api: Be more specific on "Still pending remove vcpu" errors

Although the CPU manager gives us a quite descriptive error, on the
application side (the part calling Cloud Hypervisor) we have absolutely
no way to distinguish such error from any other error that may happen
when resizing a VM.

With this in mind, let's be more specific and return a TooManyRequests
(429) error, allowing the caller to have a chance to decide whether they
want to retry the operation or not.

https://datatracker.ietf.org/doc/html/rfc6585#section-4

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
This commit is contained in:
Fabiano Fidêncio
2025-04-25 20:21:18 +02:00
committed by Bo Chen
parent 87007a288f
commit d0225fe68f
3 changed files with 38 additions and 2 deletions

View File

@@ -160,6 +160,8 @@ paths:
description: The VM instance was successfully resized.
404:
description: The VM instance could not be resized because it is not created.
429:
description: The VM instance could not be resized because a cpu removal is still pending.
/vm.resize-zone:
put: