@@ -34,12 +34,14 @@ static struct argp_option options[] = {
3434 {"memory" , 'r' , 0 , 0 , "Ram size for your vm" },
3535 {"vcpu" , 'c' , 0 , 0 , "Number of cpu for your vm" },
3636 {"image" , 'i' , "IMAGE" , 0 , "linux kernel bzimage" },
37+ {"initramfs" , 'z' , "PATH" , 0 , "load initial ram disk" },
3738 {0 }};
3839
3940/* Used by main to communicate with parse_opt. */
4041struct arguments {
4142 int verbose , memory , vcpu ;
4243 char * image_file ;
44+ char * initrd_file ;
4345};
4446
4547/* Parse a single option. */
@@ -55,6 +57,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
5557 case 'i' :
5658 arguments -> image_file = arg ;
5759 break ;
60+ case 'z' :
61+ arguments -> initrd_file = arg ;
62+ break ;
5863 case 'c' :
5964 arguments -> vcpu = atoi (arg ); /* TODO */
6065 case 'r' :
@@ -80,6 +85,9 @@ int main(int argc, char **argv) {
8085 int ret ;
8186 struct vm core_vm ;
8287
88+ if (arguments .initrd_file != NULL )
89+ core_vm .initramfs = arguments .initrd_file ;
90+
8391 ret = vm_create (& core_vm );
8492 ERROR (ret )
8593 ret = vm_init (& core_vm );
0 commit comments