Closed WeiZhang555 closed 7 years ago
Sadly, I found that cbfs.rom made from latest cbfs file exceed 8MB which makes it impossible to start container, I've modified our own qemu to remove this restriction, and it works well since then.
qemu patches:
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 579461f..1effda7 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -81,7 +81,11 @@ static void pc_isa_bios_init(MemoryRegion *rom_memory,
* only 18MB-4KB below 4G. For now, restrict the cumulative mapping to 8MB in
* size.
*/
+#ifdef TARGET_X86_64UVM
+#define FLASH_MAP_BASE_MIN ((hwaddr)(0x100000000ULL - 16*1024*1024))
+#else
#define FLASH_MAP_BASE_MIN ((hwaddr)(0x100000000ULL - 8*1024*1024))
+#endif
/* This function maps flash drives from 4G downward, in order of their unit
* numbers. The mapping starts at unit#0, with unit number increments of 1, and
@WeiZhang555 see https://github.com/hyperhq/hyperstart/pull/280 how to solve this problem without patching QEMU.
@dvoytik So the solution is, exclude kernel modules to make cbfs file smaller than 8MB? Are we sure we dont need these kernel modules for making runv work correctly?
I think most of the modules are for netfilter or cgroup support. @WeiZhang555
This parameter by default is off -> the kernel modules are included. If one enables this parameter then apparently she uses a custom kernel (the name of the flag implies this). In my case I use custom kernel without modules, so I use this parameter.
Btw I don't understand who needs modules in guest kernel for containers, but it's another off-topic issue.
If so, I think hyperhq/hyperstart#280 should make sense, by the way, @dvoytik is my colleague from our Germany Team working on this too :) @gnawux
Refactored, ping @laijs
ping @laijs Rebased.
So are you suggesting me adding new flag "--cbfs" and "--kernel" directly for runv containerd? And as I can see, this new cbfs factory isn't needed any more.
Sure
OK. I'll do a refactor~
@laijs Updated again~
Export and Support starting VM with bios+cbfs from runv command line, also use CBFS as first choice when kernel also exists.
Signed-off-by: Zhang Wei zhangwei555@huawei.com