Conversation
This was already handled with user memory zones but not with the default memory. Make a small refactoring to move the boot RAM check into MemoryManager rather than split across Vm and MemoryManager. Signed-off-by: Rob Bradford <[email protected]>
|
|
||
| /// Forbidden operation. Impossible to resize guest memory below the boot | ||
| /// RAM as it is not removable with virtio-mem. | ||
| #[error("Invalid resize request: desired_size = {0} below boot size = {1}")] |
There was a problem hiding this comment.
No strong opinion: would hex make sense here?
| #[error("Invalid resize request: desired_size = {0} below boot size = {1}")] | |
| #[error("Invalid resize request: desired_size = 0x{0:x} below boot size = 0x{1:x}")] |
There was a problem hiding this comment.
It's tricky - addresses should always be hex - but for sizes. I think it's better not (but it's not always readable) - we could convert them to MiB?
There was a problem hiding this comment.
I agree about the sizes not being displayed as hex, but I also like the idea of printing sizes as kiB/MiB/GiB whenever it makes sense. Should we implement the Display trait? But given we can't simply implement it on a usize, should we create a MemorySize or GuestMemorySize so that we would implement Display there?
There was a problem hiding this comment.
I personally like the idea of MemorySize with a Display impl. Let's do that in a follow-up and stick here to the raw integer I'd say
There was a problem hiding this comment.
I love this idea - another candidate for our utils crate (although almost all users seem to be in vmm/). For consistency with the other places (i've just checked) I will leave as raw bytes for now.
There was a problem hiding this comment.
although almost all users seem to be in vmm
by the way: Have you seen #7607?
If we ever tackle this, it would improve developer productivity for everyone a lot (at least if you do frequent rebuilds)
This was already handled with user memory zones but not with the default
memory. Make a small refactoring to move the boot RAM check into
MemoryManager rather than split across Vm and MemoryManager.
Signed-off-by: Rob Bradford [email protected]