|
|
9ae3a8 |
From d451bbe0826ead2944fcea51e70cab1a40c0c478 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Vadim Rozenfeld <vrozenfe@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 3 Mar 2014 12:09:23 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 11/12] target-i386: Cleanup 'foo' feature handling
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Vadim Rozenfeld <vrozenfe@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1393848564-10511-12-git-send-email-vrozenfe@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 57967
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.0 qemu-kvm v4 PATCH 11/12] target-i386: Cleanup 'foo' feature handling
|
|
|
9ae3a8 |
Bugzilla: 1057173
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Juan Quintela <quintela@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Features check, enforce, hv_relaxed and hv_vapic are treated as boolean
|
|
|
9ae3a8 |
set to 'on' when passed from command line, so it's not necessary to
|
|
|
9ae3a8 |
handle each of them separately. Collapse them to one catch-all branch
|
|
|
9ae3a8 |
which will treat any feature in format 'foo' as boolean set to 'on'.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Any unknown feature will be rejected by CPU property setter so there is no
|
|
|
9ae3a8 |
need to check for unknown feature in cpu_x86_parse_featurestr(), therefore
|
|
|
9ae3a8 |
it's replaced by above mentioned catch-all handler.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
|
|
9ae3a8 |
(cherry picked from commit 258f5abe9a8786c410f98367e9e042ee16c249f2)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
target-i386/cpu.c | 13 ++-----------
|
|
|
9ae3a8 |
1 file changed, 2 insertions(+), 11 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
target-i386/cpu.c | 13 ++-----------
|
|
|
9ae3a8 |
1 files changed, 2 insertions(+), 11 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
|
|
|
9ae3a8 |
index 9f2a04e..8421dfc 100644
|
|
|
9ae3a8 |
--- a/target-i386/cpu.c
|
|
|
9ae3a8 |
+++ b/target-i386/cpu.c
|
|
|
9ae3a8 |
@@ -1683,18 +1683,9 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char *features, Error **errp)
|
|
|
9ae3a8 |
error_setg(errp, "unrecognized feature %s", featurestr);
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
- } else if (!strcmp(featurestr, "check")) {
|
|
|
9ae3a8 |
- object_property_parse(OBJECT(cpu), "on", featurestr, errp);
|
|
|
9ae3a8 |
- } else if (!strcmp(featurestr, "enforce")) {
|
|
|
9ae3a8 |
- object_property_parse(OBJECT(cpu), "on", featurestr, errp);
|
|
|
9ae3a8 |
- } else if (!strcmp(featurestr, "hv_relaxed")) {
|
|
|
9ae3a8 |
- object_property_parse(OBJECT(cpu), "on", "hv-relaxed", errp);
|
|
|
9ae3a8 |
- } else if (!strcmp(featurestr, "hv_vapic")) {
|
|
|
9ae3a8 |
- object_property_parse(OBJECT(cpu), "on", "hv-vapic", errp);
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
- error_setg(errp, "feature string `%s' not in format (+feature|"
|
|
|
9ae3a8 |
- "-feature|feature=xyz)", featurestr);
|
|
|
9ae3a8 |
- goto out;
|
|
|
9ae3a8 |
+ feat2prop(featurestr);
|
|
|
9ae3a8 |
+ object_property_parse(OBJECT(cpu), "on", featurestr, errp);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (error_is_set(errp)) {
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|