Dragonball: fix Nydus config serde problem

Since Nydus snapshotter has been updated in previous commits, there is a
problem that the config passthrough to Dragonball during mount_rafs is
RafsConfig instead of ConfigV2, but Dragonball could only serde ConfigV2
so it will panic.

We need to add the support for RafsConfig

Fixes:#8013

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
This commit is contained in:
Chao Wu 2023-09-20 19:33:24 +08:00
parent 1974d13122
commit 678fe3cd31

View File

@ -475,7 +475,7 @@ impl<AS: GuestAddressSpace> VirtioFs<AS> {
let (mut rafs, rafs_cfg) = match config.as_ref() {
Some(cfg) => {
let rafs_conf: Arc<ConfigV2> = Arc::new(
serde_json::from_str(cfg).map_err(|e| FsError::BackendFs(e.to_string()))?,
ConfigV2::from_str(cfg).map_err(|e| FsError::BackendFs(e.to_string()))?,
);
(