From 2c1f9285f62198b2cbc4cd733c11bed7ef441649 Mon Sep 17 00:00:00 2001 From: Nikita Kalyazin Date: Tue, 22 Aug 2023 11:37:43 +0000 Subject: [PATCH] feat(api_server): add put api for vhost-user drives This addes vhost-user optional object in the Drive object to provide vhost-user-specific configuration. Signed-off-by: Nikita Kalyazin --- src/api_server/swagger/firecracker.yaml | 14 +++++++++++++- tests/integration_tests/functional/test_api.py | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/api_server/swagger/firecracker.yaml b/src/api_server/swagger/firecracker.yaml index 5a4977ef2948..faffaa2eeb8f 100644 --- a/src/api_server/swagger/firecracker.yaml +++ b/src/api_server/swagger/firecracker.yaml @@ -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: @@ -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: diff --git a/tests/integration_tests/functional/test_api.py b/tests/integration_tests/functional/test_api.py index 826f9da95ae2..cc8a693dc0bb 100644 --- a/tests/integration_tests/functional/test_api.py +++ b/tests/integration_tests/functional/test_api.py @@ -849,6 +849,7 @@ def _drive_patch(test_microvm): "rate_limiter": None, "io_engine": "Sync", }, + "vhost_user": None, }, { "drive_id": "scratch", @@ -875,6 +876,7 @@ def _drive_patch(test_microvm): }, "io_engine": "Async" if is_io_uring_supported() else "Sync", }, + "vhost_user": None, }, ] @@ -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, } ] @@ -1196,6 +1199,7 @@ def test_get_full_config(test_microvm_with_api): "rate_limiter": None, "io_engine": "Sync", }, + "vhost_user": None, } ]