62
62
#include "ioc.h"
63
63
#include "pm.h"
64
64
#include "atomic.h"
65
- #include "vmcfg_config.h"
66
- #include "vmcfg.h"
67
65
#include "tpm.h"
68
66
#include "virtio.h"
69
67
#include "log.h"
@@ -748,8 +746,6 @@ static struct option long_options[] = {
748
746
749
747
/* Following cmd option only has long option */
750
748
#ifdef CONFIG_VM_CFG
751
- {"vmcfg" , required_argument , 0 , CMD_OPT_VMCFG },
752
- {"dump" , required_argument , 0 , CMD_OPT_DUMP },
753
749
#endif
754
750
{"vsbl" , required_argument , 0 , CMD_OPT_VSBL },
755
751
{"ovmf" , required_argument , 0 , CMD_OPT_OVMF },
@@ -772,7 +768,7 @@ static struct option long_options[] = {
772
768
static char optstr [] = "hAWYvE:k:r:B:p:c:s:m:l:U:G:i:" ;
773
769
774
770
int
775
- dm_run (int argc , char * argv [])
771
+ main (int argc , char * argv [])
776
772
{
777
773
int c , error , err ;
778
774
int max_vcpus , mptgen ;
@@ -1069,54 +1065,3 @@ dm_run(int argc, char *argv[])
1069
1065
vm_destroy (ctx );
1070
1066
exit (0 );
1071
1067
}
1072
-
1073
- int main (int argc , char * argv [])
1074
- {
1075
- int c ;
1076
- int option_idx = 0 ;
1077
- int dm_options = 0 , vmcfg = 0 ;
1078
- int index = -1 ;
1079
-
1080
- while ((c = getopt_long (argc , argv , optstr , long_options ,
1081
- & option_idx )) != -1 ) {
1082
- switch (c ) {
1083
- case CMD_OPT_VMCFG :
1084
- vmcfg = 1 ;
1085
- dm_strtoi (optarg , NULL , 0 , & index );
1086
- break ;
1087
- case CMD_OPT_DUMP :
1088
- dm_strtoi (optarg , NULL , 0 , & index );
1089
- vmcfg_dump (index , long_options , optstr );
1090
- return 0 ;
1091
- default :
1092
- dm_options ++ ;
1093
- }
1094
- }
1095
-
1096
- if (!vmcfg ) {
1097
- optind = 0 ;
1098
- return dm_run (argc , argv );
1099
- }
1100
-
1101
- if (dm_options )
1102
- fprintf (stderr , "Waring: --vmcfg override optional args\n" );
1103
-
1104
- if (index <= 0 ) {
1105
- vmcfg_list ();
1106
- return -1 ;
1107
- }
1108
-
1109
- if (index > num_args_buildin ) {
1110
- fprintf (stderr , "Error: --vmcfg %d, max index is %d\n" ,
1111
- index , num_args_buildin );
1112
- return -1 ;
1113
- }
1114
-
1115
- optind = 0 ;
1116
- index -- ;
1117
- args_buildin [index ]-> argv [0 ] = argv [0 ];
1118
- if (args_buildin [index ]-> setup )
1119
- args_buildin [index ]-> setup ();
1120
-
1121
- return dm_run (args_buildin [index ]-> argc , args_buildin [index ]-> argv );
1122
- }
0 commit comments