Implement CLI set (resize, change readonly status) command

This commit is contained in:
Vitaliy Filippov
2021-11-13 22:39:17 +03:00
parent 32614c5bc8
commit 2cb3e84882
7 changed files with 253 additions and 36 deletions
+6
View File
@@ -427,6 +427,7 @@ resume_3:
exit(1);
}
this->result = res;
parent->ringloop->wakeup();
});
}
};
@@ -478,6 +479,11 @@ std::function<bool(void)> cli_tool_t::start_create(json11::Json cfg)
fprintf(stderr, "Invalid syntax for size: %s\n", cfg["size"].string_value().c_str());
exit(1);
}
if (size % 4096)
{
fprintf(stderr, "Image size should be a multiple of 4096\n");
exit(1);
}
image_creator->size = size;
if (image_creator->new_snap != "")
{