Skip to content

Commit

Permalink
feat(api_server): add put api for vhost-user drives
Browse files Browse the repository at this point in the history
This addes vhost-user optional object in the Drive object
to provide vhost-user-specific configuration.

Signed-off-by: Nikita Kalyazin <[email protected]>
  • Loading branch information
kalyazin committed Aug 30, 2023
1 parent 6e91077 commit 2c1f928
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/api_server/swagger/firecracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,10 @@ definitions:
This parameter has been deprecated since v1.6.0.
Use parameters in `file` instead.
$ref: "#/definitions/RateLimiter"

vhost_user:
description:
Configuration for the vhost-user-backed device.
$ref: "#/definitions/VhostUserConfig"
Error:
type: object
properties:
Expand Down Expand Up @@ -1302,6 +1305,15 @@ definitions:
description: The total number of tokens this bucket can hold.
minimum: 0

VhostUserConfig:
type: object
required:
- socket
properties:
socket:
type: string
description: Socket path for vhost-user backend.

Vm:
type: object
description:
Expand Down
4 changes: 4 additions & 0 deletions tests/integration_tests/functional/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ def _drive_patch(test_microvm):
"rate_limiter": None,
"io_engine": "Sync",
},
"vhost_user": None,
},
{
"drive_id": "scratch",
Expand All @@ -875,6 +876,7 @@ def _drive_patch(test_microvm):
},
"io_engine": "Async" if is_io_uring_supported() else "Sync",
},
"vhost_user": None,
},
]

Expand Down Expand Up @@ -1081,6 +1083,7 @@ def test_get_full_config_after_restoring_snapshot(microvm_factory, uvm_nano):
"rate_limiter": None,
"io_engine": "Sync",
},
"vhost_user": None,
}
]

Expand Down Expand Up @@ -1196,6 +1199,7 @@ def test_get_full_config(test_microvm_with_api):
"rate_limiter": None,
"io_engine": "Sync",
},
"vhost_user": None,
}
]

Expand Down

0 comments on commit 2c1f928

Please sign in to comment.