@@ -238,12 +238,13 @@ let linux_build_real domid mem_max_mib mem_start_mib image ramdisk cmdline featu
238238 Nativeint. to_string console_mfn; proto ]
239239 )
240240
241- let hvm_build_real domid mem_max_mib mem_start_mib image store_port =
241+ let hvm_build_real domid mem_max_mib mem_start_mib image store_port console_port =
242242 with_xenguest (fun xc ->
243- let store_mfn =
243+ let store_mfn, console_mfn =
244244 Xenguest. hvm_build xc domid mem_max_mib mem_start_mib image
245- store_port in
246- Nativeint. to_string store_mfn
245+ store_port console_port in
246+ String. concat " " [Nativeint. to_string store_mfn;
247+ Nativeint. to_string console_mfn]
247248 )
248249
249250let domain_save_real fd domid x y flags hvm =
@@ -263,14 +264,14 @@ let domain_restore_real fd domid store_port console_port hvm =
263264
264265(* * fake operations *)
265266let linux_build_fake domid mem_max_mib mem_start_mib image ramdisk cmdline features flags store_port console_port = " 10 10 x86-32"
266- let hvm_build_fake domid mem_max_mib mem_start_mib image store_port = " 2901"
267+ let hvm_build_fake domid mem_max_mib mem_start_mib image store_port console_port = " 2901 2901"
267268let domain_save_fake fd domid x y flags hvm = Unix. sleep 1 ; ignore (suspend_callback domid); " "
268269let domain_restore_fake fd domid store_port console_port hvm = " 10 10"
269270
270271(* * operation vector *)
271272type ops = {
272273 linux_build : int -> int -> int -> string -> string option -> string -> string -> int -> int -> int -> string ;
273- hvm_build : int -> int -> int -> string -> int -> string ;
274+ hvm_build : int -> int -> int -> string -> int -> int -> string ;
274275 domain_save : Unix .file_descr -> int -> int -> int -> Xenguest .suspend_flags list -> bool -> string ;
275276 domain_restore : Unix .file_descr -> int -> int -> int -> bool -> string ;
276277}
@@ -402,15 +403,17 @@ let _ =
402403 cmdline features flags store_port console_port)
403404 | Some "hvm_build" ->
404405 debug " hvm_build mode selected" ;
405- require [ " domid" ; " mem_max_mib" ; " mem_start_mib" ; " image" ; " store_port" ];
406+ require [ " domid" ; " mem_max_mib" ; " mem_start_mib" ; " image" ;
407+ " store_port" ; " console_port" ];
406408 let domid = int_of_string (get_param " domid" )
407409 and mem_max_mib = int_of_string (get_param " mem_max_mib" )
408410 and mem_start_mib = int_of_string (get_param " mem_start_mib" )
409411 and image = get_param " image"
410- and store_port = int_of_string (get_param " store_port" ) in
412+ and store_port = int_of_string (get_param " store_port" )
413+ and console_port = int_of_string (get_param " console_port" ) in
411414
412415 with_logging (fun () -> ops.hvm_build domid mem_max_mib mem_start_mib image
413- store_port)
416+ store_port console_port )
414417 | Some "test" ->
415418 debug " test mode selected" ;
416419 with_logging (fun () -> ignore(Unix. system " /tmp/test" ); " result" )
0 commit comments