Skip to content

Commit 3010718

Browse files
conghuic23wenlingz
authored andcommitted
dm: cmdline: remove unused parameters
Remove unused parameters for acrn-dm Tracked-On: #1616 Signed-off-by: Conghui Chen <conghui.chen@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 4261ca2 commit 3010718

File tree

7 files changed

+6
-262
lines changed

7 files changed

+6
-262
lines changed

devicemodel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ SRCS += core/console.c
121121
SRCS += core/inout.c
122122
SRCS += core/mem.c
123123
SRCS += core/post.c
124-
SRCS += core/consport.c
125124
SRCS += core/vmmapi.c
126125
SRCS += core/mptbl.c
127126
SRCS += core/main.c

devicemodel/core/consport.c

Lines changed: 0 additions & 165 deletions
This file was deleted.

devicemodel/core/main.c

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,8 @@ uint8_t trusty_enabled;
8585
bool stdio_in_use;
8686

8787
static int virtio_msix = 1;
88-
static int x2apic_mode; /* default is xAPIC */
8988
static bool debugexit_enabled;
9089

91-
static int strictmsr = 1;
92-
9390
static int acpi;
9491

9592
static char *progname;
@@ -131,28 +128,20 @@ static void
131128
usage(int code)
132129
{
133130
fprintf(stderr,
134-
"Usage: %s [-abehuwxACHPSTWY] [-c vcpus] [-g <gdb port>] [-l <lpc>]\n"
131+
"Usage: %s [-hAEWY] [-c vcpus] [-l <lpc>]\n"
135132
" %*s [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] \n"
136133
" %*s [--vsbl vsbl_file_name] [--part_info part_info_name]\n"
137134
" %*s [--enable_trusty] [--debugexit] <vm>\n"
138-
" -a: local apic is in xAPIC mode (deprecated)\n"
139135
" -A: create ACPI tables\n"
140-
" -b: enable bvmcons\n"
141136
" -c: # cpus (default 1)\n"
142-
" -C: include guest memory in core file\n"
143137
" -E: elf image path\n"
144-
" -g: gdb port\n"
145138
" -h: help\n"
146139
" -l: LPC device configuration\n"
147140
" -m: memory size in MB\n"
148141
" -p: pin 'vcpu' to 'hostcpu'\n"
149142
" -s: <slot,driver,configinfo> PCI slot config\n"
150-
" -S: guest memory cannot be swapped\n"
151-
" -u: RTC keeps UTC time\n"
152143
" -U: uuid\n"
153-
" -w: ignore unimplemented MSRs\n"
154144
" -W: force virtio to use single-vector MSI\n"
155-
" -x: local apic is in x2APIC mode\n"
156145
" -Y: disable MPtable generation\n"
157146
" -k: kernel image path\n"
158147
" -r: ramdisk image path\n"
@@ -168,7 +157,7 @@ usage(int code)
168157
" --part_info: guest partition info file path\n"
169158
" --enable_trusty: enable trusty for guest\n"
170159
" --ptdev_no_reset: disable reset check for ptdev\n"
171-
" --debugexit: enable debug exit function\n",
160+
" --debugexit: enable debug exit function\n",
172161
progname, (int)strlen(progname), "", (int)strlen(progname), "",
173162
(int)strlen(progname), "");
174163

@@ -445,7 +434,6 @@ vm_init_vdevs(struct vmctx *ctx)
445434
goto vpit_fail;
446435

447436
sci_init(ctx);
448-
init_bvmcons();
449437

450438
if (debugexit_enabled)
451439
init_debugexit();
@@ -466,7 +454,6 @@ vm_init_vdevs(struct vmctx *ctx)
466454
if (debugexit_enabled)
467455
deinit_debugexit();
468456

469-
deinit_bvmcons();
470457
vpit_deinit(ctx);
471458
vpit_fail:
472459
vrtc_deinit(ctx);
@@ -487,7 +474,6 @@ vm_deinit_vdevs(struct vmctx *ctx)
487474
if (debugexit_enabled)
488475
deinit_debugexit();
489476

490-
deinit_bvmcons();
491477
vpit_deinit(ctx);
492478
vrtc_deinit(ctx);
493479
ioc_deinit(ctx);
@@ -715,24 +701,16 @@ enum {
715701
};
716702

717703
static struct option long_options[] = {
718-
{"no_x2apic_mode", no_argument, 0, 'a' },
719704
{"acpi", no_argument, 0, 'A' },
720-
{"bvmcons", no_argument, 0, 'b' },
721705
{"pincpu", required_argument, 0, 'p' },
722706
{"ncpus", required_argument, 0, 'c' },
723-
{"memflags_incore", no_argument, 0, 'C' },
724707
{"elf_file", required_argument, 0, 'E' },
725-
{"gdb_port", required_argument, 0, 'g' },
726-
{"ioc node", required_argument, 0, 'i' },
708+
{"ioc_node", required_argument, 0, 'i' },
727709
{"lpc", required_argument, 0, 'l' },
728710
{"pci_slot", required_argument, 0, 's' },
729-
{"memflags_wired", no_argument, 0, 'S' },
730711
{"memsize", required_argument, 0, 'm' },
731-
{"rtc_localtime", no_argument, 0, 'u' },
732712
{"uuid", required_argument, 0, 'U' },
733-
{"strictmsr", no_argument, 0, 'w' },
734713
{"virtio_msix", no_argument, 0, 'W' },
735-
{"x2apic_mode", no_argument, 0, 'x' },
736714
{"mptgen", no_argument, 0, 'Y' },
737715
{"kernel", required_argument, 0, 'k' },
738716
{"ramdisk", required_argument, 0, 'r' },
@@ -756,23 +734,21 @@ static struct option long_options[] = {
756734
{0, 0, 0, 0 },
757735
};
758736

759-
static char optstr[] = "abhuwxACSWYvE:k:r:B:p:g:c:s:m:l:U:G:i:";
737+
static char optstr[] = "hAWYvE:k:r:B:p:c:s:m:l:U:G:i:";
760738

761739
int
762740
dm_run(int argc, char *argv[])
763741
{
764-
int c, error, gdb_port, err;
765-
int max_vcpus, mptgen, memflags;
742+
int c, error, err;
743+
int max_vcpus, mptgen;
766744
struct vmctx *ctx;
767745
size_t memsize;
768746
int option_idx = 0;
769747

770748
progname = basename(argv[0]);
771-
gdb_port = 0;
772749
guest_ncpus = 1;
773750
memsize = 256 * MB;
774751
mptgen = 1;
775-
memflags = 0;
776752
quit_vm_loop = 0;
777753

778754
if (signal(SIGHUP, sig_handler_term) == SIG_ERR)
@@ -783,15 +759,9 @@ dm_run(int argc, char *argv[])
783759
while ((c = getopt_long(argc, argv, optstr, long_options,
784760
&option_idx)) != -1) {
785761
switch (c) {
786-
case 'a':
787-
x2apic_mode = 0;
788-
break;
789762
case 'A':
790763
acpi = 1;
791764
break;
792-
case 'b':
793-
enable_bvmcons();
794-
break;
795765
case 'p':
796766
if (pincpu_parse(optarg) != 0) {
797767
errx(EX_USAGE,
@@ -802,19 +772,12 @@ dm_run(int argc, char *argv[])
802772
case 'c':
803773
guest_ncpus = atoi(optarg);
804774
break;
805-
case 'C':
806-
memflags |= VM_MEM_F_INCORE;
807-
break;
808775
case 'E':
809776
if (acrn_parse_elf(optarg) != 0)
810777
exit(1);
811778
else
812779
break;
813780
break;
814-
case 'g':
815-
gdb_port = atoi(optarg);
816-
break;
817-
818781
case 'i':
819782
ioc_parse(optarg);
820783
break;
@@ -831,29 +794,17 @@ dm_run(int argc, char *argv[])
831794
exit(1);
832795
else
833796
break;
834-
case 'S':
835-
memflags |= VM_MEM_F_WIRED;
836-
break;
837797
case 'm':
838798
error = vm_parse_memsize(optarg, &memsize);
839799
if (error)
840800
errx(EX_USAGE, "invalid memsize '%s'", optarg);
841801
break;
842-
case 'u':
843-
vrtc_enable_localtime(0);
844-
break;
845802
case 'U':
846803
guest_uuid_str = optarg;
847804
break;
848-
case 'w':
849-
strictmsr = 0;
850-
break;
851805
case 'W':
852806
virtio_msix = 0;
853807
break;
854-
case 'x':
855-
x2apic_mode = 1;
856-
break;
857808
case 'Y':
858809
mptgen = 0;
859810
break;
@@ -944,7 +895,6 @@ dm_run(int argc, char *argv[])
944895
goto fail;
945896
}
946897

947-
vm_set_memflags(ctx, memflags);
948898
err = vm_setup_memory(ctx, memsize);
949899
if (err) {
950900
fprintf(stderr, "Unable to setup memory (%d)\n", errno);
@@ -958,9 +908,6 @@ dm_run(int argc, char *argv[])
958908
goto mevent_fail;
959909
}
960910

961-
if (gdb_port != 0)
962-
fprintf(stderr, "dbgport not supported\n");
963-
964911
if (vm_init_vdevs(ctx) < 0) {
965912
fprintf(stderr, "Unable to init vdev (%d)\n", errno);
966913
goto dev_fail;

0 commit comments

Comments
 (0)