From 513eafd6f0d6684308a9a32ef883dd951b234fb8 Mon Sep 17 00:00:00 2001 From: Chenli Wei Date: Tue, 19 Apr 2022 13:32:08 +0800 Subject: [PATCH] dm: optimize the sub parameter of "-s" compatibility This patch checks the change of "-s" sub parameters, which was obsoleted or moved and the print some warnings msg or show the new format. The following obsoleted parameters are covered: -s ,pci-gvt -s ,virtio-hdcp -s ,npk -s ,virtio-coreu --mac_seed Reviewed-by: VanCutsem Geoffroy Signed-off-by: Chenli Wei --- devicemodel/core/main.c | 5 +++++ devicemodel/hw/pci/core.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index 2c73c7fac..299a38dee 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -799,6 +799,7 @@ static struct option long_options[] = { {"version", no_argument, 0, 'v' }, {"gvtargs", required_argument, 0, 'G' }, {"help", no_argument, 0, 'h' }, + {"mac_seed", required_argument, 0, CMD_OPT_MAC_SEED}, /* Following cmd option only has long option */ #ifdef CONFIG_VM_CFG @@ -942,6 +943,10 @@ main(int argc, char *argv[]) optarg); } break; + case CMD_OPT_MAC_SEED: + pr_warn("The \"--mac_seed\" parameter is obsolete\n"); + pr_warn("Please use the \"virtio-net,= mac_seed=\"\n"); + break; case CMD_OPT_DEBUGEXIT: debugexit_enabled = true; break; diff --git a/devicemodel/hw/pci/core.c b/devicemodel/hw/pci/core.c index 00a41d487..4f52a76a4 100644 --- a/devicemodel/hw/pci/core.c +++ b/devicemodel/hw/pci/core.c @@ -310,6 +310,12 @@ pci_parse_slot(char *opt) goto done; } + if ((strcmp("pci-gvt", emul) == 0) || (strcmp("virtio-hdcp", emul) == 0) + || (strcmp("npk", emul) == 0) || (strcmp("virtio-coreu", emul) == 0)) { + pr_warn("The \"%s\" parameter is obsolete and ignored\n", emul); + goto done; + } + /* :: */ if (parse_bdf(str, &bnum, &snum, &fnum, 10) != 0) snum = -1;