diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8eef4f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/qemu-2.1.0.tar.bz2 diff --git a/.qemu-guest-agent.metadata b/.qemu-guest-agent.metadata new file mode 100644 index 0000000..bb550a3 --- /dev/null +++ b/.qemu-guest-agent.metadata @@ -0,0 +1 @@ +b2829491e4c2f3d32f7bc2860c3a19fb31f5e989 SOURCES/qemu-2.1.0.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/99-qemu-guest-agent.rules b/SOURCES/99-qemu-guest-agent.rules new file mode 100644 index 0000000..8a290ab --- /dev/null +++ b/SOURCES/99-qemu-guest-agent.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \ + TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service" diff --git a/SOURCES/ga-Revert-Use-legacy-SMBIOS-for-rhel-machine-types.patch b/SOURCES/ga-Revert-Use-legacy-SMBIOS-for-rhel-machine-types.patch new file mode 100644 index 0000000..4fbfc7c --- /dev/null +++ b/SOURCES/ga-Revert-Use-legacy-SMBIOS-for-rhel-machine-types.patch @@ -0,0 +1,43 @@ +From cbd172d38d8bceebc6d1678e4c7b0ec3ac765662 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:36 +0200 +Subject: [PATCH 02/24] Revert "Use legacy SMBIOS for rhel machine types." + +Message-id: <1407743689-13553-3-git-send-email-armbru@redhat.com> +Patchwork-id: 60502 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 02/15] Revert "Use legacy SMBIOS for rhel machine types." +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +This reverts commit 6871e380d83d42541b89790129ae957c653e463c. + +Incorrect, because it neglects to cover pc-*-rhel7.0.0. + +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 2 -- + 1 file changed, 2 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 1393ca1..519c9cd 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1120,8 +1120,6 @@ static void pc_compat_rhel650(MachineState *machine) + if (!machine->cpu_model) { + machine->cpu_model = "cpu64-rhel6"; + } +- smbios_legacy_mode = true; +- + x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC); +-- +1.7.1 + diff --git a/SOURCES/ga-exit-when-no-kvm-and-vcpu-count-160.patch b/SOURCES/ga-exit-when-no-kvm-and-vcpu-count-160.patch new file mode 100644 index 0000000..b26e35c --- /dev/null +++ b/SOURCES/ga-exit-when-no-kvm-and-vcpu-count-160.patch @@ -0,0 +1,71 @@ +From d832249687955a37538098ea2c18d14c49011b02 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:35 +0200 +Subject: [PATCH 01/24] exit when -no-kvm and vcpu count > 160 + +Message-id: <1407743689-13553-2-git-send-email-armbru@redhat.com> +Patchwork-id: 60504 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 01/15] exit when -no-kvm and vcpu count > 160 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +From: Marcelo Tosatti + +Message-id: <20140506072044.GA25261@amt.cnet> +Patchwork-id: 58695 +O-Subject: [RHEL7 qemu-kvm PATCH] exit when -no-kvm and vcpu count > 160 +Bugzilla: 1076326 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Andrew Jones +RH-Acked-by: Markus Armbruster +RH-Acked-by: Eduardo Habkost + +Exit when booting with -no-kvm and number of vcpus is +larger than 160. + +Signed-off-by: Marcelo Tosatti +BZ: 1076326 +(cherry picked from commit bc949bc00c11f49ba6be7be5b4f1bfc7df93aad5) + +Conflicts: + hw/i386/pc_piix.c + hw/i386/pc_q35.c + +Conflicts because we ported upstream commit a0dba64 "pc: reduce +duplication, fix PIIX descriptions" to the RHEL machine types in +commit 04a7c6a "set model in PC_RHEL6_5_COMPAT for qemu32 VCPU +(RHEV-7.1 only)". + +Original subject has become misleading. Since commit 9ba3cf5 +"kvm-all: exit in case max vcpus exceeded", we exit just fine without +this patch. We still need it anyway, so that QMP command +query-machines returns the correct value 160 for member cpu-max, +instead of 255. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index f4b9b2b..de46485 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -506,6 +506,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + #define PC_DEFAULT_MACHINE_OPTIONS \ + PC_COMMON_MACHINE_OPTIONS, \ + .hot_add_cpu = pc_hot_add_cpu, \ +- .max_cpus = 255 ++ .max_cpus = 160 + + #endif +-- +1.7.1 + diff --git a/SOURCES/ga-pc-RHEL-6-CPUID-compat-code-for-Broadwell-CPU-model.patch b/SOURCES/ga-pc-RHEL-6-CPUID-compat-code-for-Broadwell-CPU-model.patch new file mode 100644 index 0000000..195b6ef --- /dev/null +++ b/SOURCES/ga-pc-RHEL-6-CPUID-compat-code-for-Broadwell-CPU-model.patch @@ -0,0 +1,48 @@ +From 59f0354c06b2bf7fa005a4e7bd1d8df2801a4c67 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 19 Aug 2014 18:52:37 +0200 +Subject: [PATCH 22/24] pc: RHEL-6 CPUID compat code for Broadwell CPU model + +Message-id: <20140819185237.GA26538@thinpad.lan.raisama.net> +Patchwork-id: 60631 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH] pc: RHEL-6 CPUID compat code for Broadwell CPU model +Bugzilla: 1111351 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Markus Armbruster + +Bugzilla: 1111351 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7858629 + +On RHEL-6, the Broadwell CPU model don't have the RDTSCP and SMAP +features. Add compatibility code to ensure we stay compatible when +migrating from RHEL-6. + +Signed-off-by: Eduardo Habkost +--- + hw/i386/pc_piix.c | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 37ed4ef..38018f6 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1122,6 +1122,10 @@ static void pc_compat_rhel650(MachineState *machine) + CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | + CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, + 0); ++ x86_cpu_compat_set_features("Broadwell", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Broadwell", FEAT_7_0_EBX, ++ 0, CPUID_7_0_EBX_SMAP); + + /* RHEL-6 kernel never supported exposing RDTSCP */ + x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0, CPUID_EXT2_RDTSCP); +-- +1.7.1 + diff --git a/SOURCES/ga-pc-q35-rhel7.0.0-Disable-x2apic-default.patch b/SOURCES/ga-pc-q35-rhel7.0.0-Disable-x2apic-default.patch new file mode 100644 index 0000000..4ab8eef --- /dev/null +++ b/SOURCES/ga-pc-q35-rhel7.0.0-Disable-x2apic-default.patch @@ -0,0 +1,47 @@ +From 5d27791054bbe73f5f8ec833917ffb1fcc7141b9 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Fri, 15 Aug 2014 19:52:47 +0200 +Subject: [PATCH 16/24] pc-q35-rhel7.0.0: Disable x2apic default + +Message-id: <1408132367-16851-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 60598 +O-Subject: [RHEL-7.1 qemu-kvm-rhev PATCH] pc-q35-rhel7.0.0: Disable x2apic default +Bugzilla: 1118665 +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Markus Armbruster +RH-Acked-by: Laszlo Ersek + +Bugzilla: 1118665 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7850112 + +The fix on commit 6db0e725503caac1c10902e692fbb697626fb3f2 didn't +include pc-q35-rhel7.0.0, which also didn't have x2apic enabled on all +CPU models on RHEL-7.0. Fix it too. + +Signed-off-by: Eduardo Habkost +--- + hw/i386/pc_q35.c | 3 +++ + 1 file changed, 3 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_q35.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index abfaf60..bed13a2 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -437,6 +437,9 @@ machine_init(pc_q35_machine_init); + + static void pc_q35_compat_rhel700(MachineState *machine) + { ++ /* Upstream enables it for everyone, we're a little more selective */ ++ x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC); ++ + x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-.power_controller_present-off-for-machine-types.patch b/SOURCES/ga-rhel-.power_controller_present-off-for-machine-types.patch new file mode 100644 index 0000000..b062a85 --- /dev/null +++ b/SOURCES/ga-rhel-.power_controller_present-off-for-machine-types.patch @@ -0,0 +1,50 @@ +From 4a1db2699d1bec63d7124a3d49ac2597b2852f87 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:48 +0200 +Subject: [PATCH 14/24] rhel: *.power_controller_present=off for machine types <= 7.0 + +Message-id: <1407743689-13553-15-git-send-email-armbru@redhat.com> +Patchwork-id: 60507 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 14/15] rhel: *.power_controller_present=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit f23b6bd. + +Adding to PC_RHEL7_0_COMPAT even though only q35 types need it, just +to stay close to upstream, which has it in PC_COMPAT_2_0. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index de0570c..0c701e8 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -553,6 +553,14 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "memory-hotplug-support",\ + .value = "off",\ + },{\ ++ .driver = "xio3130-downstream",\ ++ .property = COMPAT_PROP_PCP,\ ++ .value = "off",\ ++ },{\ ++ .driver = "ioh3420",\ ++ .property = COMPAT_PROP_PCP,\ ++ .value = "off",\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-Fix-ACPI-table-size-for-machine-types-7.0.patch b/SOURCES/ga-rhel-Fix-ACPI-table-size-for-machine-types-7.0.patch new file mode 100644 index 0000000..f8b5ebd --- /dev/null +++ b/SOURCES/ga-rhel-Fix-ACPI-table-size-for-machine-types-7.0.patch @@ -0,0 +1,43 @@ +From f00a8280b576b874731e924f8ce1af28bb38808c Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:39 +0200 +Subject: [PATCH 05/24] rhel: Fix ACPI table size for machine types <=7.0 + +Message-id: <1407743689-13553-6-git-send-email-armbru@redhat.com> +Patchwork-id: 60511 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 05/15] rhel: Fix ACPI table size for machine types <=7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update the RHEL i440fx machine types for upstream commit 07fb617. + +The upstream commit does not cover q35 types "since QEMU 2.0 didn't +support Q35 migration." RHEL follows suit. + +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 1 + + 1 file changed, 1 insertion(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e21eb72..40d13fe 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -954,6 +954,7 @@ static void pc_compat_rhel700(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, + CPUID_EXT2_RDTSCP); + ++ legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ + smbios_legacy_mode = true; + has_reserved_memory = false; + } +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-Fix-missing-pc-q35-rhel7.0.0-compatibility-prop.patch b/SOURCES/ga-rhel-Fix-missing-pc-q35-rhel7.0.0-compatibility-prop.patch new file mode 100644 index 0000000..261dd33 --- /dev/null +++ b/SOURCES/ga-rhel-Fix-missing-pc-q35-rhel7.0.0-compatibility-prop.patch @@ -0,0 +1,112 @@ +From 21de88452452d9f866b45b01fad19bf3ed88ca75 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:40 +0200 +Subject: [PATCH 06/24] rhel: Fix missing pc-q35-rhel7.0.0 compatibility properties + +Message-id: <1407743689-13553-7-git-send-email-armbru@redhat.com> +Patchwork-id: 60515 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 06/15] rhel: Fix missing pc-q35-rhel7.0.0 compatibility properties +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Commit 72bb13d created PC_RHEL7_0_COMPAT, but assigned it only to +pc_machine_rhel700.compat_props. Assign it to pc_q35_machine_rhel700, +too. + +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 17 ----------------- + hw/i386/pc_q35.c | 4 ++++ + include/hw/i386/pc.h | 26 ++++++++++++++++++++++++++ + 3 files changed, 30 insertions(+), 17 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 17 ----------------- + hw/i386/pc_q35.c | 4 ++++ + include/hw/i386/pc.h | 26 ++++++++++++++++++++++++++ + 3 files changed, 30 insertions(+), 17 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 40d13fe..37ed4ef 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -959,23 +959,6 @@ static void pc_compat_rhel700(MachineState *machine) + has_reserved_memory = false; + } + +-/* +- * RHE[LV] This set of items are from include/hw/i386/pc.h where they +- * are part of the PC_COMPAT_* defs. RHEL7 was QEMU 1.5.3 derived so pick up +- * the diffs from 1.5 onwards MINUS the things that were already in RHEL7 +- * e.g. msos-desc +- */ +-#define PC_RHEL7_0_COMPAT \ +- {\ +- .driver = "PIIX4_PM",\ +- .property = "acpi-pci-hotplug-with-bridge-support",\ +- .value = "off",\ +- },{\ +- .driver = "e1000",\ +- .property = "mitigation",\ +- .value = "off",\ +- } +- + static void pc_init_rhel700(MachineState *machine) + { + pc_compat_rhel700(machine); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index eb015aa..abfaf60 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -479,6 +479,10 @@ static QEMUMachine pc_q35_machine_rhel700 = { + .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)", + .init = pc_q35_init_rhel700, + .default_machine_opts = "firmware=bios-256k.bin", ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL7_0_COMPAT, ++ { /* end of list */ } ++ }, + }; + + static void rhel_pc_q35_machine_init(void) +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index de46485..40ef0ea 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -508,4 +508,30 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .hot_add_cpu = pc_hot_add_cpu, \ + .max_cpus = 160 + ++/* ++ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine ++ * types as the PC_COMPAT_* do for upstream types. ++ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. ++ * PC_RHEL6_*_COMPAT apply to i440fx types only, and therefore live ++ * in pc_piix.c. ++ */ ++ ++/* ++ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_* ++ * between our base and 1.5, less stuff backported to RHEL-7.0 ++ * (usb-device.msos-desc), less stuff for devices we changed ++ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x, ++ * pci-serial-4x) in 7.0. ++ */ ++#define PC_RHEL7_0_COMPAT \ ++ {\ ++ .driver = "PIIX4_PM",\ ++ .property = "acpi-pci-hotplug-with-bridge-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "mitigation",\ ++ .value = "off",\ ++ } ++ + #endif +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-ICH9-LPC.memory-hotplug-support-off-for-machine.patch b/SOURCES/ga-rhel-ICH9-LPC.memory-hotplug-support-off-for-machine.patch new file mode 100644 index 0000000..107b8f3 --- /dev/null +++ b/SOURCES/ga-rhel-ICH9-LPC.memory-hotplug-support-off-for-machine.patch @@ -0,0 +1,46 @@ +From a1a2b48196187e42304006db16831216f4b083af Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:47 +0200 +Subject: [PATCH 13/24] rhel: ICH9-LPC.memory-hotplug-support=off for machine types <= 7.0 + +Message-id: <1407743689-13553-14-git-send-email-armbru@redhat.com> +Patchwork-id: 60510 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 13/15] rhel: ICH9-LPC.memory-hotplug-support=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 1f86218. + +Adding to PC_RHEL7_0_COMPAT even though only q35 types need it, just +to stay close to upstream, which has it in PC_COMPAT_2_0. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 032abfe..de0570c 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -549,6 +549,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "guest_announce",\ + .value = "off",\ + },{\ ++ .driver = "ICH9-LPC",\ ++ .property = "memory-hotplug-support",\ ++ .value = "off",\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-PIIX4_PM.memory-hotplug-support-off-for-machine.patch b/SOURCES/ga-rhel-PIIX4_PM.memory-hotplug-support-off-for-machine.patch new file mode 100644 index 0000000..f194528 --- /dev/null +++ b/SOURCES/ga-rhel-PIIX4_PM.memory-hotplug-support-off-for-machine.patch @@ -0,0 +1,43 @@ +From 1765da31897cdc9e6a40e446cbe1fe2bc54a858b Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:42 +0200 +Subject: [PATCH 08/24] rhel: PIIX4_PM.memory-hotplug-support=off for machine types <= 7.0 + +Message-id: <1407743689-13553-9-git-send-email-armbru@redhat.com> +Patchwork-id: 60508 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 08/15] rhel: PIIX4_PM.memory-hotplug-support=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 3477432. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 22fd0c6..99abd47 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -530,6 +530,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .value = "off",\ + },{\ + .driver = "PIIX4_PM",\ ++ .property = "memory-hotplug-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ + },{\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-Suppress-hotplug-memory-address-space-for-machi.patch b/SOURCES/ga-rhel-Suppress-hotplug-memory-address-space-for-machi.patch new file mode 100644 index 0000000..7fa8a0a --- /dev/null +++ b/SOURCES/ga-rhel-Suppress-hotplug-memory-address-space-for-machi.patch @@ -0,0 +1,54 @@ +From 00ed2929b78e1c01e8bd581d0bace0ab2fdeb189 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:38 +0200 +Subject: [PATCH 04/24] rhel: Suppress hotplug memory address space for machine types <=7.0 + +Message-id: <1407743689-13553-5-git-send-email-armbru@redhat.com> +Patchwork-id: 60505 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 04/15] rhel: Suppress hotplug memory address space for machine types <=7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update the RHEL machine types for upstream commit de268e1. + +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 1 + + hw/i386/pc_q35.c | 1 + + 2 files changed, 2 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 1 + + hw/i386/pc_q35.c | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e23fb7f..e21eb72 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -955,6 +955,7 @@ static void pc_compat_rhel700(MachineState *machine) + CPUID_EXT2_RDTSCP); + + smbios_legacy_mode = true; ++ has_reserved_memory = false; + } + + /* +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index e433cb6..eb015aa 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -463,6 +463,7 @@ static void pc_q35_compat_rhel700(MachineState *machine) + CPUID_EXT2_RDTSCP); + + smbios_legacy_mode = true; ++ has_reserved_memory = false; + } + + static void pc_q35_init_rhel700(MachineState *machine) +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-Use-SMBIOS-legacy-mode-for-machine-types-7.0.patch b/SOURCES/ga-rhel-Use-SMBIOS-legacy-mode-for-machine-types-7.0.patch new file mode 100644 index 0000000..55e73aa --- /dev/null +++ b/SOURCES/ga-rhel-Use-SMBIOS-legacy-mode-for-machine-types-7.0.patch @@ -0,0 +1,56 @@ +From c5e6a9da50c82ea44f14eb37a09f03e0a585e38e Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:37 +0200 +Subject: [PATCH 03/24] rhel: Use SMBIOS legacy mode for machine types <=7.0 + +Message-id: <1407743689-13553-4-git-send-email-armbru@redhat.com> +Patchwork-id: 60514 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 03/15] rhel: Use SMBIOS legacy mode for machine types <=7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update the RHEL machine types for upstream commit c97294e. + +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + 2 files changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 519c9cd..e23fb7f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -953,6 +953,8 @@ static void pc_compat_rhel700(MachineState *machine) + CPUID_EXT2_RDTSCP); + x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, + CPUID_EXT2_RDTSCP); ++ ++ smbios_legacy_mode = true; + } + + /* +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index a72654d..e433cb6 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -461,6 +461,8 @@ static void pc_q35_compat_rhel700(MachineState *machine) + CPUID_EXT2_RDTSCP); + x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, + CPUID_EXT2_RDTSCP); ++ ++ smbios_legacy_mode = true; + } + + static void pc_q35_init_rhel700(MachineState *machine) +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-apic.version-0x11-for-machine-types-7.0.patch b/SOURCES/ga-rhel-apic.version-0x11-for-machine-types-7.0.patch new file mode 100644 index 0000000..a7b49c6 --- /dev/null +++ b/SOURCES/ga-rhel-apic.version-0x11-for-machine-types-7.0.patch @@ -0,0 +1,43 @@ +From 79e2796df3609593ba745f9ea4228ec58535a993 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:43 +0200 +Subject: [PATCH 09/24] rhel: apic.version=0x11 for machine types <= 7.0 + +Message-id: <1407743689-13553-10-git-send-email-armbru@redhat.com> +Patchwork-id: 60513 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 09/15] rhel: apic.version=0x11 for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit aa93200. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 99abd47..8be4cf4 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -533,6 +533,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "memory-hotplug-support",\ + .value = "off",\ + },{\ ++ .driver = "apic",\ ++ .property = "version",\ ++ .value = stringify(0x11),\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-nec-usb-xhci.superspeed-ports-first-off-for-mac.patch b/SOURCES/ga-rhel-nec-usb-xhci.superspeed-ports-first-off-for-mac.patch new file mode 100644 index 0000000..7ff5990 --- /dev/null +++ b/SOURCES/ga-rhel-nec-usb-xhci.superspeed-ports-first-off-for-mac.patch @@ -0,0 +1,43 @@ +From 7a8d50c2813cb9ece023816e1b4efe1d8556a4f8 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:44 +0200 +Subject: [PATCH 10/24] rhel: nec-usb-xhci.superspeed-ports-first=off for machine types <= 7.0 + +Message-id: <1407743689-13553-11-git-send-email-armbru@redhat.com> +Patchwork-id: 60509 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 10/15] rhel: nec-usb-xhci.superspeed-ports-first=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 7bafd88. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 8be4cf4..226390f 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -537,6 +537,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "version",\ + .value = stringify(0x11),\ + },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "superspeed-ports-first",\ ++ .value = "off",\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-pci-serial.prog_if-0-for-machine-types-7.0.patch b/SOURCES/ga-rhel-pci-serial.prog_if-0-for-machine-types-7.0.patch new file mode 100644 index 0000000..b0ea8c6 --- /dev/null +++ b/SOURCES/ga-rhel-pci-serial.prog_if-0-for-machine-types-7.0.patch @@ -0,0 +1,46 @@ +From faa97c6a64671a27c53e25f6e7657fcbd2ab02f0 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:45 +0200 +Subject: [PATCH 11/24] rhel: pci-serial.prog_if=0 for machine types <= 7.0 + +Message-id: <1407743689-13553-12-git-send-email-armbru@redhat.com> +Patchwork-id: 60512 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 11/15] rhel: pci-serial.prog_if=0 for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 13cc2c3. + +pci-serial-2x and pci-serial-4x omitted, because they're unavailable +in RHEL-7. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 226390f..0675b71 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -541,6 +541,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "superspeed-ports-first",\ + .value = "off",\ + },{\ ++ .driver = "pci-serial",\ ++ .property = "prog_if",\ ++ .value = stringify(0),\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-virtio-net-pci.ctrl_guest_offloads-off-for-mach.patch b/SOURCES/ga-rhel-virtio-net-pci.ctrl_guest_offloads-off-for-mach.patch new file mode 100644 index 0000000..32bf020 --- /dev/null +++ b/SOURCES/ga-rhel-virtio-net-pci.ctrl_guest_offloads-off-for-mach.patch @@ -0,0 +1,46 @@ +From 58e11495495647e0dea529de2271991d877be1f7 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:49 +0200 +Subject: [PATCH 15/24] rhel: virtio-net-pci.ctrl_guest_offloads=off for machine types <= 7.0 + +Message-id: <1407743689-13553-16-git-send-email-armbru@redhat.com> +Patchwork-id: 60516 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 15/15] rhel: virtio-net-pci.ctrl_guest_offloads=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 644c985. + +Note the upstream bug: the upstream commit added the compatibility +property to PC_COMPAT_1_4 even though it went in during the 1.6 cycle. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 0c701e8..9e15ff1 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -568,6 +568,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .driver = "e1000",\ + .property = "mitigation",\ + .value = "off",\ ++ },{ \ ++ .driver = "virtio-net-pci", \ ++ .property = "ctrl_guest_offloads", \ ++ .value = "off", \ + } + + #endif +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-virtio-net-pci.guest_announce-off-for-machine-t.patch b/SOURCES/ga-rhel-virtio-net-pci.guest_announce-off-for-machine-t.patch new file mode 100644 index 0000000..3a00741 --- /dev/null +++ b/SOURCES/ga-rhel-virtio-net-pci.guest_announce-off-for-machine-t.patch @@ -0,0 +1,43 @@ +From a36ec233fb5db36255aab2ac4f1de6165a94e47a Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:46 +0200 +Subject: [PATCH 12/24] rhel: virtio-net-pci.guest_announce=off for machine types <= 7.0 + +Message-id: <1407743689-13553-13-git-send-email-armbru@redhat.com> +Patchwork-id: 60506 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 12/15] rhel: virtio-net-pci.guest_announce=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit f57fcf7. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 0675b71..032abfe 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -545,6 +545,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "prog_if",\ + .value = stringify(0),\ + },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "guest_announce",\ ++ .value = "off",\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-rhel-virtio-scsi-pci.any_layout-off-for-machine-type.patch b/SOURCES/ga-rhel-virtio-scsi-pci.any_layout-off-for-machine-type.patch new file mode 100644 index 0000000..e35214d --- /dev/null +++ b/SOURCES/ga-rhel-virtio-scsi-pci.any_layout-off-for-machine-type.patch @@ -0,0 +1,43 @@ +From aaabac23b81bf5bc90c5239888f3bbe313dcec30 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 11 Aug 2014 07:54:41 +0200 +Subject: [PATCH 07/24] rhel: virtio-scsi-pci.any_layout=off for machine types <= 7.0 + +Message-id: <1407743689-13553-8-git-send-email-armbru@redhat.com> +Patchwork-id: 60517 +O-Subject: [PATCH RHEV-7.1 qemu-kvm-rhev 07/15] rhel: virtio-scsi-pci.any_layout=off for machine types <= 7.0 +Bugzilla: 1118665 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Dr. David Alan Gilbert (git) + +Update RHEL compatibility properties for upstream commit 3eff1f4. + +Signed-off-by: Markus Armbruster +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 40ef0ea..22fd0c6 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -525,6 +525,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + */ + #define PC_RHEL7_0_COMPAT \ + {\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ + .driver = "PIIX4_PM",\ + .property = "acpi-pci-hotplug-with-bridge-support",\ + .value = "off",\ +-- +1.7.1 + diff --git a/SOURCES/ga-virtio-serial-create-a-linked-list-of-all-active-dev.patch b/SOURCES/ga-virtio-serial-create-a-linked-list-of-all-active-dev.patch new file mode 100644 index 0000000..b1135d1 --- /dev/null +++ b/SOURCES/ga-virtio-serial-create-a-linked-list-of-all-active-dev.patch @@ -0,0 +1,94 @@ +From 6ecbd9a477c002a309ae3c1785a9449bde7234e3 Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Tue, 19 Aug 2014 10:09:24 +0200 +Subject: [PATCH 20/24] virtio-serial: create a linked list of all active devices + +Message-id: <7f2c1dccc51dae825c74066ef090cd3083ee068f.1408441426.git.amit.shah@redhat.com> +Patchwork-id: 60624 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 1/2] virtio-serial: create a linked list of all active devices +Bugzilla: 1003432 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Amos Kong +RH-Acked-by: Markus Armbruster + +To ensure two virtserialports don't get added to the system with the +same 'name' parameter, we need to access all the ports on all the +devices added, and compare the names. + +We currently don't have a list of all VirtIOSerial devices added to the +system. This commit adds a simple linked list in which devices are put +when they're initialized, and removed when they go away. + +Signed-off-by: Amit Shah +Reviewed-by: Markus Armbruster +(cherry picked from commit a1857ad1acbddbefe7ce8adb24b0e40991c5c38f) +Signed-off-by: Amit Shah +--- + hw/char/virtio-serial-bus.c | 10 ++++++++++ + include/hw/virtio/virtio-serial.h | 2 ++ + 2 files changed, 12 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/char/virtio-serial-bus.c | 10 ++++++++++ + include/hw/virtio/virtio-serial.h | 2 ++ + 2 files changed, 12 insertions(+), 0 deletions(-) + +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index 23123b7..49a9867 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -26,6 +26,10 @@ + #include "hw/virtio/virtio-serial.h" + #include "hw/virtio/virtio-access.h" + ++struct VirtIOSerialDevices { ++ QLIST_HEAD(, VirtIOSerial) devices; ++} vserdevices; ++ + static VirtIOSerialPort *find_port_by_id(VirtIOSerial *vser, uint32_t id) + { + VirtIOSerialPort *port; +@@ -983,6 +987,8 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp) + */ + register_savevm(dev, "virtio-console", -1, 3, virtio_serial_save, + virtio_serial_load, vser); ++ ++ QLIST_INSERT_HEAD(&vserdevices.devices, vser, next); + } + + static void virtio_serial_port_class_init(ObjectClass *klass, void *data) +@@ -1011,6 +1017,8 @@ static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp) + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VirtIOSerial *vser = VIRTIO_SERIAL(dev); + ++ QLIST_REMOVE(vser, next); ++ + unregister_savevm(dev, "virtio-console", vser); + + g_free(vser->ivqs); +@@ -1035,6 +1043,8 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data) + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); + ++ QLIST_INIT(&vserdevices.devices); ++ + dc->props = virtio_serial_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + vdc->realize = virtio_serial_device_realize; +diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h +index 4746312..a679e54 100644 +--- a/include/hw/virtio/virtio-serial.h ++++ b/include/hw/virtio/virtio-serial.h +@@ -202,6 +202,8 @@ struct VirtIOSerial { + + QTAILQ_HEAD(, VirtIOSerialPort) ports; + ++ QLIST_ENTRY(VirtIOSerial) next; ++ + /* bitmap for identifying active ports */ + uint32_t *ports_map; + +-- +1.7.1 + diff --git a/SOURCES/ga-virtio-serial-search-for-duplicate-port-names-before.patch b/SOURCES/ga-virtio-serial-search-for-duplicate-port-names-before.patch new file mode 100644 index 0000000..82e1c3b --- /dev/null +++ b/SOURCES/ga-virtio-serial-search-for-duplicate-port-names-before.patch @@ -0,0 +1,74 @@ +From 800c6850eff1379f2ab4e16d981331ac33293f0a Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Tue, 19 Aug 2014 10:09:25 +0200 +Subject: [PATCH 21/24] virtio-serial: search for duplicate port names before adding new ports + +Message-id: <6842242e3480c50fb03017aedc73d193375f69b8.1408441426.git.amit.shah@redhat.com> +Patchwork-id: 60625 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 2/2] virtio-serial: search for duplicate port names before adding new ports +Bugzilla: 1003432 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Amos Kong +RH-Acked-by: Markus Armbruster + +Before adding new ports to VirtIOSerial devices, check if there's a +conflict in the 'name' parameter. This ensures two virtserialports with +identical names are not initialized. + +Reported-by: +Signed-off-by: Amit Shah +Reviewed-by: Markus Armbruster +(cherry picked from commit d0a0bfe6729ef6044d76ea49fafa07e29fa598bd) +Signed-off-by: Amit Shah +--- + hw/char/virtio-serial-bus.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/char/virtio-serial-bus.c | 22 ++++++++++++++++++++++ + 1 files changed, 22 insertions(+), 0 deletions(-) + +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index 49a9867..3931085 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -56,6 +56,22 @@ static VirtIOSerialPort *find_port_by_vq(VirtIOSerial *vser, VirtQueue *vq) + return NULL; + } + ++static VirtIOSerialPort *find_port_by_name(char *name) ++{ ++ VirtIOSerial *vser; ++ ++ QLIST_FOREACH(vser, &vserdevices.devices, next) { ++ VirtIOSerialPort *port; ++ ++ QTAILQ_FOREACH(port, &vser->ports, next) { ++ if (!strcmp(port->name, name)) { ++ return port; ++ } ++ } ++ } ++ return NULL; ++} ++ + static bool use_multiport(VirtIOSerial *vser) + { + VirtIODevice *vdev = VIRTIO_DEVICE(vser); +@@ -855,6 +871,12 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp) + return; + } + ++ if (find_port_by_name(port->name)) { ++ error_setg(errp, "virtio-serial-bus: A port already exists by name %s", ++ port->name); ++ return; ++ } ++ + if (port->id == VIRTIO_CONSOLE_BAD_ID) { + if (plugging_port0) { + port->id = 0; +-- +1.7.1 + diff --git a/SOURCES/kvm-HMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch b/SOURCES/kvm-HMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch new file mode 100644 index 0000000..72d8b3c --- /dev/null +++ b/SOURCES/kvm-HMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch @@ -0,0 +1,90 @@ +From 8b8ea5c880eb762b8ecbcb3ad1b855282c70b61b Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 17 Dec 2013 06:46:37 +0100 +Subject: HMP: Forward-port __com.redhat_drive_add from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-5-git-send-email-armbru@redhat.com> +Patchwork-id: 56295 +O-Subject: [PATCH v2 4/6] HMP: Forward-port __com.redhat_drive_add from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Signed-off-by: Markus Armbruster + +diff --git a/blockdev.c b/blockdev.c +index eeecdf8..f9db328 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -2673,3 +2673,17 @@ QemuOptsList qemu_drive_opts = { + { /* end of list */ } + }, + }; ++ ++QemuOptsList qemu_simple_drive_opts = { ++ .name = "simple-drive", ++ .implied_opt_name = "format", ++ .head = QTAILQ_HEAD_INITIALIZER(qemu_simple_drive_opts.head), ++ .desc = { ++ /* ++ * no elements => accept any ++ * sanity checking will happen later ++ * when setting device properties ++ */ ++ { /* end if list */ } ++ } ++}; +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 71f19fb..0931bba 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1160,6 +1160,21 @@ STEXI + Add drive to PCI storage controller. + ETEXI + ++ { ++ .name = RFQDN_REDHAT "drive_add", ++ .args_type = "simple-drive:O", ++ .params = "id=name,[file=file][,format=f][,media=d]...", ++ .help = "Create a drive similar to -device if=none.", ++ .user_print = monitor_user_noop, ++ .mhandler.cmd_new = simple_drive_add, ++ }, ++ ++STEXI ++@item __com.redhat_drive_add ++@findex __com.redhat_drive_add ++Create a drive similar to -device if=none. ++ETEXI ++ + #if defined(CONFIG_PCI_HOTPLUG_OLD) && 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "pci_add", +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index d8539fd..4faa8af 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -220,6 +220,7 @@ bool usb_enabled(bool default_usb); + extern QemuOptsList qemu_legacy_drive_opts; + extern QemuOptsList qemu_common_drive_opts; + extern QemuOptsList qemu_drive_opts; ++extern QemuOptsList qemu_simple_drive_opts; + extern QemuOptsList qemu_chardev_opts; + extern QemuOptsList qemu_device_opts; + extern QemuOptsList qemu_netdev_opts; +diff --git a/vl.c b/vl.c +index 4c1c3d4..0142b26 100644 +--- a/vl.c ++++ b/vl.c +@@ -2958,6 +2958,7 @@ int main(int argc, char **argv, char **envp) + qemu_add_drive_opts(&qemu_legacy_drive_opts); + qemu_add_drive_opts(&qemu_common_drive_opts); + qemu_add_drive_opts(&qemu_drive_opts); ++ qemu_add_opts(&qemu_simple_drive_opts); + qemu_add_opts(&qemu_chardev_opts); + qemu_add_opts(&qemu_device_opts); + qemu_add_opts(&qemu_netdev_opts); diff --git a/SOURCES/kvm-QMP-Document-throttling-parameters-of-__com-redhat_drive_add.patch b/SOURCES/kvm-QMP-Document-throttling-parameters-of-__com-redhat_drive_add.patch new file mode 100644 index 0000000..49fe9ae --- /dev/null +++ b/SOURCES/kvm-QMP-Document-throttling-parameters-of-__com-redhat_drive_add.patch @@ -0,0 +1,41 @@ +From 1db4e1e18919e91aedd91d3f22eb8e24f5e9ed34 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 17 Dec 2013 06:46:38 +0100 +Subject: QMP: Document throttling parameters of __com.redhat_drive_add + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-6-git-send-email-armbru@redhat.com> +Patchwork-id: 56296 +O-Subject: [PATCH v2 5/6] QMP: Document throttling parameters of __com.redhat_drive_add +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +The previous commit copied the code from RHEL-6, including the +throttling parameters added in RHEL-6 commit ea4348a "block: Allow IO +throttling fields in __com.redhat_drive_add". That commit neglected +to update documentation, then in qemu-monitor.hx, now in +qmp-commands.hx. Update it, so that qmp-commands.txt is complete. + +Signed-off-by: Markus Armbruster + +diff --git a/qmp-commands.hx b/qmp-commands.hx +index b6080d5..5312447 100644 +--- a/qmp-commands.hx ++++ b/qmp-commands.hx +@@ -137,6 +137,12 @@ Arguments: + - "serial": Drive serial number (json-string, optional) + - "snapshot": Enable snapshot mode (json-bool, optional) + - "copy-on-read": Enable copy-on-read mode (json-bool, optional) ++- "bps": total throughput limit in bytes per second is specified ++- "bps_rd": read throughput limit in bytes per second is specified ++- "bps_wr": write throughput limit in bytes per second is specified ++- "iops": total I/O operations per second is specified ++- "iops_rd": read I/O operations per second is specified ++- "iops_wr": write I/O operations per second is specified + + Example: + diff --git a/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch b/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch new file mode 100644 index 0000000..c88b4b9 --- /dev/null +++ b/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch @@ -0,0 +1,187 @@ +From 146a96db46f86b405c0eb346d3525c56192f00e7 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 17 Dec 2013 06:46:36 +0100 +Subject: QMP: Forward-port __com.redhat_drive_add from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-4-git-send-email-armbru@redhat.com> +Patchwork-id: 56294 +O-Subject: [PATCH v2 3/6] QMP: Forward-port __com.redhat_drive_add from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Code taken from RHEL-6 as of qemu-kvm-0.12.1.2-2.418.el6, backported +and fixed up as follows: + +* Update simple_drive_add() for commit 4e89978 "qemu-option: + qemu_opts_from_qdict(): use error_set()". + +* Update simple_drive_add() for commit 2d0d283 "Support default block + interfaces per QEMUMachine". + +* Add comment explaining drive_init() error reporting hacks to + simple_drive_add(). + +* qemu-monitor.hx has been split into qmp-commands.hx and + hmp-commands.hx. Copy the QMP parts to qmp-commands.hx. Clean up + second example slightly. + +* Trailing whitespace cleaned up. + +Signed-off-by: Markus Armbruster + +diff --git a/device-hotplug.c b/device-hotplug.c +index e6a1ffb..74cc578 100644 +--- a/device-hotplug.c ++++ b/device-hotplug.c +@@ -79,3 +79,78 @@ err: + drive_del(dinfo); + } + } ++ ++static void check_parm(const char *key, QObject *obj, void *opaque) ++{ ++ static const char *valid_keys[] = { ++ "id", "cyls", "heads", "secs", "trans", "media", "snapshot", ++ "file", "cache", "aio", "format", "serial", "rerror", "werror", ++ "readonly", "copy-on-read", ++#ifdef CONFIG_BLOCK_IO_THROTTLING ++ "bps", "bps_rd", "bps_wr", "iops", "iops_rd", "iops_wr", ++#endif ++ NULL ++ ++ }; ++ int *stopped = opaque; ++ const char **p; ++ ++ if (*stopped) { ++ return; ++ } ++ ++ for (p = valid_keys; *p; p++) { ++ if (!strcmp(key, *p)) { ++ return; ++ } ++ } ++ ++ qerror_report(QERR_INVALID_PARAMETER, key); ++ *stopped = 1; ++} ++ ++int simple_drive_add(Monitor *mon, const QDict *qdict, QObject **ret_data) ++{ ++ int stopped; ++ Error *local_err = NULL; ++ QemuOpts *opts; ++ DriveInfo *dinfo; ++ MachineClass *mc; ++ ++ if (!qdict_haskey(qdict, "id")) { ++ qerror_report(QERR_MISSING_PARAMETER, "id"); ++ return -1; ++ } ++ ++ stopped = 0; ++ qdict_iter(qdict, check_parm, &stopped); ++ if (stopped) { ++ return -1; ++ } ++ ++ opts = qemu_opts_from_qdict(&qemu_drive_opts, qdict, &local_err); ++ if (!opts) { ++ qerror_report_err(local_err); ++ error_free(local_err); ++ return -1; ++ } ++ qemu_opt_set(opts, "if", "none"); ++ mc = MACHINE_GET_CLASS(current_machine); ++ dinfo = drive_new(opts, mc->block_default_type); ++ if (!dinfo) { ++ /* ++ * drive_new() reports some errors with qerror_report_err(), ++ * and some with error_report(). The latter vanish without ++ * trace in monitor_vprintf(). See also the rather optimistic ++ * upstream commit 74ee59a. Emit a generic error here. If a ++ * prior error from qerror_report_err() is pending, it'll get ++ * ignored. ++ */ ++ qerror_report(QERR_DEVICE_INIT_FAILED, ++ qemu_opts_id(opts)); ++ qemu_opts_del(opts); ++ return -1; ++ } ++ ++ return 0; ++} +diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h +index 23a5d10..9240adc 100644 +--- a/include/sysemu/blockdev.h ++++ b/include/sysemu/blockdev.h +@@ -65,4 +65,6 @@ void qmp_change_blockdev(const char *device, const char *filename, + const char *format, Error **errp); + void do_commit(Monitor *mon, const QDict *qdict); + int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data); ++ ++int simple_drive_add(Monitor *mon, const QDict *qdict, QObject **ret_data); + #endif +diff --git a/qmp-commands.hx b/qmp-commands.hx +index 68ffc94..b6080d5 100644 +--- a/qmp-commands.hx ++++ b/qmp-commands.hx +@@ -106,6 +106,52 @@ Example: + Note: The "force" argument defaults to false. + + EQMP ++ { ++ .name = RFQDN_REDHAT "drive_add", ++ .args_type = "simple-drive:O", ++ .params = "id=name,[file=file][,format=f][,media=d]...", ++ .help = "Create a drive similar to -device if=none.", ++ .user_print = monitor_user_noop, ++ .mhandler.cmd_new = simple_drive_add, ++ }, ++ ++SQMP ++__com.redhat_drive_add ++---------------------- ++ ++Create a drive similar to -device if=none. ++ ++Arguments: ++ ++- "id": Drive ID, must be unique (json-string) ++- "file": Disk image (json-string, optional) ++- "format": Disk format (json-string, optional) ++- "aio": How to perform asynchronous disk I/O (json-string, optional) ++- "cache": Host cache use policy (json-string, optional) ++- "cyls", "heads", "secs": Disk geometry (json-int, optional) ++- "trans": BIOS translation mode (json-string, optional) ++- "media": Media type (json-string, optional) ++- "readonly": Open image read-only (json-bool, optional) ++- "rerror": What to do on read error (json-string, optional) ++- "werror": What to do on write error (json-string, optional) ++- "serial": Drive serial number (json-string, optional) ++- "snapshot": Enable snapshot mode (json-bool, optional) ++- "copy-on-read": Enable copy-on-read mode (json-bool, optional) ++ ++Example: ++ ++1. Add a drive without medium: ++ ++-> { "execute": "__com.redhat_drive_add", "arguments": { "id": "foo" } } ++<- {"return": {}} ++ ++2. Add a drive with medium: ++ ++-> { "execute": "__com.redhat_drive_add", ++ "arguments": { "id": "bar", "file": "tmp.qcow2", "format": "qcow2" } } ++<- {"return": {}} ++ ++EQMP + + { + .name = RFQDN_REDHAT "drive_del", diff --git a/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_del-from-RHEL-6.patch b/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_del-from-RHEL-6.patch new file mode 100644 index 0000000..5a2c4d3 --- /dev/null +++ b/SOURCES/kvm-QMP-Forward-port-__com-redhat_drive_del-from-RHEL-6.patch @@ -0,0 +1,76 @@ +From 7d94e71b679469a33cdc00ce5989dfe8b0244646 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 17 Dec 2013 06:46:35 +0100 +Subject: QMP: Forward-port __com.redhat_drive_del from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-3-git-send-email-armbru@redhat.com> +Patchwork-id: 56292 +O-Subject: [PATCH v2 2/6] QMP: Forward-port __com.redhat_drive_del from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Upstream has drive_del, but only in HMP. The backport to RHEL-6 added +it to QMP as well. Since the QMP command is a downstream extension, +it needs the __com.redhat_ prefix. Since RHEL-6 doesn't have separate +definition of QMP and HMP commands, both the QMP and the HMP command +got the prefix. + +RHEL-7 inherits HMP command drive_del from upstream. Add QMP command +__com.redhat_drive_del for RHEL-6 compatibility. + +If we needed similar compatibility for the HMP command, we'd have to +add __com.redhat_drive_del as alias for drive_del. But we don't. + +Code copied from RHEL-6's qemu-monitor.hx as of +qemu-kvm-0.12.1.2-2.418.el6. It has a "drive_del" without the prefix +in the documentation. Fixed here. Hardly worth fixing in RHEL-6 now. + +Signed-off-by: Markus Armbruster + +diff --git a/qmp-commands.hx b/qmp-commands.hx +index 4a02a51..68ffc94 100644 +--- a/qmp-commands.hx ++++ b/qmp-commands.hx +@@ -108,6 +108,37 @@ Note: The "force" argument defaults to false. + EQMP + + { ++ .name = RFQDN_REDHAT "drive_del", ++ .args_type = "id:s", ++ .params = "device", ++ .help = "remove host block device", ++ .user_print = monitor_user_noop, ++ .mhandler.cmd_new = do_drive_del, ++ }, ++ ++SQMP ++__com.redhat_drive_del ++---------- ++ ++Remove host block device. The result is that guest generated IO is no longer ++submitted against the host device underlying the disk. Once a drive has ++been deleted, the QEMU Block layer returns -EIO which results in IO ++errors in the guest for applications that are reading/writing to the device. ++These errors are always reported to the guest, regardless of the drive's error ++actions (drive options rerror, werror). ++ ++Arguments: ++ ++- "id": the device's ID (json-string) ++ ++Example: ++ ++-> { "execute": "__com.redhat_drive_del", "arguments": { "id": "block1" } } ++<- { "return": {} } ++ ++EQMP ++ ++ { + .name = "change", + .args_type = "device:B,target:F,arg:s?", + .mhandler.cmd_new = qmp_marshal_input_change, diff --git a/SOURCES/kvm-QMP-Relax-__com-redhat_drive_add-parameter-checking.patch b/SOURCES/kvm-QMP-Relax-__com-redhat_drive_add-parameter-checking.patch new file mode 100644 index 0000000..433b09b --- /dev/null +++ b/SOURCES/kvm-QMP-Relax-__com-redhat_drive_add-parameter-checking.patch @@ -0,0 +1,74 @@ +From cc6cd369c60667753e3bff897d33961a1beaf220 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Wed, 5 Mar 2014 17:32:58 +0100 +Subject: QMP: Relax __com.redhat_drive_add parameter checking + +RH-Author: Markus Armbruster +Message-id: <1394040778-1544-2-git-send-email-armbru@redhat.com> +Patchwork-id: 58021 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] QMP: Relax __com.redhat_drive_add parameter checking +Bugzilla: 1057471 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Fam Zheng +RH-Acked-by: Amos Kong +RH-Acked-by: Kevin Wolf +RH-Acked-by: Stefan Hajnoczi + +I/O throttling and many new features are unavailable with this +command, because its parameter checking is overly restrictive. +Relax it. + +The command was forward-ported from RHEL-6 (commit 75ad257). It +provides access to drive_init() via QMP with the parameters restricted +to a subset of the ones recognized by drive_init(). We did that +because some parameters make sense only when configuring a frontend in +addition to a backend, and the command doesn't do that. + +The parameter filtering is implemented as a whitelist. The +forward-port neglected to update the whitelist for all the stuff that +has changed since RHEL-6. + +Due to new features like driver-specific parameters, a whitelist is no +longer convenient. Replace by a blacklist that contains exactly the +drive_init() parameters that are already filtered out on RHEL-6. + +Signed-off-by: Markus Armbruster + +diff --git a/device-hotplug.c b/device-hotplug.c +index 74cc578..169607a 100644 +--- a/device-hotplug.c ++++ b/device-hotplug.c +@@ -82,13 +82,8 @@ err: + + static void check_parm(const char *key, QObject *obj, void *opaque) + { +- static const char *valid_keys[] = { +- "id", "cyls", "heads", "secs", "trans", "media", "snapshot", +- "file", "cache", "aio", "format", "serial", "rerror", "werror", +- "readonly", "copy-on-read", +-#ifdef CONFIG_BLOCK_IO_THROTTLING +- "bps", "bps_rd", "bps_wr", "iops", "iops_rd", "iops_wr", +-#endif ++ static const char *unwanted_keys[] = { ++ "bus", "unit", "index", "if", "boot", "addr", + NULL + + }; +@@ -99,14 +94,14 @@ static void check_parm(const char *key, QObject *obj, void *opaque) + return; + } + +- for (p = valid_keys; *p; p++) { ++ for (p = unwanted_keys; *p; p++) { + if (!strcmp(key, *p)) { ++ qerror_report(QERR_INVALID_PARAMETER, key); ++ *stopped = 1; + return; + } + } + +- qerror_report(QERR_INVALID_PARAMETER, key); +- *stopped = 1; + } + + int simple_drive_add(Monitor *mon, const QDict *qdict, QObject **ret_data) diff --git a/SOURCES/kvm-RHEL-only-Disable-tests-that-don-t-work-with-RHEL-bu.patch b/SOURCES/kvm-RHEL-only-Disable-tests-that-don-t-work-with-RHEL-bu.patch new file mode 100644 index 0000000..946490b --- /dev/null +++ b/SOURCES/kvm-RHEL-only-Disable-tests-that-don-t-work-with-RHEL-bu.patch @@ -0,0 +1,99 @@ +From b1ea78652ddcb8084c3319d78fff928679c1a753 Mon Sep 17 00:00:00 2001 +From: dgibson +Date: Mon, 8 Sep 2014 03:41:42 +0200 +Subject: [PATCH 19/32] RHEL only: Disable tests that don't work with RHEL + build on ppc + +Message-id: <1410147705-12993-3-git-send-email-dgibson@redhat.com> +Patchwork-id: 60892 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 2/5] RHEL only: Disable tests that don't work with RHEL build on ppc +Bugzilla: 1113998 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +Some of the ppc testsuite cases rely on the PReP and various Macintosh and +embedded machine types, which we don't support in the RHEL build of +qemu-kvm-rhev. We disable those tests so that the rest of make check can +work properly. + +Signed-off-by: David Gibson + +Signed-off-by: Miroslav Rezanina +--- + tests/boot-order-test.c | 7 +++++++ + tests/endianness-test.c | 2 ++ + 2 files changed, 9 insertions(+) + +diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c +index 360a691..4249157 100644 +--- a/tests/boot-order-test.c ++++ b/tests/boot-order-test.c +@@ -112,6 +112,7 @@ static void test_pc_boot_order(void) + test_boot_orders(NULL, read_boot_order_pc, test_cases_pc); + } + ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + static uint8_t read_m48t59(uint64_t addr, uint16_t reg) + { + writeb(addr, reg & 0xff); +@@ -142,6 +143,7 @@ static uint64_t read_boot_order_pmac(void) + + return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); + } ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + + static const boot_order_test test_cases_fw_cfg[] = { + { "", 'c', 'c' }, +@@ -151,6 +153,7 @@ static const boot_order_test test_cases_fw_cfg[] = { + {} + }; + ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + static void test_pmac_oldworld_boot_order(void) + { + test_boot_orders("g3beige", read_boot_order_pmac, test_cases_fw_cfg); +@@ -159,7 +162,9 @@ static void test_pmac_oldworld_boot_order(void) + static void test_pmac_newworld_boot_order(void) + { + test_boot_orders("mac99", read_boot_order_pmac, test_cases_fw_cfg); ++ + } ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + + static uint64_t read_boot_order_sun4m(void) + { +@@ -194,11 +199,13 @@ int main(int argc, char *argv[]) + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + qtest_add_func("boot-order/pc", test_pc_boot_order); + } else if (strcmp(arch, "ppc") == 0 || strcmp(arch, "ppc64") == 0) { ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + qtest_add_func("boot-order/prep", test_prep_boot_order); + qtest_add_func("boot-order/pmac_oldworld", + test_pmac_oldworld_boot_order); + qtest_add_func("boot-order/pmac_newworld", + test_pmac_newworld_boot_order); ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + } else if (strcmp(arch, "sparc") == 0) { + qtest_add_func("boot-order/sun4m", test_sun4m_boot_order); + } else if (strcmp(arch, "sparc64") == 0) { +diff --git a/tests/endianness-test.c b/tests/endianness-test.c +index 92e17d2..0acac00 100644 +--- a/tests/endianness-test.c ++++ b/tests/endianness-test.c +@@ -40,10 +40,12 @@ static const TestCase test_cases[] = { + { "mips64", "mips", 0x14000000, .bswap = true }, + { "mips64", "malta", 0x10000000, .bswap = true }, + { "mips64el", "fulong2e", 0x1fd00000 }, ++#if 0 /* Disabled for RHEL, since only pseries machine is enabled */ + { "ppc", "g3beige", 0xfe000000, .bswap = true, .superio = "i82378" }, + { "ppc", "prep", 0x80000000, .bswap = true }, + { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" }, + { "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" }, ++#endif /* Disabled for RHEL, since CONFIG_MAC is not enabled */ + { "ppc64", "pseries", 0x10080000000ULL, + .bswap = true, .superio = "i82378" }, + { "sh4", "r2d", 0xfe240000, .superio = "i82378" }, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-only-Remove-unneeded-devices-from-ppc64-qemu-kv.patch b/SOURCES/kvm-RHEL-only-Remove-unneeded-devices-from-ppc64-qemu-kv.patch new file mode 100644 index 0000000..0482326 --- /dev/null +++ b/SOURCES/kvm-RHEL-only-Remove-unneeded-devices-from-ppc64-qemu-kv.patch @@ -0,0 +1,124 @@ +From 627800acd337aeadf93a17e5daef7fbd5c858bc7 Mon Sep 17 00:00:00 2001 +From: dgibson +Date: Mon, 8 Sep 2014 03:41:44 +0200 +Subject: [PATCH 21/32] RHEL only: Remove unneeded devices from ppc64 + qemu-kvm-rhev build + +Message-id: <1410147705-12993-5-git-send-email-dgibson@redhat.com> +Patchwork-id: 60894 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 4/5] RHEL only: Remove unneeded devices from ppc64 qemu-kvm-rhev build +Bugzilla: +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +This patch removes a bunch of devices we don't care about from the +qemu-kvm-rhev build. Specifically: + + * E500 PCI (only needed for E500 machines, which we don't support) + + * MacIO and related devices (only needed for emulated Macintosh + guests, which we don't support) + + * i82379 PCI to ISA bridge (not included on x86, and no particular + reason to have it on ppc) + + * ISA IDE controller (not included on x86 and no particular reason to + have it on ppc) + + * CMD646 IDE controller (not included on x86 and no particular reason + to have it on ppc; it was standard on some Macintosh models, but we + don't support those) + + * DEC 21154 PCI to PCI bridge (not included on x86 and no particular + reason to have it on ppc) + + * M48T59 timer/NVRAM chip (not used on pseries which is the only + machine type we care about) + + * OpenPIC interrupt controller (used on various historic ppc + machines, but not pseries) + + * ISA Parallel (not included on x86, and we have even less call for + it on ppc) + + * PowerPC 4xx embedded PCI host bridge (only used by 4xx embedded + boards, which we don't support) + +All except the last are just config changes, the last requires some +Makefile hacking. Ideally this would be changed to have its own +config option, but that will need work upstream. + +Signed-off-by: David Gibson +--- + default-configs/ppc64-softmmu.mak | 20 -------------------- + hw/ppc/Makefile.objs | 1 - + 2 files changed, 21 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + default-configs/ppc64-softmmu.mak | 20 -------------------- + hw/ppc/Makefile.objs | 1 - + 2 files changed, 21 deletions(-) + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index da6e745..01c049e 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -4,41 +4,21 @@ include pci.mak + include sound.mak + include usb.mak + CONFIG_ISA_MMIO=y +-CONFIG_ESCC=y +-CONFIG_M48T59=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCKBD=y + CONFIG_FDC=y + CONFIG_I8257=y + CONFIG_I82374=y +-CONFIG_OPENPIC=y +-CONFIG_I82378=y + CONFIG_PC87312=y +-CONFIG_MACIO=y + CONFIG_PCSPK=y +-CONFIG_CUDA=y +-CONFIG_ADB=y +-CONFIG_MAC_NVRAM=y +-CONFIG_MAC_DBDMA=y +-CONFIG_HEATHROW_PIC=y +-CONFIG_GRACKLE_PCI=y +-CONFIG_UNIN_PCI=y +-CONFIG_DEC_PCI=y +-CONFIG_PPCE500_PCI=y +-CONFIG_IDE_ISA=y +-CONFIG_IDE_CMD646=y +-CONFIG_IDE_MACIO=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y + CONFIG_I8259=y +-CONFIG_OPENPIC=y + CONFIG_PSERIES=y +-CONFIG_OPENPIC_KVM=$(and $(CONFIG_E500),$(CONFIG_KVM)) + # For pSeries + CONFIG_XICS=$(CONFIG_PSERIES) + CONFIG_XICS_KVM=$(and $(CONFIG_PSERIES),$(CONFIG_KVM)) +diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs +index 61e5316..5146136 100644 +--- a/hw/ppc/Makefile.objs ++++ b/hw/ppc/Makefile.objs +@@ -9,7 +9,6 @@ obj-y += spapr_pci_vfio.o + endif + # PowerPC 4xx boards + obj-y += ppc4xx_devs.o ppc405_uc.o +-obj-y += ppc4xx_pci.o + # PReP + obj-$(CONFIG_PREP) += prep.o + # OldWorld PowerMac +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-only-Replace-upstream-pseries-machine-types-wit.patch b/SOURCES/kvm-RHEL-only-Replace-upstream-pseries-machine-types-wit.patch new file mode 100644 index 0000000..5d65544 --- /dev/null +++ b/SOURCES/kvm-RHEL-only-Replace-upstream-pseries-machine-types-wit.patch @@ -0,0 +1,86 @@ +From dc5735659369f7adbb9f36f5aafdc6e451ea9c62 Mon Sep 17 00:00:00 2001 +From: dgibson +Date: Mon, 8 Sep 2014 03:41:45 +0200 +Subject: [PATCH 22/32] RHEL only: Replace upstream pseries machine types with + RHEL versioned types + +Message-id: <1410147705-12993-6-git-send-email-dgibson@redhat.com> +Patchwork-id: 60895 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 5/5] RHEL only: Replace upstream pseries machine types with RHEL versioned types +Bugzilla: +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +Now that we're moving to support KVM for POWER on RHEL, do the same thing +we do for PC machine types: replace the upstream defined versioned machine +types with machine types labelled by RHEL version. This allows safe +migration between qemu-kvm on different RHEL versions. + +This also makes the RHEL labelled machine type the default. + +Signed-off-by: David Gibson +--- + hw/ppc/spapr.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index d01978f..d0f4200 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1583,7 +1583,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) + + mc->name = "pseries"; + mc->desc = "pSeries Logical Partition (PAPR compliant)"; +- mc->is_default = 1; ++ mc->is_default = 0; + mc->init = ppc_spapr_init; + mc->reset = ppc_spapr_reset; + mc->block_default_type = IF_SCSI; +@@ -1607,6 +1607,7 @@ static const TypeInfo spapr_machine_info = { + }, + }; + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) + { + MachineClass *mc = MACHINE_CLASS(oc); +@@ -1621,11 +1622,29 @@ static const TypeInfo spapr_machine_2_1_info = { + .parent = TYPE_SPAPR_MACHINE, + .class_init = spapr_machine_2_1_class_init, + }; ++#endif ++ ++static void spapr_machine_rhel710_class_init(ObjectClass *oc, void *data) ++{ ++ MachineClass *mc = MACHINE_CLASS(oc); ++ ++ mc->name = "pseries-rhel7.1.0"; ++ mc->desc = "RHEL 7.1.0 pSeries Logical Partition (PAPR compliant)"; ++ mc->is_default = 1; ++} ++ ++static const TypeInfo spapr_machine_rhel710_info = { ++ .name = TYPE_SPAPR_MACHINE "RHEL7.1.0", ++ .parent = TYPE_SPAPR_MACHINE, ++ .class_init = spapr_machine_rhel710_class_init, ++}; ++ + + static void spapr_machine_register_types(void) + { + type_register_static(&spapr_machine_info); +- type_register_static(&spapr_machine_2_1_info); ++ /* type_register_static(&spapr_machine_2_1_info); */ ++ type_register_static(&spapr_machine_rhel710_info); + } + + type_init(spapr_machine_register_types) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-onlyy-Disable-unused-ppc-machine-types.patch b/SOURCES/kvm-RHEL-onlyy-Disable-unused-ppc-machine-types.patch new file mode 100644 index 0000000..e1b5bfc --- /dev/null +++ b/SOURCES/kvm-RHEL-onlyy-Disable-unused-ppc-machine-types.patch @@ -0,0 +1,81 @@ +From 5fac7bc922453532fccaed72e50e630498a955f8 Mon Sep 17 00:00:00 2001 +From: dgibson +Date: Mon, 8 Sep 2014 03:41:43 +0200 +Subject: [PATCH 20/32] RHEL onlyy: Disable unused ppc machine types + +Message-id: <1410147705-12993-4-git-send-email-dgibson@redhat.com> +Patchwork-id: 60893 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 3/5] RHEL onlyy: Disable unused ppc machine types +Bugzilla: 1113998 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +The default qemu configuration for ppc64 includes a number of machine +types we don't care about for RHEL or RHEV. This include PReP, +old-style ppc based Macintosh machines, and several ppc4xx and BookE +based embedded boards. + +Some can be disabled with the config file, others require makefile hacks. + +With this patch, only the "pseries" machine type remains for ppc which +is the only one we care about for RHEV. + +Note that this only disables the machine types, it doesn't avoid +compilation of individual devices which are specific to those +machines. That's a job for another day. + +Signed-off-by: David Gibson +--- + default-configs/ppc64-softmmu.mak | 6 ------ + hw/ppc/Makefile.objs | 2 +- + 2 files changed, 1 insertion(+), 7 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + default-configs/ppc64-softmmu.mak | 6 ------ + hw/ppc/Makefile.objs | 2 +- + 2 files changed, 1 insertion(+), 7 deletions(-) + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index c122b25..da6e745 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -16,7 +16,6 @@ CONFIG_FDC=y + CONFIG_I8257=y + CONFIG_I82374=y + CONFIG_OPENPIC=y +-CONFIG_PREP_PCI=y + CONFIG_I82378=y + CONFIG_PC87312=y + CONFIG_MACIO=y +@@ -37,13 +36,8 @@ CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y + CONFIG_I8259=y +-CONFIG_XILINX=y +-CONFIG_XILINX_ETHLITE=y + CONFIG_OPENPIC=y + CONFIG_PSERIES=y +-CONFIG_PREP=y +-CONFIG_MAC=y +-CONFIG_E500=y + CONFIG_OPENPIC_KVM=$(and $(CONFIG_E500),$(CONFIG_KVM)) + # For pSeries + CONFIG_XICS=$(CONFIG_PSERIES) +diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs +index 19d9920..61e5316 100644 +--- a/hw/ppc/Makefile.objs ++++ b/hw/ppc/Makefile.objs +@@ -8,7 +8,7 @@ ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy) + obj-y += spapr_pci_vfio.o + endif + # PowerPC 4xx boards +-obj-y += ppc405_boards.o ppc4xx_devs.o ppc405_uc.o ppc440_bamboo.o ++obj-y += ppc4xx_devs.o ppc405_uc.o + obj-y += ppc4xx_pci.o + # PReP + obj-$(CONFIG_PREP) += prep.o +-- +1.8.3.1 + diff --git a/SOURCES/kvm-__com-redhat_qxl_screendump-add-docs.patch b/SOURCES/kvm-__com-redhat_qxl_screendump-add-docs.patch new file mode 100644 index 0000000..fb71934 --- /dev/null +++ b/SOURCES/kvm-__com-redhat_qxl_screendump-add-docs.patch @@ -0,0 +1,87 @@ +From b66f73309f32d04ca63d49afc4aaa1338e77b22d Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 11 Dec 2013 09:36:11 +0100 +Subject: __com.redhat_qxl_screendump: add docs + +RH-Author: Gerd Hoffmann +Message-id: <1386754571-21520-2-git-send-email-kraxel@redhat.com> +Patchwork-id: 56149 +O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] __com.redhat_qxl_screendump: add docs +Bugzilla: 903910 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Orit Wasserman +RH-Acked-by: Juan Quintela + +$subject says all. +Patch by armbru, thanks. + +Signed-off-by: Gerd Hoffmann + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 0931bba..8219943 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -247,6 +247,13 @@ ETEXI + .help = "save screen into PPM image 'filename'", + .mhandler.cmd = hmp_screen_dump, + }, ++ ++STEXI ++@item screendump @var{filename} ++@findex screendump ++Save screen into PPM image @var{filename}. ++ETEXI ++ + { + .name = "__com.redhat_qxl_screendump", + .args_type = "id:s,filename:F", +@@ -256,9 +263,9 @@ ETEXI + }, + + STEXI +-@item screendump @var{filename} +-@findex screendump +-Save screen into PPM image @var{filename}. ++@item __com.redhat_screendump @var{id} @var{filename} ++@findex __com.redhat_screendump ++Save screen from qxl device @var{id} into PPM image @var{filename}. + ETEXI + + { +diff --git a/qmp-commands.hx b/qmp-commands.hx +index 5312447..9a246e7 100644 +--- a/qmp-commands.hx ++++ b/qmp-commands.hx +@@ -231,11 +231,6 @@ EQMP + .args_type = "filename:F", + .mhandler.cmd_new = qmp_marshal_input_screendump, + }, +- { +- .name = "__com.redhat_qxl_screendump", +- .args_type = "id:s,filename:F", +- .mhandler.cmd_new = qmp_marshal_input___com_redhat_qxl_screendump, +- }, + + SQMP + screendump +@@ -255,6 +250,20 @@ Example: + EQMP + + { ++ .name = "__com.redhat_qxl_screendump", ++ .args_type = "id:s,filename:F", ++ .mhandler.cmd_new = qmp_marshal_input___com_redhat_qxl_screendump, ++ }, ++ ++SQMP ++__com.redhat_qxl_screendump ++--------------------------- ++ ++Save screen from qxl device @var{id} into PPM image @var{filename}. ++ ++EQMP ++ ++ { + .name = "stop", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_stop, diff --git a/SOURCES/kvm-acpi-piix4-Enable-qemu-kvm-compatibility-mode.patch b/SOURCES/kvm-acpi-piix4-Enable-qemu-kvm-compatibility-mode.patch new file mode 100644 index 0000000..92532a6 --- /dev/null +++ b/SOURCES/kvm-acpi-piix4-Enable-qemu-kvm-compatibility-mode.patch @@ -0,0 +1,51 @@ +From 1a8352af8e4dafcf91e2f1ee66e7695dda9d4a4d Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 16 Oct 2013 13:07:15 +0200 +Subject: acpi/piix4: Enable qemu-kvm compatibility mode + +RH-Author: Eduardo Habkost +Message-id: <1381928835-10190-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54961 +O-Subject: [qemu-kvm RHEL-7 PATCH] acpi/piix4: Enable qemu-kvm compatibility mode +Bugzilla: 1019474 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Igor Mammedov + +Bugzilla: 1019474 +Scratch build: https://brewweb.devel.redhat.com/taskinfo?taskID=6426533 +Upstream status: not applicable + +>From the code comments: + + qemu-kvm 1.2 uses version 3 but advertised as 2 + To support incoming qemu-kvm 1.2 migration, change version_id + and minimum_version_id to 2 below (which breaks migration from + qemu 1.2). + +The v2 format of qemu-0.13 (implemented by upstream commit +4cf3e6f3d85492f20a773dd6c9068ab89ba24a18, and the one that was used on +qemu-kvm) is not compatible with the v2 format of qemu-0.15 and newer +(compatibility was broken by upstream commit +23910d3f669d46073b403876e30a7314599633af). RHEL-6 is using the former +format (RHEL-6 commit c4101c5340988caa68da87066a88d3871c8c4bf1), which +is not compatible with upstream QEMU. + +This sets minimum_version_id to 2, so we enable the qemu-kvm +compatibility mode, to allow us to load RHEL-6 migration data. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index 913b2b0..dd1f92b 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -275,7 +275,7 @@ static const VMStateDescription vmstate_memhp_state = { + static const VMStateDescription vmstate_acpi = { + .name = "piix4_pm", + .version_id = 3, +- .minimum_version_id = 3, ++ .minimum_version_id = 2, + .minimum_version_id_old = 1, + .load_state_old = acpi_load_old, + .post_load = vmstate_acpi_post_load, diff --git a/SOURCES/kvm-arm64-64K-pages-and-1024MB-guest.patch b/SOURCES/kvm-arm64-64K-pages-and-1024MB-guest.patch new file mode 100644 index 0000000..80284e4 --- /dev/null +++ b/SOURCES/kvm-arm64-64K-pages-and-1024MB-guest.patch @@ -0,0 +1,45 @@ +From 6351414be52a7fc4257b815bc6e95142e971b275 Mon Sep 17 00:00:00 2001 +From: Joel Schopp +Date: Tue, 29 Jul 2014 17:57:39 +0200 +Subject: arm64: 64K pages and > 1024MB guest + +kvm_set_phys_mem doesn't work on arm64 with memory > 1GB. It exits with: +kvm_set_phys_mem: error registering slot: Invalid argument + +An example of the failing address and size are start_addr == 0x90011000 +and size=0xaffef000. As you can see both of these are 4K aligned, not +64K aligned. + +At 1024MB or smaller qemu only makes one call to kvm_set_user_memory_region, +so the start_addr and size are aligned by accident and the bug doesn't happen. + +The following patch makes things work for me on an arm64 SOC. I also smoke +tested the patch on an x86-64 box and qemu seemed to still run fine there +with the patch applied. + +Cc: Peter Maydell +Signed-off-by: Joel Schopp +Signed-off-by: Andrew Jones + +diff --git a/kvm-all.c b/kvm-all.c +index 8f9bcb8..5091031 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -618,14 +618,14 @@ static void kvm_set_phys_mem(MemoryRegionSection *section, bool add) + + /* kvm works in page size chunks, but the function may be called + with sub-page size and unaligned start address. */ +- delta = TARGET_PAGE_ALIGN(size) - size; ++ delta = HOST_PAGE_ALIGN(start_addr) - start_addr; + if (delta > size) { + return; + } + start_addr += delta; + size -= delta; +- size &= TARGET_PAGE_MASK; +- if (!size || (start_addr & ~TARGET_PAGE_MASK)) { ++ size &= qemu_host_page_mask; ++ if (!size || (start_addr & ~qemu_host_page_mask)) { + return; + } + diff --git a/SOURCES/kvm-block-VHDX-endian-fixes.patch b/SOURCES/kvm-block-VHDX-endian-fixes.patch new file mode 100644 index 0000000..b5259f9 --- /dev/null +++ b/SOURCES/kvm-block-VHDX-endian-fixes.patch @@ -0,0 +1,472 @@ +From f4594c751d050c2a52fca14148d332317c5555f1 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Tue, 19 Aug 2014 18:16:48 +0200 +Subject: [PATCH 03/32] block: VHDX endian fixes + +Message-id: +Patchwork-id: 60630 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 2/2] block: VHDX endian fixes +Bugzilla: 1126976 +RH-Acked-by: dgibson +RH-Acked-by: Markus Armbruster +RH-Acked-by: Stefan Hajnoczi + +This patch contains several changes for endian conversion fixes for +VHDX, particularly for big-endian machines (multibyte values in VHDX are +all on disk in LE format). + +Tests were done with existing qemu-iotests on an IBM POWER7 (8406-71Y). +This includes sample images created by Hyper-V, both with dirty logs and +without. + +In addition, VHDX image files created (and written to) on a BE machine +were tested on a LE machine, and vice-versa. + +Reported-by: Markus Armburster +Reported-by: Paolo Bonzini +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Kevin Wolf +(cherry picked from commit 4f75b52a07e0a0e71c1c81d0cb0ddf9c52c8e1bc) +--- + block/vhdx-endian.c | 11 +++++-- + block/vhdx-log.c | 43 +++++++++++++++----------- + block/vhdx.c | 89 +++++++++++++++++++++++++++++++---------------------- + block/vhdx.h | 1 + + 4 files changed, 88 insertions(+), 56 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + block/vhdx-endian.c | 11 +++++-- + block/vhdx-log.c | 43 +++++++++++++++----------- + block/vhdx.c | 89 +++++++++++++++++++++++++++++++---------------------- + block/vhdx.h | 1 + + 4 files changed, 88 insertions(+), 56 deletions(-) + +diff --git a/block/vhdx-endian.c b/block/vhdx-endian.c +index fe879ed..0640d3f 100644 +--- a/block/vhdx-endian.c ++++ b/block/vhdx-endian.c +@@ -82,8 +82,6 @@ void vhdx_log_desc_le_import(VHDXLogDescriptor *d) + assert(d != NULL); + + le32_to_cpus(&d->signature); +- le32_to_cpus(&d->trailing_bytes); +- le64_to_cpus(&d->leading_bytes); + le64_to_cpus(&d->file_offset); + le64_to_cpus(&d->sequence_number); + } +@@ -99,6 +97,15 @@ void vhdx_log_desc_le_export(VHDXLogDescriptor *d) + cpu_to_le64s(&d->sequence_number); + } + ++void vhdx_log_data_le_import(VHDXLogDataSector *d) ++{ ++ assert(d != NULL); ++ ++ le32_to_cpus(&d->data_signature); ++ le32_to_cpus(&d->sequence_high); ++ le32_to_cpus(&d->sequence_low); ++} ++ + void vhdx_log_data_le_export(VHDXLogDataSector *d) + { + assert(d != NULL); +diff --git a/block/vhdx-log.c b/block/vhdx-log.c +index 7c2630d..0088be8 100644 +--- a/block/vhdx-log.c ++++ b/block/vhdx-log.c +@@ -84,6 +84,7 @@ static int vhdx_log_peek_hdr(BlockDriverState *bs, VHDXLogEntries *log, + if (ret < 0) { + goto exit; + } ++ vhdx_log_entry_hdr_le_import(hdr); + + exit: + return ret; +@@ -211,7 +212,7 @@ static bool vhdx_log_hdr_is_valid(VHDXLogEntries *log, VHDXLogEntryHeader *hdr, + { + int valid = false; + +- if (memcmp(&hdr->signature, "loge", 4)) { ++ if (hdr->signature != VHDX_LOG_SIGNATURE) { + goto exit; + } + +@@ -275,12 +276,12 @@ static bool vhdx_log_desc_is_valid(VHDXLogDescriptor *desc, + goto exit; + } + +- if (!memcmp(&desc->signature, "zero", 4)) { ++ if (desc->signature == VHDX_LOG_ZERO_SIGNATURE) { + if (desc->zero_length % VHDX_LOG_SECTOR_SIZE == 0) { + /* valid */ + ret = true; + } +- } else if (!memcmp(&desc->signature, "desc", 4)) { ++ } else if (desc->signature == VHDX_LOG_DESC_SIGNATURE) { + /* valid */ + ret = true; + } +@@ -327,13 +328,15 @@ static int vhdx_compute_desc_sectors(uint32_t desc_cnt) + * passed into this function. Each descriptor will also be validated, + * and error returned if any are invalid. */ + static int vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, +- VHDXLogEntries *log, VHDXLogDescEntries **buffer) ++ VHDXLogEntries *log, VHDXLogDescEntries **buffer, ++ bool convert_endian) + { + int ret = 0; + uint32_t desc_sectors; + uint32_t sectors_read; + VHDXLogEntryHeader hdr; + VHDXLogDescEntries *desc_entries = NULL; ++ VHDXLogDescriptor desc; + int i; + + assert(*buffer == NULL); +@@ -342,7 +345,7 @@ static int vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, + if (ret < 0) { + goto exit; + } +- vhdx_log_entry_hdr_le_import(&hdr); ++ + if (vhdx_log_hdr_is_valid(log, &hdr, s) == false) { + ret = -EINVAL; + goto exit; +@@ -363,12 +366,19 @@ static int vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, + + /* put in proper endianness, and validate each desc */ + for (i = 0; i < hdr.descriptor_count; i++) { +- vhdx_log_desc_le_import(&desc_entries->desc[i]); +- if (vhdx_log_desc_is_valid(&desc_entries->desc[i], &hdr) == false) { ++ desc = desc_entries->desc[i]; ++ vhdx_log_desc_le_import(&desc); ++ if (convert_endian) { ++ desc_entries->desc[i] = desc; ++ } ++ if (vhdx_log_desc_is_valid(&desc, &hdr) == false) { + ret = -EINVAL; + goto free_and_exit; + } + } ++ if (convert_endian) { ++ desc_entries->hdr = hdr; ++ } + + *buffer = desc_entries; + goto exit; +@@ -403,7 +413,7 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, + + buffer = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); + +- if (!memcmp(&desc->signature, "desc", 4)) { ++ if (desc->signature == VHDX_LOG_DESC_SIGNATURE) { + /* data sector */ + if (data == NULL) { + ret = -EFAULT; +@@ -431,7 +441,7 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, + + memcpy(buffer+offset, &desc->trailing_bytes, 4); + +- } else if (!memcmp(&desc->signature, "zero", 4)) { ++ } else if (desc->signature == VHDX_LOG_ZERO_SIGNATURE) { + /* write 'count' sectors of sector */ + memset(buffer, 0, VHDX_LOG_SECTOR_SIZE); + count = desc->zero_length / VHDX_LOG_SECTOR_SIZE; +@@ -498,13 +508,13 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, + goto exit; + } + +- ret = vhdx_log_read_desc(bs, s, &logs->log, &desc_entries); ++ ret = vhdx_log_read_desc(bs, s, &logs->log, &desc_entries, true); + if (ret < 0) { + goto exit; + } + + for (i = 0; i < desc_entries->hdr.descriptor_count; i++) { +- if (!memcmp(&desc_entries->desc[i].signature, "desc", 4)) { ++ if (desc_entries->desc[i].signature == VHDX_LOG_DESC_SIGNATURE) { + /* data sector, so read a sector to flush */ + ret = vhdx_log_read_sectors(bs, &logs->log, §ors_read, + data, 1, false); +@@ -515,6 +525,7 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, + ret = -EINVAL; + goto exit; + } ++ vhdx_log_data_le_import(data); + } + + ret = vhdx_log_flush_desc(bs, &desc_entries->desc[i], data); +@@ -563,9 +574,6 @@ static int vhdx_validate_log_entry(BlockDriverState *bs, BDRVVHDXState *s, + goto inc_and_exit; + } + +- vhdx_log_entry_hdr_le_import(&hdr); +- +- + if (vhdx_log_hdr_is_valid(log, &hdr, s) == false) { + goto inc_and_exit; + } +@@ -578,13 +586,13 @@ static int vhdx_validate_log_entry(BlockDriverState *bs, BDRVVHDXState *s, + + desc_sectors = vhdx_compute_desc_sectors(hdr.descriptor_count); + +- /* Read desc sectors, and calculate log checksum */ ++ /* Read all log sectors, and calculate log checksum */ + + total_sectors = hdr.entry_length / VHDX_LOG_SECTOR_SIZE; + + + /* read_desc() will increment the read idx */ +- ret = vhdx_log_read_desc(bs, s, log, &desc_buffer); ++ ret = vhdx_log_read_desc(bs, s, log, &desc_buffer, false); + if (ret < 0) { + goto free_and_exit; + } +@@ -607,7 +615,7 @@ static int vhdx_validate_log_entry(BlockDriverState *bs, BDRVVHDXState *s, + } + } + crc ^= 0xffffffff; +- if (crc != desc_buffer->hdr.checksum) { ++ if (crc != hdr.checksum) { + goto free_and_exit; + } + +@@ -967,7 +975,6 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, + * last data sector */ + vhdx_update_checksum(buffer, total_length, + offsetof(VHDXLogEntryHeader, checksum)); +- cpu_to_le32s((uint32_t *)(buffer + 4)); + + /* now write to the log */ + ret = vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer, +diff --git a/block/vhdx.c b/block/vhdx.c +index fedcf9f..febce21 100644 +--- a/block/vhdx.c ++++ b/block/vhdx.c +@@ -135,10 +135,8 @@ typedef struct VHDXSectorInfo { + * buf: buffer pointer + * size: size of buffer (must be > crc_offset+4) + * +- * Note: The resulting checksum is in the CPU endianness, not necessarily +- * in the file format endianness (LE). Any header export to disk should +- * make sure that vhdx_header_le_export() is used to convert to the +- * correct endianness ++ * Note: The buffer should have all multi-byte data in little-endian format, ++ * and the resulting checksum is in little endian format. + */ + uint32_t vhdx_update_checksum(uint8_t *buf, size_t size, int crc_offset) + { +@@ -149,6 +147,7 @@ uint32_t vhdx_update_checksum(uint8_t *buf, size_t size, int crc_offset) + + memset(buf + crc_offset, 0, sizeof(crc)); + crc = crc32c(0xffffffff, buf, size); ++ cpu_to_le32s(&crc); + memcpy(buf + crc_offset, &crc, sizeof(crc)); + + return crc; +@@ -300,7 +299,7 @@ static int vhdx_write_header(BlockDriverState *bs_file, VHDXHeader *hdr, + { + uint8_t *buffer = NULL; + int ret; +- VHDXHeader header_le; ++ VHDXHeader *header_le; + + assert(bs_file != NULL); + assert(hdr != NULL); +@@ -321,11 +320,12 @@ static int vhdx_write_header(BlockDriverState *bs_file, VHDXHeader *hdr, + } + + /* overwrite the actual VHDXHeader portion */ +- memcpy(buffer, hdr, sizeof(VHDXHeader)); +- hdr->checksum = vhdx_update_checksum(buffer, VHDX_HEADER_SIZE, +- offsetof(VHDXHeader, checksum)); +- vhdx_header_le_export(hdr, &header_le); +- ret = bdrv_pwrite_sync(bs_file, offset, &header_le, sizeof(VHDXHeader)); ++ header_le = (VHDXHeader *)buffer; ++ memcpy(header_le, hdr, sizeof(VHDXHeader)); ++ vhdx_header_le_export(hdr, header_le); ++ vhdx_update_checksum(buffer, VHDX_HEADER_SIZE, ++ offsetof(VHDXHeader, checksum)); ++ ret = bdrv_pwrite_sync(bs_file, offset, header_le, sizeof(VHDXHeader)); + + exit: + qemu_vfree(buffer); +@@ -432,13 +432,14 @@ static void vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s, + } + /* copy over just the relevant portion that we need */ + memcpy(header1, buffer, sizeof(VHDXHeader)); +- vhdx_header_le_import(header1); + +- if (vhdx_checksum_is_valid(buffer, VHDX_HEADER_SIZE, 4) && +- !memcmp(&header1->signature, "head", 4) && +- header1->version == 1) { +- h1_seq = header1->sequence_number; +- h1_valid = true; ++ if (vhdx_checksum_is_valid(buffer, VHDX_HEADER_SIZE, 4)) { ++ vhdx_header_le_import(header1); ++ if (header1->signature == VHDX_HEADER_SIGNATURE && ++ header1->version == 1) { ++ h1_seq = header1->sequence_number; ++ h1_valid = true; ++ } + } + + ret = bdrv_pread(bs->file, VHDX_HEADER2_OFFSET, buffer, VHDX_HEADER_SIZE); +@@ -447,13 +448,14 @@ static void vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s, + } + /* copy over just the relevant portion that we need */ + memcpy(header2, buffer, sizeof(VHDXHeader)); +- vhdx_header_le_import(header2); + +- if (vhdx_checksum_is_valid(buffer, VHDX_HEADER_SIZE, 4) && +- !memcmp(&header2->signature, "head", 4) && +- header2->version == 1) { +- h2_seq = header2->sequence_number; +- h2_valid = true; ++ if (vhdx_checksum_is_valid(buffer, VHDX_HEADER_SIZE, 4)) { ++ vhdx_header_le_import(header2); ++ if (header2->signature == VHDX_HEADER_SIGNATURE && ++ header2->version == 1) { ++ h2_seq = header2->sequence_number; ++ h2_valid = true; ++ } + } + + /* If there is only 1 valid header (or no valid headers), we +@@ -519,15 +521,21 @@ static int vhdx_open_region_tables(BlockDriverState *bs, BDRVVHDXState *s) + goto fail; + } + memcpy(&s->rt, buffer, sizeof(s->rt)); +- vhdx_region_header_le_import(&s->rt); + offset += sizeof(s->rt); + +- if (!vhdx_checksum_is_valid(buffer, VHDX_HEADER_BLOCK_SIZE, 4) || +- memcmp(&s->rt.signature, "regi", 4)) { ++ if (!vhdx_checksum_is_valid(buffer, VHDX_HEADER_BLOCK_SIZE, 4)) { ++ ret = -EINVAL; ++ goto fail; ++ } ++ ++ vhdx_region_header_le_import(&s->rt); ++ ++ if (s->rt.signature != VHDX_REGION_SIGNATURE) { + ret = -EINVAL; + goto fail; + } + ++ + /* Per spec, maximum region table entry count is 2047 */ + if (s->rt.entry_count > 2047) { + ret = -EINVAL; +@@ -630,7 +638,7 @@ static int vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s) + + vhdx_metadata_header_le_import(&s->metadata_hdr); + +- if (memcmp(&s->metadata_hdr.signature, "metadata", 8)) { ++ if (s->metadata_hdr.signature != VHDX_METADATA_SIGNATURE) { + ret = -EINVAL; + goto exit; + } +@@ -951,7 +959,6 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, + + /* s->bat is freed in vhdx_close() */ + s->bat = qemu_blockalign(bs, s->bat_rt.length); +- + ret = bdrv_pread(bs->file, s->bat_offset, s->bat, s->bat_rt.length); + if (ret < 0) { + goto fail; +@@ -1540,7 +1547,8 @@ exit: + */ + static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, + uint64_t image_size, VHDXImageType type, +- bool use_zero_blocks, VHDXRegionTableEntry *rt_bat) ++ bool use_zero_blocks, uint64_t file_offset, ++ uint32_t length) + { + int ret = 0; + uint64_t data_file_offset; +@@ -1555,7 +1563,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, + /* this gives a data start after BAT/bitmap entries, and well + * past any metadata entries (with a 4 MB buffer for future + * expansion */ +- data_file_offset = rt_bat->file_offset + rt_bat->length + 5 * MiB; ++ data_file_offset = file_offset + length + 5 * MiB; + total_sectors = image_size >> s->logical_sector_size_bits; + + if (type == VHDX_TYPE_DYNAMIC) { +@@ -1579,7 +1587,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, + use_zero_blocks || + bdrv_has_zero_init(bs) == 0) { + /* for a fixed file, the default BAT entry is not zero */ +- s->bat = g_malloc0(rt_bat->length); ++ s->bat = g_malloc0(length); + block_state = type == VHDX_TYPE_FIXED ? PAYLOAD_BLOCK_FULLY_PRESENT : + PAYLOAD_BLOCK_NOT_PRESENT; + block_state = use_zero_blocks ? PAYLOAD_BLOCK_ZERO : block_state; +@@ -1594,7 +1602,7 @@ static int vhdx_create_bat(BlockDriverState *bs, BDRVVHDXState *s, + cpu_to_le64s(&s->bat[sinfo.bat_idx]); + sector_num += s->sectors_per_block; + } +- ret = bdrv_pwrite(bs, rt_bat->file_offset, s->bat, rt_bat->length); ++ ret = bdrv_pwrite(bs, file_offset, s->bat, length); + if (ret < 0) { + goto exit; + } +@@ -1626,6 +1634,8 @@ static int vhdx_create_new_region_table(BlockDriverState *bs, + int ret = 0; + uint32_t offset = 0; + void *buffer = NULL; ++ uint64_t bat_file_offset; ++ uint32_t bat_length; + BDRVVHDXState *s = NULL; + VHDXRegionTableHeader *region_table; + VHDXRegionTableEntry *rt_bat; +@@ -1674,19 +1684,26 @@ static int vhdx_create_new_region_table(BlockDriverState *bs, + rt_metadata->length = 1 * MiB; /* min size, and more than enough */ + *metadata_offset = rt_metadata->file_offset; + ++ bat_file_offset = rt_bat->file_offset; ++ bat_length = rt_bat->length; ++ ++ vhdx_region_header_le_export(region_table); ++ vhdx_region_entry_le_export(rt_bat); ++ vhdx_region_entry_le_export(rt_metadata); ++ + vhdx_update_checksum(buffer, VHDX_HEADER_BLOCK_SIZE, + offsetof(VHDXRegionTableHeader, checksum)); + + + /* The region table gives us the data we need to create the BAT, + * so do that now */ +- ret = vhdx_create_bat(bs, s, image_size, type, use_zero_blocks, rt_bat); ++ ret = vhdx_create_bat(bs, s, image_size, type, use_zero_blocks, ++ bat_file_offset, bat_length); ++ if (ret < 0) { ++ goto exit; ++ } + + /* Now write out the region headers to disk */ +- vhdx_region_header_le_export(region_table); +- vhdx_region_entry_le_export(rt_bat); +- vhdx_region_entry_le_export(rt_metadata); +- + ret = bdrv_pwrite(bs, VHDX_REGION_TABLE_OFFSET, buffer, + VHDX_HEADER_BLOCK_SIZE); + if (ret < 0) { +diff --git a/block/vhdx.h b/block/vhdx.h +index 5370010..b4a12a0 100644 +--- a/block/vhdx.h ++++ b/block/vhdx.h +@@ -435,6 +435,7 @@ void vhdx_header_le_import(VHDXHeader *h); + void vhdx_header_le_export(VHDXHeader *orig_h, VHDXHeader *new_h); + void vhdx_log_desc_le_import(VHDXLogDescriptor *d); + void vhdx_log_desc_le_export(VHDXLogDescriptor *d); ++void vhdx_log_data_le_import(VHDXLogDataSector *d); + void vhdx_log_data_le_export(VHDXLogDataSector *d); + void vhdx_log_entry_hdr_le_import(VHDXLogEntryHeader *hdr); + void vhdx_log_entry_hdr_le_export(VHDXLogEntryHeader *hdr); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-acquire-AioContext-in-do_drive_del.patch b/SOURCES/kvm-block-acquire-AioContext-in-do_drive_del.patch new file mode 100644 index 0000000..a455174 --- /dev/null +++ b/SOURCES/kvm-block-acquire-AioContext-in-do_drive_del.patch @@ -0,0 +1,75 @@ +From 6e9fc1cb3586898f597e565220ef9c2e5bcf6e31 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 3 Sep 2014 09:18:00 +0200 +Subject: [PATCH 07/32] block: acquire AioContext in do_drive_del() + +Message-id: <1409735881-28863-4-git-send-email-stefanha@redhat.com> +Patchwork-id: 60824 +O-Subject: [RHEL7.1 qemu-kvm-rhev PATCH 3/4] block: acquire AioContext in do_drive_del() +Bugzilla: 1136752 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Fam Zheng + +Make drive_del safe for dataplane where another thread may be running +the BlockDriverState's AioContext. + +Note the assumption that AioContext's lifetime exceeds DriveInfo and +BlockDriverState. We release AioContext after DriveInfo and +BlockDriverState are potentially freed. + +This is clearly safe with the global AioContext but also with -object +iothread and implicit iothreads created by -device +virtio-blk-pci,x-data-plane=on (their lifetime is tied to DeviceState, +not BlockDriverState). + +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 8ad4202bf61bc1d124ff26016cfe17cb261cc392) +Signed-off-by: Stefan Hajnoczi +--- + blockdev.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/blockdev.c b/blockdev.c +index caa073d..8211e2a 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -1762,6 +1762,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) + { + const char *id = qdict_get_str(qdict, "id"); + BlockDriverState *bs; ++ AioContext *aio_context; + Error *local_err = NULL; + + bs = bdrv_find(id); +@@ -1769,9 +1770,14 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) + error_report("Device '%s' not found", id); + return -1; + } ++ ++ aio_context = bdrv_get_aio_context(bs); ++ aio_context_acquire(aio_context); ++ + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) { + error_report("%s", error_get_pretty(local_err)); + error_free(local_err); ++ aio_context_release(aio_context); + return -1; + } + +@@ -1795,6 +1801,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) + drive_del(drive_get_by_blockdev(bs)); + } + ++ aio_context_release(aio_context); + return 0; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-acquire-AioContext-in-qmp_block_resize.patch b/SOURCES/kvm-block-acquire-AioContext-in-qmp_block_resize.patch new file mode 100644 index 0000000..34c2e92 --- /dev/null +++ b/SOURCES/kvm-block-acquire-AioContext-in-qmp_block_resize.patch @@ -0,0 +1,81 @@ +From a30f77fe6e83e6dd51c67ebdbe30cf8f89db3e50 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 3 Sep 2014 09:17:58 +0200 +Subject: [PATCH 05/32] block: acquire AioContext in qmp_block_resize() + +Message-id: <1409735881-28863-2-git-send-email-stefanha@redhat.com> +Patchwork-id: 60822 +O-Subject: [RHEL7.1 qemu-kvm-rhev PATCH 1/4] block: acquire AioContext in qmp_block_resize() +Bugzilla: 1136752 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Fam Zheng + +Make block_resize safe for dataplane where another thread may be running +the BlockDriverState's AioContext. + +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Max Reitz +Signed-off-by: Kevin Wolf +(cherry picked from commit 927e0e769f4008f458de8a94a809e85c1fd016eb) +Signed-off-by: Stefan Hajnoczi +--- + blockdev.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index f9db328..caa073d 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -1804,6 +1804,7 @@ void qmp_block_resize(bool has_device, const char *device, + { + Error *local_err = NULL; + BlockDriverState *bs; ++ AioContext *aio_context; + int ret; + + bs = bdrv_lookup_bs(has_device ? device : NULL, +@@ -1814,19 +1815,22 @@ void qmp_block_resize(bool has_device, const char *device, + return; + } + ++ aio_context = bdrv_get_aio_context(bs); ++ aio_context_acquire(aio_context); ++ + if (!bdrv_is_first_non_filter(bs)) { + error_set(errp, QERR_FEATURE_DISABLED, "resize"); +- return; ++ goto out; + } + + if (size < 0) { + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "size", "a >0 size"); +- return; ++ goto out; + } + + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) { + error_set(errp, QERR_DEVICE_IN_USE, device); +- return; ++ goto out; + } + + /* complete all in-flight operations before resizing the device */ +@@ -1852,6 +1856,9 @@ void qmp_block_resize(bool has_device, const char *device, + error_setg_errno(errp, -ret, "Could not resize"); + break; + } ++ ++out: ++ aio_context_release(aio_context); + } + + #ifdef CONFIG_LIVE_BLOCK_OPS +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-vhdx-add-error-check.patch b/SOURCES/kvm-block-vhdx-add-error-check.patch new file mode 100644 index 0000000..0ae4128 --- /dev/null +++ b/SOURCES/kvm-block-vhdx-add-error-check.patch @@ -0,0 +1,48 @@ +From fe7fa3390a380edff11e85cf9a6fe979f99096b7 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Tue, 19 Aug 2014 18:16:47 +0200 +Subject: [PATCH 02/32] block: vhdx - add error check + +Message-id: <124fe1958f92a285960c59f7bcea5378eee149a5.1408471833.git.jcody@redhat.com> +Patchwork-id: 60628 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 1/2] block: vhdx - add error check +Bugzilla: 1126976 +RH-Acked-by: dgibson +RH-Acked-by: Markus Armbruster +RH-Acked-by: Stefan Hajnoczi + +This add an error check for an invalid descriptor entry signature, +when flushing the log descriptor entries. + +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Kevin Wolf +(cherry picked from commit 349592e0b9112171500e940dd921bb96cfc496d2) +--- + block/vhdx-log.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + block/vhdx-log.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/block/vhdx-log.c b/block/vhdx-log.c +index a77c040..7c2630d 100644 +--- a/block/vhdx-log.c ++++ b/block/vhdx-log.c +@@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, + /* write 'count' sectors of sector */ + memset(buffer, 0, VHDX_LOG_SECTOR_SIZE); + count = desc->zero_length / VHDX_LOG_SECTOR_SIZE; ++ } else { ++ error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32, ++ desc->signature); ++ ret = -EINVAL; ++ goto exit; + } + + file_offset = desc->file_offset; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-configure-Fix-bugs-preventing-Ceph-inclusion.patch b/SOURCES/kvm-configure-Fix-bugs-preventing-Ceph-inclusion.patch new file mode 100644 index 0000000..37d0b16 --- /dev/null +++ b/SOURCES/kvm-configure-Fix-bugs-preventing-Ceph-inclusion.patch @@ -0,0 +1,48 @@ +From 63c6c2c83eb052f5e62e6816bea6b1690b4c37ec Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 20 Mar 2014 10:59:23 +0100 +Subject: configure: Fix bugs preventing Ceph inclusion + +RH-Author: Kevin Wolf +Message-id: <1395313163-1002-1-git-send-email-kwolf@redhat.com> +Patchwork-id: 58164 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] configure: Fix bugs preventing Ceph inclusion +Bugzilla: 1078809 +RH-Acked-by: Fam Zheng +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Ademar de Souza Reis Jr. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1078809 +Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7230126 +Upstream status: Fix for downstream-only code + +CONFIG_CEPH_SUPPORT=y never really ended up being set, neither by +default nor with an explicit --enable-ceph-support. + +Signed-off-by: Kevin Wolf + +diff --git a/configure b/configure +index e43cf86..cea127c 100755 +--- a/configure ++++ b/configure +@@ -1131,9 +1131,9 @@ for opt do + ;; + --enable-live-block-migration) live_block_migration="yes" + ;; +- --disable-ceph-support) ceph_support=="no" ++ --disable-ceph-support) ceph_support="no" + ;; +- --enable-ceph-support) ceph_support=="yes" ++ --enable-ceph-support) ceph_support="yes" + ;; + *) + echo "ERROR: unknown option $opt" +@@ -4700,7 +4700,7 @@ if test "$live_block_migration" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak + fi + +-if test "ceph_support" = "yes"; then ++if test "$ceph_support" = "yes"; then + echo "CONFIG_CEPH_SUPPORT=y" >> $config_host_mak + fi + diff --git a/SOURCES/kvm-configure-add-option-to-disable-fstack-protect.patch b/SOURCES/kvm-configure-add-option-to-disable-fstack-protect.patch new file mode 100644 index 0000000..ccbf529 --- /dev/null +++ b/SOURCES/kvm-configure-add-option-to-disable-fstack-protect.patch @@ -0,0 +1,77 @@ +From 900efdc0cc7ad11ae2ab4c47bd9503bf4ddfe3f1 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 5 Feb 2014 15:02:19 +0100 +Subject: configure: add option to disable -fstack-protect + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 57118 +O-Subject: [RHEL7 qemu-kvm PATCH 1/2] configure: add option to disable -fstack-protect +Bugzilla: 1044182 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Markus Armbruster + +From: Miroslav Rezanina + +upstream: submitted +(Do not wait for apply to get to RHEL 7.0 before Snapshot 8) + +The -fstack-protector flag family is useful for ensuring safety and for +debugging, but has a performance impact. Here are some boot time comparisons +of the various versions of -fstack-protector using qemu-system-arm on an +x86_64 host: + # -fstack-protector-all + Startup finished in 1.810s (kernel) + 12.331s (initrd) + 49.016s +(userspace) = 1min 3.159s + Startup finished in 1.801s (kernel) + 12.287s (initrd) + 47.925s +(userspace) = 1min 2.013s + Startup finished in 1.812s (kernel) + 12.302s (initrd) + 47.995s +(userspace) = 1min 2.111s + + # -fstack-protector-strong + Startup finished in 1.744s (kernel) + 11.223s (initrd) + 44.688s +(userspace) = 57.657s + Startup finished in 1.721s (kernel) + 11.222s (initrd) + 44.194s +(userspace) = 57.138s + Startup finished in 1.693s (kernel) + 11.250s (initrd) + 44.426s +(userspace) = 57.370s + + # -fstack-protector + Startup finished in 1.705s (kernel) + 11.409s (initrd) + 43.563s +(userspace) = 56.677s + Startup finished in 1.877s (kernel) + 11.137s (initrd) + 43.719s +(userspace) = 56.734s + Startup finished in 1.708s (kernel) + 11.141s (initrd) + 43.628s +(userspace) = 56.478s + + # no stack protector + Startup finished in 1.743s (kernel) + 11.190s (initrd) + 43.709s +(userspace) = 56.643s + Startup finished in 1.763s (kernel) + 11.216s (initrd) + 43.767s +(userspace) = 56.747s + Startup finished in 1.711s (kernel) + 11.283s (initrd) + 43.878s +(userspace) = 56.873s + +This patch introduces a configure option to disable the stack protector +entirely, and conditional stack protector flag selection (in order, based on +availability): -fstack-protector-strong, -fstack-protector, no stack protector. + +Signed-off-by: Steven Noonan +Cc: Anthony Liguori +Reviewed-by: Stefan Weil + +Signed-off-by: Miroslav Rezanina + +diff --git a/configure b/configure +index c104d53..e43cf86 100755 +--- a/configure ++++ b/configure +@@ -1276,6 +1276,7 @@ Advanced options (experts only): + --disable-strip disable stripping binaries + --disable-werror disable compilation abort on warning + --disable-stack-protector disable compiler-provided stack protection ++ --enable-stack-protector enable compiler-provided stack protection + --disable-sdl disable SDL + --enable-sdl enable SDL + --with-sdlabi select preferred SDL ABI 1.2 or 2.0 diff --git a/SOURCES/kvm-e1000-Keep-capabilities-list-bit-on-for-older-RHEL-machine-types.patch b/SOURCES/kvm-e1000-Keep-capabilities-list-bit-on-for-older-RHEL-machine-types.patch new file mode 100644 index 0000000..0d3759d --- /dev/null +++ b/SOURCES/kvm-e1000-Keep-capabilities-list-bit-on-for-older-RHEL-machine-types.patch @@ -0,0 +1,49 @@ +From a421f19c92a08d7ec72a7532d639f5a0ded5d211 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:06:40 +0200 +Subject: e1000: Keep capabilities list bit on for older RHEL machine types + +Message-id: <1375201922-6794-16-git-send-email-armbru@redhat.com> +Patchwork-id: 52825 +O-Subject: [RHEL-7 PATCH v3 15/15] e1000: Keep capabilities list bit on for older RHEL machine types +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Upstream commit dd8e937 "e1000: Don't set the Capabilities List bit" +switched it off. The necessary compat_props to keep it on for old +machine types were forgotten. + +The RHEL-6 backport commit 2d76e3e added property +e1000.x-__com_redhat_rhel630_compat, set it for 6.3 and older via +compat_props, and made setting the capabilities list bit depend on it +being set. + +Instead of porting the RHEL-only property forward to RHEL-7, use +upstream's e1000.autonegotiation, which is on for 6.4 and newer, else +off. This is admittedly a hack. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/net/e1000.c b/hw/net/e1000.c +index 0fc29a0..6381d96 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1523,6 +1523,16 @@ static int pci_e1000_init(PCIDevice *pci_dev) + + pci_conf = pci_dev->config; + ++ if (!(d->compat_flags & E1000_FLAG_AUTONEG)) { ++ /* ++ * We have no capabilities, so capability list bit should normally be 0. ++ * Keep it on for compat machine types to avoid breaking migration. ++ * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for ++ * the machine types that need this. ++ */ ++ pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST); ++ } ++ + /* TODO: RST# value should be 0, PCI spec 6.2.4 */ + pci_conf[PCI_CACHE_LINE_SIZE] = 0x10; + diff --git a/SOURCES/kvm-exec-file_ram_alloc-print-error-when-prealloc-fails.patch b/SOURCES/kvm-exec-file_ram_alloc-print-error-when-prealloc-fails.patch new file mode 100644 index 0000000..a678d43 --- /dev/null +++ b/SOURCES/kvm-exec-file_ram_alloc-print-error-when-prealloc-fails.patch @@ -0,0 +1,63 @@ +From cfe1949d7141b2e2503097615948bdf510dd24a1 Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Tue, 16 Sep 2014 13:14:16 +0200 +Subject: [PATCH 28/32] exec: file_ram_alloc(): print error when prealloc fails + +Message-id: <20140916091416.2b77f5ce@redhat.com> +Patchwork-id: 61170 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH] exec: file_ram_alloc(): print error when prealloc fails +Bugzilla: 1135893 +RH-Acked-by: Juan Quintela +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Amit Shah + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1135893 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=7966950 +Upstream: Merged + +If memory allocation fails when using the -mem-prealloc command-line +option, QEMU exits without printing any error information to +the user: + + # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages + # echo $? + 1 + +This commit adds an error message, so that we print instead: + + # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages + qemu: unable to map backing store for hugepages: Cannot allocate memory + +Signed-off-by: Luiz Capitulino +Reviewed-by: Eric Blake +(cherry picked from commit e4d9df4fb16861f413374b69fcdb12c8c7a4a17e) +Signed-off-by: Luiz Capitulino +--- + +Question: this patch is probably going to be part of a future v2.1 + stable release. Do we apply it right now or wait for the + stable release? + + exec.c | 1 + + 1 file changed, 1 insertion(+) + +Signed-off-by: Miroslav Rezanina +--- + exec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/exec.c b/exec.c +index 765bd94..2a841eb 100644 +--- a/exec.c ++++ b/exec.c +@@ -1095,6 +1095,7 @@ static void *file_ram_alloc(RAMBlock *block, + + error: + if (mem_prealloc) { ++ error_report("%s\n", error_get_pretty(*errp)); + exit(1); + } + return NULL; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-ide-Fix-segfault-when-flushing-a-device-that-doesn-t.patch b/SOURCES/kvm-ide-Fix-segfault-when-flushing-a-device-that-doesn-t.patch new file mode 100644 index 0000000..3b57b1c --- /dev/null +++ b/SOURCES/kvm-ide-Fix-segfault-when-flushing-a-device-that-doesn-t.patch @@ -0,0 +1,82 @@ +From 389fd0b05094897e4c6553f1213182e90d5f2d29 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 10 Sep 2014 11:34:53 +0200 +Subject: [PATCH 13/32] ide: Fix segfault when flushing a device that doesn't + exist + +Message-id: <1410348893-19194-1-git-send-email-kwolf@redhat.com> +Patchwork-id: 60956 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH] ide: Fix segfault when flushing a device that doesn't exist +Bugzilla: 1140145 +RH-Acked-by: Fam Zheng +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi + +Signed-off-by: Kevin Wolf +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit f7f3ff1da0c451befc8d32f977f9c352d1303f40) + +Conflicts: + tests/ide-test.c + +Conflicts only in the context because we don't have the functions +that were introduced by commit 14a92e5f ('ide-test: add test for +werror=stop'). + +Signed-off-by: Kevin Wolf +Signed-off-by: Miroslav Rezanina +--- + hw/ide/core.c | 4 +++- + tests/ide-test.c | 14 ++++++++++++++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/hw/ide/core.c b/hw/ide/core.c +index db191a6..180ded8 100644 +--- a/hw/ide/core.c ++++ b/hw/ide/core.c +@@ -838,7 +838,9 @@ static void ide_flush_cb(void *opaque, int ret) + } + } + +- bdrv_acct_done(s->bs, &s->acct); ++ if (s->bs) { ++ bdrv_acct_done(s->bs, &s->acct); ++ } + s->status = READY_STAT | SEEK_STAT; + ide_async_cmd_done(s); + ide_set_irq(s->bus); +diff --git a/tests/ide-test.c b/tests/ide-test.c +index 4a0d97f..a6d7292 100644 +--- a/tests/ide-test.c ++++ b/tests/ide-test.c +@@ -489,6 +489,19 @@ static void test_flush(void) + ide_test_quit(); + } + ++static void test_flush_nodev(void) ++{ ++ ide_test_start(""); ++ ++ /* FLUSH CACHE command on device 0*/ ++ outb(IDE_BASE + reg_device, 0); ++ outb(IDE_BASE + reg_command, CMD_FLUSH_CACHE); ++ ++ /* Just testing that qemu doesn't crash... */ ++ ++ ide_test_quit(); ++} ++ + int main(int argc, char **argv) + { + const char *arch = qtest_get_arch(); +@@ -521,6 +534,7 @@ int main(int argc, char **argv) + qtest_add_func("/ide/bmdma/teardown", test_bmdma_teardown); + + qtest_add_func("/ide/flush", test_flush); ++ qtest_add_func("/ide/flush_nodev", test_flush_nodev); + + ret = g_test_run(); + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-disable-live-block-migration-b-i-for-rhel-and-rhev.patch b/SOURCES/kvm-migration-disable-live-block-migration-b-i-for-rhel-and-rhev.patch new file mode 100644 index 0000000..736cfff --- /dev/null +++ b/SOURCES/kvm-migration-disable-live-block-migration-b-i-for-rhel-and-rhev.patch @@ -0,0 +1,65 @@ +--- a/configure ++++ b/configure +@@ -334,6 +334,7 @@ libssh2="" + vhdx="" + quorum="" + live_block_ops="yes" ++live_block_migration="no" + numa="" + + +@@ -1126,6 +1127,10 @@ for opt do + ;; + --enable-numa) numa="yes" + ;; ++ --disable-live-block-migration) live_block_migration="no" ++ ;; ++ --enable-live-block-migration) live_block_migration="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1394,6 +1399,8 @@ Advanced options (experts only): + --enable-quorum enable quorum block filter support + --disable-live-block-ops disable live block operations support + --enable-live-block-ops enable live block operations support ++ --disable-live-block-migration disable live block migration ++ --enable-live-block-migration enable live block migration + --disable-numa disable libnuma support + --enable-numa enable libnuma support + +@@ -4237,6 +4244,7 @@ echo "Quorum $quorum" + echo "lzo support $lzo" + echo "snappy support $snappy" + echo "Live block operations $live_block_ops" ++echo "Live block migration $live_block_migration" + echo "NUMA host support $numa" + + if test "$sdl_too_old" = "yes"; then +@@ -4681,6 +4689,10 @@ if test "$live_block_ops" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak + fi + ++if test "$live_block_migration" = "yes" ; then ++ echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak ++fi ++ + # USB host support + if test "$libusb" = "yes"; then + echo "HOST_USB=libusb legacy" >> $config_host_mak +--- a/migration.c ++++ b/migration.c +@@ -416,6 +416,13 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, + params.blk = has_blk && blk; + params.shared = has_inc && inc; + ++#ifndef CONFIG_LIVE_BLOCK_MIGRATION ++ if (params.blk || params.shared) { ++ error_set(errp, QERR_UNSUPPORTED); ++ return; ++ } ++#endif ++ + if (s->state == MIG_STATE_ACTIVE || s->state == MIG_STATE_SETUP || + s->state == MIG_STATE_CANCELLING) { + error_set(errp, QERR_MIGRATION_ACTIVE); diff --git a/SOURCES/kvm-misc-Add-back-no-hpet-but-ignore-it.patch b/SOURCES/kvm-misc-Add-back-no-hpet-but-ignore-it.patch new file mode 100644 index 0000000..57bb6a9 --- /dev/null +++ b/SOURCES/kvm-misc-Add-back-no-hpet-but-ignore-it.patch @@ -0,0 +1,56 @@ +From fa96692ab98b4ce5734b8030c1b675657aa086ac Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 16 Jan 2014 16:15:05 -0500 +Subject: Add back -no-hpet but ignore it + +Message-id: <1389888905-31880-1-git-send-email-dgilbert@redhat.com> +Patchwork-id: 56754 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/1] Add back -no-hpet but ignore it +Bugzilla: 1044742 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Markus Armbruster +RH-Acked-by: Jiri Denemark + +From: "Dr. David Alan Gilbert" + +BZ: 1044742 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6886373 +Upstream-status: Red Hat only + + Undoes some of bz947441, in that we keep the -no-hpet command line +option, for compatibility with libvirt since it has no way of knowing +that it was removed. + + Since hpet is disabled anyway, keeping the option does no harm. + +diff --git a/qemu-options.hx b/qemu-options.hx +index 1286904..81545ae 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -1329,10 +1329,8 @@ it if your guest OS complains about ACPI problems (PC target machine + only). + ETEXI + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + DEF("no-hpet", 0, QEMU_OPTION_no_hpet, + "-no-hpet disable HPET\n", QEMU_ARCH_I386) +-#endif + + DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, + "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" +diff --git a/vl.c b/vl.c +index d225b8f..83e8b1a 100644 +--- a/vl.c ++++ b/vl.c +@@ -3751,11 +3751,9 @@ int main(int argc, char **argv, char **envp) + case QEMU_OPTION_no_acpi: + acpi_enabled = 0; + break; +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + case QEMU_OPTION_no_hpet: + no_hpet = 1; + break; +-#endif + case QEMU_OPTION_balloon: + if (balloon_parse(optarg) < 0) { + fprintf(stderr, "Unknown -balloon argument %s\n", optarg); diff --git a/SOURCES/kvm-misc-Add-support-statement-to-help-output.patch b/SOURCES/kvm-misc-Add-support-statement-to-help-output.patch new file mode 100644 index 0000000..b70f662 --- /dev/null +++ b/SOURCES/kvm-misc-Add-support-statement-to-help-output.patch @@ -0,0 +1,52 @@ +From 4d35b16fe25828f252d515a6842f18d8ce07c62d Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 4 Dec 2013 18:53:17 +0100 +Subject: Add support statement to -help output + +RH-Author: Eduardo Habkost +Message-id: <1386183197-27761-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 55994 +O-Subject: [qemu-kvm RHEL7 PATCH] Add support statement to -help output +Bugzilla: 972773 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: knoel@redhat.com +RH-Acked-by: Paolo Bonzini + +Bugzilla: 972773 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6676272 + +Add support statement to -help output, reporting direct qemu-kvm usage +as unsupported by Red Hat, and advising users to use libvirt instead. + +Signed-off-by: Eduardo Habkost + +diff --git a/vl.c b/vl.c +index 0142b26..ab69cdc 100644 +--- a/vl.c ++++ b/vl.c +@@ -2019,9 +2019,17 @@ static void version(void) + printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); + } + ++static void print_rh_warning(void) ++{ ++ printf("\nWARNING: Direct use of qemu-kvm from the command line is not supported by Red Hat.\n" ++ "WARNING: Use libvirt as the stable management interface.\n" ++ "WARNING: Some command line options listed here may not be available in future releases.\n\n"); ++} ++ + static void help(int exitcode) + { + version(); ++ print_rh_warning(); + printf("usage: %s [options] [disk_image]\n\n" + "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n", + error_get_progname()); +@@ -2036,6 +2044,7 @@ static void help(int exitcode) + "\n" + "When using -nographic, press 'ctrl-a h' to get some help.\n"); + ++ print_rh_warning(); + exit(exitcode); + } + diff --git a/SOURCES/kvm-misc-Build-ceph-rbd-only-for-rhev.patch b/SOURCES/kvm-misc-Build-ceph-rbd-only-for-rhev.patch new file mode 100644 index 0000000..5d1bfc3 --- /dev/null +++ b/SOURCES/kvm-misc-Build-ceph-rbd-only-for-rhev.patch @@ -0,0 +1,55 @@ +--- a/block/Makefile.objs ++++ b/block/Makefile.objs +@@ -15,7 +15,7 @@ block-obj-y += nbd.o nbd-client.o sheepdog.o + block-obj-$(CONFIG_LIBISCSI) += iscsi.o + block-obj-$(CONFIG_LIBNFS) += nfs.o + block-obj-$(CONFIG_CURL) += curl.o +-block-obj-y += rbd.o ++block-obj-$(CONFIG_CEPH_SUPPORT) += rbd.o + block-obj-$(CONFIG_GLUSTERFS) += gluster.o + block-obj-$(CONFIG_LIBSSH2) += ssh.o + endif +--- a/configure ++++ b/configure +@@ -335,9 +335,9 @@ vhdx="" + quorum="" + live_block_ops="yes" + live_block_migration="no" ++ceph_support="yes" + numa="" + +- + # parse CC options first + for opt do + optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` +@@ -1131,6 +1131,10 @@ for opt do + ;; + --enable-live-block-migration) live_block_migration="yes" + ;; ++ --disable-ceph-support) ceph_support=="no" ++ ;; ++ --enable-ceph-support) ceph_support=="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1401,6 +1405,8 @@ Advanced options (experts only): + --enable-live-block-ops enable live block operations support + --disable-live-block-migration disable live block migration + --enable-live-block-migration enable live block migration ++ --disable-ceph-support disable support for rbd block driver support ++ --enable-ceph-support enable support for rbd block driver support + --disable-numa disable libnuma support + --enable-numa enable libnuma support + +@@ -4693,6 +4699,10 @@ if test "$live_block_migration" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak + fi + ++if test "ceph_support" = "yes"; then ++ echo "CONFIG_CEPH_SUPPORT=y" >> $config_host_mak ++fi ++ + # USB host support + if test "$libusb" = "yes"; then + echo "HOST_USB=libusb legacy" >> $config_host_mak diff --git a/SOURCES/kvm-misc-Change-qemu-to-qemu-kvm.patch b/SOURCES/kvm-misc-Change-qemu-to-qemu-kvm.patch new file mode 100644 index 0000000..7d42f0f --- /dev/null +++ b/SOURCES/kvm-misc-Change-qemu-to-qemu-kvm.patch @@ -0,0 +1,22 @@ +--- a/os-posix.c ++++ b/os-posix.c +@@ -78,7 +78,7 @@ void os_setup_signal_handling(void) + /* Find a likely location for support files using the location of the binary. + For installed binaries this will be "$bindir/../share/qemu". When + running from the build tree this will be "$bindir/../pc-bios". */ +-#define SHARE_SUFFIX "/share/qemu" ++#define SHARE_SUFFIX "/share/qemu-kvm" + #define BUILD_SUFFIX "/pc-bios" + char *os_find_datadir(void) + { +--- a/ui/vnc.c ++++ b/ui/vnc.c +@@ -3273,7 +3273,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp) + } + + #ifdef CONFIG_VNC_SASL +- if ((saslErr = sasl_server_init(NULL, "qemu")) != SASL_OK) { ++ if ((saslErr = sasl_server_init(NULL, "qemu-kvm")) != SASL_OK) { + error_setg(errp, "Failed to initialize SASL auth: %s", + sasl_errstring(saslErr, NULL, NULL)); + goto fail; diff --git a/SOURCES/kvm-misc-Disable-EFI-enabled-roms.patch b/SOURCES/kvm-misc-Disable-EFI-enabled-roms.patch new file mode 100644 index 0000000..42cbc64 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-EFI-enabled-roms.patch @@ -0,0 +1,76 @@ +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -976,18 +976,6 @@ static QEMUMachine pc_machine_rhel700 = { + /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\ + .value = stringify(0xFFFFFFFF),\ + },{\ +- .driver = "e1000",\ +- .property = "romfile",\ +- .value = "pxe-e1000.rom",\ +- },{\ +- .driver = "rtl8139",\ +- .property = "romfile",\ +- .value = "pxe-rtl8139.rom",\ +- },{\ +- .driver = "virtio-net-pci",\ +- .property = "romfile",\ +- .value = "pxe-virtio.rom",\ +- },{\ + .driver = "486-" TYPE_X86_CPU,\ + .property = "model",\ + .value = stringify(0),\ +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1600,7 +1600,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) + + k->init = pci_e1000_init; + k->exit = pci_e1000_uninit; +- k->romfile = "efi-e1000.rom"; ++ k->romfile = "pxe-e1000.rom"; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = info->device_id; + k->revision = info->revision; +--- a/hw/net/ne2000.c ++++ b/hw/net/ne2000.c +@@ -765,7 +765,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) + + k->init = pci_ne2000_init; + k->exit = pci_ne2000_exit; +- k->romfile = "efi-ne2k_pci.rom", ++ k->romfile = "pxe-ne2k_pci.rom", + k->vendor_id = PCI_VENDOR_ID_REALTEK; + k->device_id = PCI_DEVICE_ID_REALTEK_8029; + k->class_id = PCI_CLASS_NETWORK_ETHERNET; +--- a/hw/net/pcnet-pci.c ++++ b/hw/net/pcnet-pci.c +@@ -358,7 +358,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) + + k->init = pci_pcnet_init; + k->exit = pci_pcnet_uninit; +- k->romfile = "efi-pcnet.rom", ++ k->romfile = "pxe-pcnet.rom", + k->vendor_id = PCI_VENDOR_ID_AMD; + k->device_id = PCI_DEVICE_ID_AMD_LANCE; + k->revision = 0x10; +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3557,7 +3557,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) + + k->init = pci_rtl8139_init; + k->exit = pci_rtl8139_uninit; +- k->romfile = "efi-rtl8139.rom"; ++ k->romfile = "pxe-rtl8139.rom"; + k->vendor_id = PCI_VENDOR_ID_REALTEK; + k->device_id = PCI_DEVICE_ID_REALTEK_8139; + k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */ +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -1444,7 +1444,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass); + +- k->romfile = "efi-virtio.rom"; ++ k->romfile = "pxe-virtio.rom"; + k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; + k->device_id = PCI_DEVICE_ID_VIRTIO_NET; + k->revision = VIRTIO_PCI_ABI_VERSION; diff --git a/SOURCES/kvm-misc-Disable-HPET-device.patch b/SOURCES/kvm-misc-Disable-HPET-device.patch new file mode 100644 index 0000000..9639333 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-HPET-device.patch @@ -0,0 +1,35 @@ +From 7768aece716d85186d7e7aa5c37b65f076dc9e49 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 22 May 2013 12:23:00 +0200 +Subject: Disable HPET device + +Bugzilla: 947441 + +We do not support HPET, disabling it. + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 77e05e5..4d5a567 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_PIIX_PCI=y +-CONFIG_HPET=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index 199bab9..f1e9f3d 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_PIIX_PCI=y +-CONFIG_HPET=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) diff --git a/SOURCES/kvm-misc-Disable-isa-parallel.patch b/SOURCES/kvm-misc-Disable-isa-parallel.patch new file mode 100644 index 0000000..5ba9afb --- /dev/null +++ b/SOURCES/kvm-misc-Disable-isa-parallel.patch @@ -0,0 +1,131 @@ +From cef98aab58acd65c3143434920b4b5000f4f63d1 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 30 Aug 2013 08:51:26 +0200 +Subject: Disable isa-parallel + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 53938 +O-Subject: [RHEL7 qemu-kvm PATCHv2 6/6] Disable isa-parallel +Bugzilla: 1002286 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny + +From: Miroslav Rezanina + +We are not going to support isa-parallel device so disabling it. + +Signed-off-by: Miroslav Rezanina + +v2: + - new patch + +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 4d5a567..cbd40ea 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak +index d0b89ab..5b4816a 100644 +--- a/default-configs/mips-softmmu.mak ++++ b/default-configs/mips-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak +index d21eebe..8b02d98 100644 +--- a/default-configs/mips64-softmmu.mak ++++ b/default-configs/mips64-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak +index df4664d..961fa04 100644 +--- a/default-configs/mips64el-softmmu.mak ++++ b/default-configs/mips64el-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak +index 2d9cece..8715e5c 100644 +--- a/default-configs/mipsel-softmmu.mak ++++ b/default-configs/mipsel-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak +index 73f46dc..50fded0 100644 +--- a/default-configs/ppc-softmmu.mak ++++ b/default-configs/ppc-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_M48T59=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCKBD=y + CONFIG_FDC=y +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index a9798a8..758e52b 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_M48T59=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCKBD=y + CONFIG_FDC=y +diff --git a/default-configs/sparc64-softmmu.mak b/default-configs/sparc64-softmmu.mak +index 299c97b..34c13a4 100644 +--- a/default-configs/sparc64-softmmu.mak ++++ b/default-configs/sparc64-softmmu.mak +@@ -8,7 +8,6 @@ CONFIG_PTIMER=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_PCKBD=y + CONFIG_FDC=y + CONFIG_IDE_ISA=y +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index f1e9f3d..ddf71dc 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y diff --git a/SOURCES/kvm-misc-Disable-new-devices-in-qemu-2-1.patch b/SOURCES/kvm-misc-Disable-new-devices-in-qemu-2-1.patch new file mode 100644 index 0000000..4f3daf4 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-new-devices-in-qemu-2-1.patch @@ -0,0 +1,13 @@ +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -16,4 +16,3 @@ CONFIG_SERIAL=y + CONFIG_SERIAL_PCI=y + CONFIG_WDT_IB6300ESB=y + CONFIG_PCI_TESTDEV=y +-CONFIG_NVME_PCI=y +--- a/default-configs/usb.mak ++++ b/default-configs/usb.mak +@@ -1,3 +1,2 @@ + CONFIG_USB_STORAGE_BOT=y +-CONFIG_USB_STORAGE_MTP=y + CONFIG_USB_SMARTCARD=y diff --git a/SOURCES/kvm-misc-Disable-unsupported-audio-devices.patch b/SOURCES/kvm-misc-Disable-unsupported-audio-devices.patch new file mode 100644 index 0000000..baf0046 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-unsupported-audio-devices.patch @@ -0,0 +1,32 @@ +From 61463fcfb65cccf1dbfe34544c871945855dce56 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 19 Mar 2013 07:37:43 -0400 +Subject: Disable unsupported audio devices + +Bugzilla: 921974 + +Only AC97 and Intel HDA are supported audio devices. Limit build only to these devices. + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 6d12a63..95c477f 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -10,7 +10,6 @@ CONFIG_PCNET_PCI=y + CONFIG_PCNET_COMMON=y + CONFIG_AC97=y + CONFIG_HDA=y +-CONFIG_ES1370=y + CONFIG_RTL8139_PCI=y + CONFIG_E1000_PCI=y + CONFIG_VMXNET3_PCI=y +diff --git a/default-configs/sound.mak b/default-configs/sound.mak +index 4f22c34..e69de29 100644 +--- a/default-configs/sound.mak ++++ b/default-configs/sound.mak +@@ -1,4 +0,0 @@ +-CONFIG_SB16=y +-CONFIG_ADLIB=y +-CONFIG_GUS=y +-CONFIG_CS4231A=y diff --git a/SOURCES/kvm-misc-Disable-unsupported-emulated-SCSI-devices.patch b/SOURCES/kvm-misc-Disable-unsupported-emulated-SCSI-devices.patch new file mode 100644 index 0000000..c189fef --- /dev/null +++ b/SOURCES/kvm-misc-Disable-unsupported-emulated-SCSI-devices.patch @@ -0,0 +1,40 @@ +From 49f41167a83fe0ba1ddc42cea245d2bd056f6ebf Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 22 May 2013 08:45:03 +0200 +Subject: Disable unsupported emulated SCSI devices + +Bugzilla: 903918 + +We do not support following device so it has to be disabled: +- lsi53c895a +- am53c974 +- dc390 +- esp +- megasas +- pvscsi + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 42934c2..5f0fcca 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -11,9 +11,6 @@ CONFIG_PCNET_COMMON=y + CONFIG_AC97=y + CONFIG_HDA=y + CONFIG_ES1370=y +-CONFIG_LSI_SCSI_PCI=y +-CONFIG_VMW_PVSCSI_SCSI_PCI=y +-CONFIG_MEGASAS_SCSI_PCI=y + CONFIG_RTL8139_PCI=y + CONFIG_E1000_PCI=y + CONFIG_VMXNET3_PCI=y +@@ -21,8 +18,6 @@ CONFIG_IDE_CORE=y + CONFIG_IDE_QDEV=y + CONFIG_IDE_PCI=y + CONFIG_AHCI=y +-CONFIG_ESP=y +-CONFIG_ESP_PCI=y + CONFIG_SERIAL=y + CONFIG_SERIAL_PCI=y + CONFIG_IPACK=y diff --git a/SOURCES/kvm-misc-Disable-unsupported-emulated-network-devices.patch b/SOURCES/kvm-misc-Disable-unsupported-emulated-network-devices.patch new file mode 100644 index 0000000..7fe5a6d --- /dev/null +++ b/SOURCES/kvm-misc-Disable-unsupported-emulated-network-devices.patch @@ -0,0 +1,187 @@ +From e2d3e5b47c9034b18edd8518acff4fa4e7dba36c Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 22 May 2013 11:59:23 +0200 +Subject: Disable unsupported emulated network devices + +Bugzilla: 921974 + +Disable following network devices as they are not supported: +- ne2k_isa +- ne2k_pci +- pcnet +- vmxnet3 + +Signed-off-by: Miroslav Rezanina + +Conflicts: + default-configs/ppcemb-softmmu.mak + +Rebase note: +- 2.0 + Added following devices: + CONFIG_MACIO=y + CONFIG_CUDA=y + CONFIG_ADB=y + CONFIG_MAC_NVRAM=y + CONFIG_MAC_DBDMA=y + CONFIG_HEATHROW_PIC=y + CONFIG_GRACKLE_PCI=y + CONFIG_UNIN_PCI=y + CONFIG_DEC_PCI=y + CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y + +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 319025b..77e05e5 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -20,7 +20,6 @@ CONFIG_APM=y + CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y + CONFIG_HPET=y + CONFIG_I8259=y +diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak +index ac798a7..d0b89ab 100644 +--- a/default-configs/mips-softmmu.mak ++++ b/default-configs/mips-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak +index 4afe6c0..d21eebe 100644 +--- a/default-configs/mips64-softmmu.mak ++++ b/default-configs/mips64-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak +index fe907e4..df4664d 100644 +--- a/default-configs/mips64el-softmmu.mak ++++ b/default-configs/mips64el-softmmu.mak +@@ -22,7 +22,6 @@ CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_IDE_VIA=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak +index f9acb4b..2d9cece 100644 +--- a/default-configs/mipsel-softmmu.mak ++++ b/default-configs/mipsel-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 95c477f..6cc2b1b 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -4,15 +4,11 @@ CONFIG_VIRTIO=y + CONFIG_USB_UHCI=y + CONFIG_USB_EHCI=y + CONFIG_USB_XHCI=y +-CONFIG_NE2000_PCI=y + CONFIG_EEPRO100_PCI=y +-CONFIG_PCNET_PCI=y +-CONFIG_PCNET_COMMON=y + CONFIG_AC97=y + CONFIG_HDA=y + CONFIG_RTL8139_PCI=y + CONFIG_E1000_PCI=y +-CONFIG_VMXNET3_PCI=y + CONFIG_IDE_CORE=y + CONFIG_IDE_QDEV=y + CONFIG_IDE_PCI=y +diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak +index 33f8d84..73f46dc 100644 +--- a/default-configs/ppc-softmmu.mak ++++ b/default-configs/ppc-softmmu.mak +@@ -33,7 +33,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index 37a15b7..a9798a8 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -33,7 +33,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak +index e032761..aa2bdb1 100644 +--- a/default-configs/ppcemb-softmmu.mak ++++ b/default-configs/ppcemb-softmmu.mak +@@ -9,6 +9,19 @@ CONFIG_VGA_PCI=y + CONFIG_SERIAL=y + CONFIG_I8257=y + CONFIG_OPENPIC=y ++CONFIG_MACIO=y ++CONFIG_CUDA=y ++CONFIG_ADB=y ++CONFIG_MAC_NVRAM=y ++CONFIG_MAC_DBDMA=y ++CONFIG_HEATHROW_PIC=y ++CONFIG_GRACKLE_PCI=y ++CONFIG_UNIN_PCI=y ++CONFIG_DEC_PCI=y ++CONFIG_PPCE500_PCI=y ++CONFIG_IDE_ISA=y ++CONFIG_IDE_CMD646=y ++CONFIG_IDE_MACIO=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/sparc-softmmu.mak b/default-configs/sparc-softmmu.mak +index ab796b3..775e16a 100644 +--- a/default-configs/sparc-softmmu.mak ++++ b/default-configs/sparc-softmmu.mak +@@ -7,7 +7,6 @@ CONFIG_M48T59=y + CONFIG_PTIMER=y + CONFIG_FDC=y + CONFIG_EMPTY_SLOT=y +-CONFIG_PCNET_COMMON=y + CONFIG_LANCE=y + CONFIG_TCX=y + CONFIG_CG3=y +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index f35a222..199bab9 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -20,7 +20,6 @@ CONFIG_APM=y + CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y + CONFIG_HPET=y + CONFIG_I8259=y diff --git a/SOURCES/kvm-misc-Disable-unsupported-usb-devices.patch b/SOURCES/kvm-misc-Disable-unsupported-usb-devices.patch new file mode 100644 index 0000000..dd9f6f6 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-unsupported-usb-devices.patch @@ -0,0 +1,40 @@ +From 2fff9011f1a2954c30389bd78aaa7fd9e7b53e1b Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Mon, 22 Apr 2013 14:38:38 +0200 +Subject: Disable unsupported usb devices + +Bugzilla: 903914 + +Patch deactivates device we do not support in RHEL7: +- usb-audio +- usb-braille +- usb-bt-dongle +- usb-net +- usb-serial +- usb-wacom-tablet +- pci-ohci + +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 91b1e92..42934c2 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -2,7 +2,6 @@ CONFIG_PCI=y + CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO=y + CONFIG_USB_UHCI=y +-CONFIG_USB_OHCI=y + CONFIG_USB_EHCI=y + CONFIG_USB_XHCI=y + CONFIG_NE2000_PCI=y +diff --git a/default-configs/usb.mak b/default-configs/usb.mak +index 73d8489..91304cd 100644 +--- a/default-configs/usb.mak ++++ b/default-configs/usb.mak +@@ -3,7 +3,3 @@ CONFIG_USB_STORAGE_BOT=y + CONFIG_USB_STORAGE_UAS=y + CONFIG_USB_STORAGE_MTP=y + CONFIG_USB_SMARTCARD=y +-CONFIG_USB_AUDIO=y +-CONFIG_USB_SERIAL=y +-CONFIG_USB_NETWORK=y +-CONFIG_USB_BLUETOOTH=y diff --git a/SOURCES/kvm-misc-Disable-usb-uas.patch b/SOURCES/kvm-misc-Disable-usb-uas.patch new file mode 100644 index 0000000..c38f243 --- /dev/null +++ b/SOURCES/kvm-misc-Disable-usb-uas.patch @@ -0,0 +1,34 @@ +From db561c3173adc664c7ea83c8ad9ce61002776cfe Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 30 Aug 2013 08:51:23 +0200 +Subject: Disable usb-uas + +RH-Author: Miroslav Rezanina +Message-id: <95623a002492b1f8117e0f99e2b1163f2a2a4071.1377851454.git.mrezanin@redhat.com> +Patchwork-id: 53934 +O-Subject: [RHEL7 qemu-kvm PATCHv2 3/6] Disable usb-uas +Bugzilla: 903914 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny + +From: Miroslav Rezanina + +BZ: 903914 + +As usb3 streams are still broken, we do not need usb-uas device. + +v2: + - new patch +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/usb.mak b/default-configs/usb.mak +index 45568c9..4ed8ff0 100644 +--- a/default-configs/usb.mak ++++ b/default-configs/usb.mak +@@ -1,4 +1,3 @@ + CONFIG_USB_STORAGE_BOT=y +-CONFIG_USB_STORAGE_UAS=y + CONFIG_USB_STORAGE_MTP=y + CONFIG_USB_SMARTCARD=y diff --git a/SOURCES/kvm-misc-Disable-various-unsupported-devices.patch b/SOURCES/kvm-misc-Disable-various-unsupported-devices.patch new file mode 100644 index 0000000..288113e --- /dev/null +++ b/SOURCES/kvm-misc-Disable-various-unsupported-devices.patch @@ -0,0 +1,128 @@ +From 1bc9ed7fda2e77b6e6d7c4da9ca7ba8499185e64 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 19 Mar 2013 09:03:29 -0400 +Subject: Disable various unsupported devices + +Bugzilla: 921971 + +Disable following emulated devices we do not support: +- isa-applesmc +- vmware-svga +- ipoctal232 +- tpci200 +- ipack + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak +index bc07600..05c2f6e 100644 +--- a/default-configs/alpha-softmmu.mak ++++ b/default-configs/alpha-softmmu.mak +@@ -10,7 +10,6 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_CIRRUS=y + CONFIG_IDE_CORE=y + CONFIG_IDE_QDEV=y +-CONFIG_VMWARE_VGA=y + CONFIG_IDE_CMD646=y + CONFIG_I8259=y + CONFIG_MC146818RTC=y +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 8e08841..319025b 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -8,7 +8,6 @@ CONFIG_QXL=$(CONFIG_SPICE) + CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y +@@ -24,7 +23,6 @@ CONFIG_IDE_PIIX=y + CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y + CONFIG_HPET=y +-CONFIG_APPLESMC=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) +diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak +index 71177ef..ac798a7 100644 +--- a/default-configs/mips-softmmu.mak ++++ b/default-configs/mips-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y + CONFIG_I8254=y +diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak +index 617301b..4afe6c0 100644 +--- a/default-configs/mips64-softmmu.mak ++++ b/default-configs/mips64-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y + CONFIG_I8254=y +diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak +index 317b151..fe907e4 100644 +--- a/default-configs/mips64el-softmmu.mak ++++ b/default-configs/mips64el-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y + CONFIG_I8254=y +diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak +index 532a9ae..f9acb4b 100644 +--- a/default-configs/mipsel-softmmu.mak ++++ b/default-configs/mipsel-softmmu.mak +@@ -9,7 +9,6 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y + CONFIG_I8254=y +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 5f0fcca..6d12a63 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -20,7 +20,6 @@ CONFIG_IDE_PCI=y + CONFIG_AHCI=y + CONFIG_SERIAL=y + CONFIG_SERIAL_PCI=y +-CONFIG_IPACK=y + CONFIG_WDT_IB6300ESB=y + CONFIG_PCI_TESTDEV=y + CONFIG_NVME_PCI=y +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index 66557ac..f35a222 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -8,7 +8,6 @@ CONFIG_QXL=$(CONFIG_SPICE) + CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y + CONFIG_PARALLEL=y +@@ -24,7 +23,6 @@ CONFIG_IDE_PIIX=y + CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y + CONFIG_HPET=y +-CONFIG_APPLESMC=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) diff --git a/SOURCES/kvm-misc-Fix-migration-from-rhel6-5-to-rhel7-with-ipxe.patch b/SOURCES/kvm-misc-Fix-migration-from-rhel6-5-to-rhel7-with-ipxe.patch new file mode 100644 index 0000000..eebaf98 --- /dev/null +++ b/SOURCES/kvm-misc-Fix-migration-from-rhel6-5-to-rhel7-with-ipxe.patch @@ -0,0 +1,47 @@ +From 4538680de36c523e8e8e82569f7f8ee5836be54a Mon Sep 17 00:00:00 2001 +From: Orit Wasserman +Date: Tue, 5 Nov 2013 13:13:44 +0100 +Subject: Fix migration from rhel6.5 to rhel7 with ipxe + +RH-Author: Orit Wasserman +Message-id: <1383657224-18599-4-git-send-email-owasserm@redhat.com> +Patchwork-id: 55377 +O-Subject: [RHEL-7.0 qemu-kvm 3/3] Fix migration from rhel6.5 to rhel7 with ipxe +Bugzilla: 997702 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Alex Williamson +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Juan Quintela + +Use rhel6 ipxe roms for rhel6 machine types (to have compatible roms sizes +when migrating) + +Signed-off-by: Orit Wasserman + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 05a60a1..1b21f93 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1027,6 +1027,22 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "usb-ccid",\ + .property = "serial",\ + .value = "1",\ ++ },{\ ++ .driver = "ne2k_pci",\ ++ .property = "romfile",\ ++ .value = "rhel6-ne2k_pci.rom",\ ++ },{\ ++ .driver = "pcnet",\ ++ .property = "romfile",\ ++ .value = "rhel6-pcnet.rom",\ ++ },{\ ++ .driver = "rtl8139",\ ++ .property = "romfile",\ ++ .value = "rhel6-rtl8139.rom",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "romfile",\ ++ .value = "rhel6-virtio.rom",\ + } + + static void pc_init_rhel650(MachineState *machine) diff --git a/SOURCES/kvm-misc-Include-OHCI-device-for-ppc64.patch b/SOURCES/kvm-misc-Include-OHCI-device-for-ppc64.patch new file mode 100644 index 0000000..797ccab --- /dev/null +++ b/SOURCES/kvm-misc-Include-OHCI-device-for-ppc64.patch @@ -0,0 +1,31 @@ +From f2b283f4536b5a4b9c0aae23cd97d65af9273389 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Mon, 21 Jul 2014 04:45:17 +0200 +Subject: Include OHCI device for ppc64 + +Message-id: <1405917919-7547-2-git-send-email-dgibson@redhat.com> +Patchwork-id: 59980 +O-Subject: [PATCH 1/3] Include OHCI device for ppc64 +Bugzilla: +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Miroslav Rezanina + +With the current RHEL7 qemu configuration, UHCI, EHCI and XHCI devices are +included on all platforms, but not OHCI. But on real hardware pp64 +machines (and in fact most non-x86 platforms), OHCI is the standard USB1 +controller, and UHCI is almost unheard of. + +Arguably we should replace UHCI with OHCI on all non-x86 platforms. But +for now just enable OHCI for ppc64, where we definitely need it. + +Signed-off-by: David Gibson + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index a9798a8..c122b25 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -58,3 +58,4 @@ CONFIG_I8257=y + CONFIG_MC146818RTC=y + CONFIG_ISA_TESTDEV=y + CONFIG_LIBDECNUMBER=y ++CONFIG_USB_OHCI=y diff --git a/SOURCES/kvm-misc-Partial-commit-of-87123eabfa1ee7cef51066fd7fd8e7d5ecd0419f-block.patch b/SOURCES/kvm-misc-Partial-commit-of-87123eabfa1ee7cef51066fd7fd8e7d5ecd0419f-block.patch new file mode 100644 index 0000000..9ec52fa --- /dev/null +++ b/SOURCES/kvm-misc-Partial-commit-of-87123eabfa1ee7cef51066fd7fd8e7d5ecd0419f-block.patch @@ -0,0 +1,158 @@ +From ac8be144a43d647546bacafbf0ae52b0e3ca587a Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Mon, 7 Jul 2014 09:24:19 +0200 +Subject: Partial commit of 87123eabfa1ee7cef51066fd7fd8e7d5ecd0419f block: + +Due to changes in qapi files rebase is not trivial and need to be checked by Jeff + +Adding this partial commit to allow easier rebase of following patches + +Mirek + +diff --git a/Makefile b/Makefile +index 5c3878b..8ace246 100644 +--- a/Makefile ++++ b/Makefile +@@ -2,6 +2,11 @@ + + # Always point to the root of the build tree (needs GNU make). + BUILD_DIR=$(CURDIR) ++# useful for passing ' ' and ',' into Makefile functional calls, ++# as these characters cannot be passed otherwise ++_empty := ++_space := $(_empty) $(_empty) ++_comma := , + + # All following code might depend on configuration variables + ifneq ($(wildcard config-host.mak),) +@@ -291,6 +296,7 @@ clean: + rm -f trace/generated-tracers-dtrace.h* + rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) + rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp) ++ rm -f $(foreach f,$(GENERATED_JSON_FILES),$(f) $(f)-timestamp) + rm -rf qapi-generated + rm -rf qga/qapi-generated + for d in $(ALL_SUBDIRS); do \ +diff --git a/block/Makefile.objs b/block/Makefile.objs +index 908c966..e078f17 100644 +--- a/block/Makefile.objs ++++ b/block/Makefile.objs +@@ -20,9 +20,11 @@ block-obj-$(CONFIG_GLUSTERFS) += gluster.o + block-obj-$(CONFIG_LIBSSH2) += ssh.o + endif + ++ifeq ($(CONFIG_LIVE_BLOCK_OPS),y) + common-obj-y += stream.o + common-obj-y += commit.o + common-obj-y += mirror.o ++endif + common-obj-y += backup.o + + iscsi.o-cflags := $(LIBISCSI_CFLAGS) +diff --git a/blockdev.c b/blockdev.c +index 48bd9a3..eeecdf8 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -231,6 +231,8 @@ typedef struct { + BlockDriverState *bs; + } BDRVPutRefBH; + ++/* right now, this is only used from block_job_cb() */ ++#ifdef CONFIG_LIVE_BLOCK_OPS + static void bdrv_put_ref_bh(void *opaque) + { + BDRVPutRefBH *s = opaque; +@@ -256,6 +258,7 @@ static void bdrv_put_ref_bh_schedule(BlockDriverState *bs) + s->bs = bs; + qemu_bh_schedule(s->bh); + } ++#endif + + static int parse_block_error_action(const char *buf, bool is_read, Error **errp) + { +@@ -994,6 +997,7 @@ void do_commit(Monitor *mon, const QDict *qdict) + } + } + ++#ifdef CONFIG_LIVE_BLOCK_OPS + static void blockdev_do_action(int kind, void *data, Error **errp) + { + TransactionAction action; +@@ -1545,6 +1549,7 @@ exit: + g_free(state); + } + } ++#endif + + + static void eject_device(BlockDriverState *bs, int force, Error **errp) +@@ -1849,6 +1854,7 @@ void qmp_block_resize(bool has_device, const char *device, + } + } + ++#ifdef CONFIG_LIVE_BLOCK_OPS + static void block_job_cb(void *opaque, int ret) + { + BlockDriverState *bs = opaque; +@@ -2302,6 +2308,7 @@ void qmp_drive_mirror(const char *device, const char *target, + return; + } + } ++#endif + + static BlockJob *find_block_job(const char *device) + { +diff --git a/configure b/configure +index f552374..c9118b1 100755 +--- a/configure ++++ b/configure +@@ -333,8 +333,10 @@ tpm="yes" + libssh2="" + vhdx="" + quorum="" ++live_block_ops="yes" + numa="" + ++ + # parse CC options first + for opt do + optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` +@@ -1116,6 +1118,10 @@ for opt do + ;; + --enable-quorum) quorum="yes" + ;; ++ --disable-live-block-ops) live_block_ops="no" ++ ;; ++ --enable-live-block-ops) live_block_ops="yes" ++ ;; + --disable-numa) numa="no" + ;; + --enable-numa) numa="yes" +@@ -1386,6 +1392,8 @@ Advanced options (experts only): + --enable-vhdx enable support for the Microsoft VHDX image format + --disable-quorum disable quorum block filter support + --enable-quorum enable quorum block filter support ++ --disable-live-block-ops disable live block operations support ++ --enable-live-block-ops enable live block operations support + --disable-numa disable libnuma support + --enable-numa enable libnuma support + +@@ -4228,6 +4236,7 @@ echo "vhdx $vhdx" + echo "Quorum $quorum" + echo "lzo support $lzo" + echo "snappy support $snappy" ++echo "Live block operations $live_block_ops" + echo "NUMA host support $numa" + + if test "$sdl_too_old" = "yes"; then +@@ -4668,6 +4677,10 @@ if test "$vhdx" = "yes" ; then + echo "CONFIG_VHDX=y" >> $config_host_mak + fi + ++if test "$live_block_ops" = "yes" ; then ++ echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak ++fi ++ + # USB host support + if test "$libusb" = "yes"; then + echo "HOST_USB=libusb legacy" >> $config_host_mak diff --git a/SOURCES/kvm-misc-Partially-revert-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch b/SOURCES/kvm-misc-Partially-revert-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch new file mode 100644 index 0000000..2a2aa32 --- /dev/null +++ b/SOURCES/kvm-misc-Partially-revert-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch @@ -0,0 +1,32 @@ +From 6e22b744f546706d8429a6d4714a865e9270f63c Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Sat, 11 Jan 2014 17:59:51 +0100 +Subject: Partially revert "rhel: Drop "cfi.pflash01" and "isa-ide" device" + +RH-Author: Laszlo Ersek +Message-id: <1389463208-6278-2-git-send-email-lersek@redhat.com> +Patchwork-id: 56615 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 01/18] Partially revert "rhel: Drop "cfi.pflash01" and "isa-ide" device" +Bugzilla: 1032346 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Amos Kong +RH-Acked-by: Andrew Jones +RH-Acked-by: Kevin Wolf + +This reverts the cfi.pflash01 elimination in +commit f6852e27575e095269a47f434d318b5fc8822e0a. + +Signed-off-by: Laszlo Ersek + +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index 288ef72..9cc8b5f 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -19,6 +19,7 @@ CONFIG_I8257=y + CONFIG_IDE_PIIX=y + CONFIG_PIIX_PCI=y + CONFIG_I8259=y ++CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) + CONFIG_PCI_HOTPLUG_OLD=y + CONFIG_MC146818RTC=y diff --git a/SOURCES/kvm-misc-RHEL7-RHEV7-1-2-0-migration-compatibility.patch b/SOURCES/kvm-misc-RHEL7-RHEV7-1-2-0-migration-compatibility.patch new file mode 100644 index 0000000..ad42fd2 --- /dev/null +++ b/SOURCES/kvm-misc-RHEL7-RHEV7-1-2-0-migration-compatibility.patch @@ -0,0 +1,92 @@ +From 72bb13d14941dacbdeecd7ee214224c03b6e45bf Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 3 Jul 2014 14:15:55 +0200 +Subject: RHEL7-> RHEV7.1/2.0 migration compatibility + +RH-Author: Dr. David Alan Gilbert (git) +Message-id: <1404396958-13568-2-git-send-email-dgilbert@redhat.com> +Patchwork-id: 59469 +O-Subject: [RHEL-7.1 qemu-kvm-rhev PATCH v5 1/4] RHEL7-> RHEV7.1/2.0 migration compatibility +Bugzilla: 1085950 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +From: "Dr. David Alan Gilbert" + +Import compatibility settings from rhel7 world and the +compat_1_7/6/5 definitions. + +With this set a simple machine migrates from rhel7 to 2.0 +with the rhel6.5.0 and pc-i440fx-rhel7.0.0 machine types +(and surprisingly it also seems to migrate back in the opposite +direction!) + +Signed-off-by: Dr. David Alan Gilbert + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 67573fe..6ce7716 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -953,6 +953,23 @@ static void pc_compat_rhel700(MachineState *machine) + CPUID_EXT2_RDTSCP); + } + ++/* ++ * RHE[LV] This set of items are from include/hw/i386/pc.h where they ++ * are part of the PC_COMPAT_* defs. RHEL7 was QEMU 1.5.3 derived so pick up ++ * the diffs from 1.5 onwards MINUS the things that were already in RHEL7 ++ * e.g. msos-desc ++ */ ++#define PC_RHEL7_0_COMPAT \ ++ {\ ++ .driver = "PIIX4_PM",\ ++ .property = "acpi-pci-hotplug-with-bridge-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "mitigation",\ ++ .value = "off",\ ++ } ++ + static void pc_init_rhel700(MachineState *machine) + { + pc_compat_rhel700(machine); +@@ -970,9 +987,14 @@ static QEMUMachine pc_machine_rhel700 = { + .max_cpus = 255, + .is_default = 1, + .default_machine_opts = "firmware=bios-256k.bin", ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL7_0_COMPAT, ++ { /* end of list */ } ++ }, + }; + + #define PC_RHEL6_5_COMPAT \ ++ PC_RHEL7_0_COMPAT,\ + {\ + .driver = "scsi-hd",\ + .property = "discard_granularity",\ +@@ -1082,6 +1104,10 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = TYPE_USB_DEVICE,\ + .property = "msos-desc",\ + .value = "no",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ + } + + static void pc_compat_rhel650(MachineState *machine) +@@ -1120,6 +1146,10 @@ static void pc_compat_rhel650(MachineState *machine) + CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT); + + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_UNHALT); ++ ++ rom_file_has_mr = false; ++ has_acpi_build = false; ++ gigabyte_align = false; + } + + static void pc_init_rhel650(MachineState *machine) diff --git a/SOURCES/kvm-misc-Remove-CONFIG_NE2000_ISA-from-all-config-files.patch b/SOURCES/kvm-misc-Remove-CONFIG_NE2000_ISA-from-all-config-files.patch new file mode 100644 index 0000000..656140d --- /dev/null +++ b/SOURCES/kvm-misc-Remove-CONFIG_NE2000_ISA-from-all-config-files.patch @@ -0,0 +1,116 @@ +From baa77102d6f89cafc9bec9e853494db581adabac Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 24 Jun 2014 07:23:07 +0200 +Subject: Remove CONFIG_NE2000_ISA from all config files + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 59349 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 1/3] Remove CONFIG_NE2000_ISA from all config files +Bugzilla: + +From: Miroslav Rezanina + +In commit 66d63420a139baf507b4dc95ecd2a84a2ecfa1db, NE2000 support was +removed from the qemu package. However, the NE2000_ISA config option +was forgotten, which breaks the build for some targets. + +Signed-off-by: David Gibson +Signed-off-by: Miroslav + +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 8e08841..f878880 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -21,7 +21,6 @@ CONFIG_APM=y + CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y + CONFIG_HPET=y + CONFIG_APPLESMC=y +diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak +index 71177ef..7e7aa67 100644 +--- a/default-configs/mips-softmmu.mak ++++ b/default-configs/mips-softmmu.mak +@@ -22,7 +22,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak +index 617301b..d1c21a5 100644 +--- a/default-configs/mips64-softmmu.mak ++++ b/default-configs/mips64-softmmu.mak +@@ -22,7 +22,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak +index 317b151..1845655 100644 +--- a/default-configs/mips64el-softmmu.mak ++++ b/default-configs/mips64el-softmmu.mak +@@ -23,7 +23,6 @@ CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_IDE_VIA=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak +index 532a9ae..8daf14f 100644 +--- a/default-configs/mipsel-softmmu.mak ++++ b/default-configs/mipsel-softmmu.mak +@@ -22,7 +22,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak +index 33f8d84..73f46dc 100644 +--- a/default-configs/ppc-softmmu.mak ++++ b/default-configs/ppc-softmmu.mak +@@ -33,7 +33,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index 37a15b7..a9798a8 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -33,7 +33,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak +index fb482d2..aa2bdb1 100644 +--- a/default-configs/ppcemb-softmmu.mak ++++ b/default-configs/ppcemb-softmmu.mak +@@ -22,7 +22,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y diff --git a/SOURCES/kvm-misc-Remove-i82550-network-card-emulation.patch b/SOURCES/kvm-misc-Remove-i82550-network-card-emulation.patch new file mode 100644 index 0000000..2934a8e --- /dev/null +++ b/SOURCES/kvm-misc-Remove-i82550-network-card-emulation.patch @@ -0,0 +1,36 @@ +From eef5be278df906ab9d596626e08ea970a379fa47 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 30 Aug 2013 08:51:21 +0200 +Subject: Remove i82550 network card emulation + +RH-Author: Miroslav Rezanina +Message-id: <8a443ebad7bda82e3a609db476db3f77b97dab53.1377851454.git.mrezanin@redhat.com> +Patchwork-id: 53933 +O-Subject: [RHEL7 qemu-kvm PATCHv2 1/6] Remove i82550 network card emulation +Bugzilla: 921983 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny + +From: Miroslav Rezanina + +Bugzilla: 921983 +Upstream: n/a, RHEL only + +We do not support i82550 card and it's variants. Removing the card +from configuration. + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 6cc2b1b..5a6cc74 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -4,7 +4,6 @@ CONFIG_VIRTIO=y + CONFIG_USB_UHCI=y + CONFIG_USB_EHCI=y + CONFIG_USB_XHCI=y +-CONFIG_EEPRO100_PCI=y + CONFIG_AC97=y + CONFIG_HDA=y + CONFIG_RTL8139_PCI=y diff --git a/SOURCES/kvm-misc-Remove-no-hpet-option.patch b/SOURCES/kvm-misc-Remove-no-hpet-option.patch new file mode 100644 index 0000000..9eaf0c6 --- /dev/null +++ b/SOURCES/kvm-misc-Remove-no-hpet-option.patch @@ -0,0 +1,76 @@ +From 945b5f8093aa28267c53d106becab28fc42a9911 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 30 Aug 2013 08:51:25 +0200 +Subject: Remove no-hpet option + +RH-Author: Miroslav Rezanina +Message-id: <9d2bbee5227f35ee23da66a8689a9cd0faf545f1.1377851454.git.mrezanin@redhat.com> +Patchwork-id: 53936 +O-Subject: [RHEL7 qemu-kvm PATCHv2 5/6] Remove no-hpet option +Bugzilla: 947441 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny + +From: Miroslav Rezanina + +Bugzilla: 947441 +Upstream: n/a, RHEL only + +We disable HPET for RHEL, this patch removes option no-hpet that is +not usable. + +Patch is forwardport of RHEL6 patch 1c07ac51 with small difference in +qemu-options.hx STEXI part of no-hpet is removed to keep man page +updated. + +Signed-off-by: Miroslav Rezanina + +v2: + - Remove only STEXI part + +diff --git a/qemu-options.hx b/qemu-options.hx +index 1549625..1286904 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -1329,13 +1329,10 @@ it if your guest OS complains about ACPI problems (PC target machine + only). + ETEXI + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + DEF("no-hpet", 0, QEMU_OPTION_no_hpet, + "-no-hpet disable HPET\n", QEMU_ARCH_I386) +-STEXI +-@item -no-hpet +-@findex -no-hpet +-Disable HPET support. +-ETEXI ++#endif + + DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, + "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" +diff --git a/vl.c b/vl.c +index a0a8630..4c1c3d4 100644 +--- a/vl.c ++++ b/vl.c +@@ -161,7 +161,7 @@ int smp_threads = 1; + const char *vnc_display; + #endif + int acpi_enabled = 1; +-int no_hpet = 0; ++int no_hpet = 1; /* Always disabled for Red Hat Enterprise Linux */ + int fd_bootchk = 1; + static int no_reboot; + int no_shutdown = 0; +@@ -3740,9 +3740,11 @@ int main(int argc, char **argv, char **envp) + case QEMU_OPTION_no_acpi: + acpi_enabled = 0; + break; ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + case QEMU_OPTION_no_hpet: + no_hpet = 1; + break; ++#endif + case QEMU_OPTION_balloon: + if (balloon_parse(optarg) < 0) { + fprintf(stderr, "Unknown -balloon argument %s\n", optarg); diff --git a/SOURCES/kvm-misc-Remove-usb-wacom-tablet.patch b/SOURCES/kvm-misc-Remove-usb-wacom-tablet.patch new file mode 100644 index 0000000..0617bb0 --- /dev/null +++ b/SOURCES/kvm-misc-Remove-usb-wacom-tablet.patch @@ -0,0 +1,33 @@ +From abd612abb890b1188bbd330798e596a45814fbcb Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 30 Aug 2013 08:51:22 +0200 +Subject: Remove usb wacom tablet + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 53935 +O-Subject: [RHEL7 qemu-kvm PATCHv2 2/6] Remove usb wacom tablet +Bugzilla: 903914 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny + +From: Miroslav Rezanina + +BZ: 903914 +Upstream: n/a, RHEL only + +We do not support wacom tablet, disabling it. + +Signed-off-by: Miroslav Rezanina + +diff --git a/default-configs/usb.mak b/default-configs/usb.mak +index 91304cd..45568c9 100644 +--- a/default-configs/usb.mak ++++ b/default-configs/usb.mak +@@ -1,4 +1,3 @@ +-CONFIG_USB_TABLET_WACOM=y + CONFIG_USB_STORAGE_BOT=y + CONFIG_USB_STORAGE_UAS=y + CONFIG_USB_STORAGE_MTP=y diff --git a/SOURCES/kvm-misc-Rename-man-page-qemu-1-to-qemu-kvm-1.patch b/SOURCES/kvm-misc-Rename-man-page-qemu-1-to-qemu-kvm-1.patch new file mode 100644 index 0000000..4fca4ea --- /dev/null +++ b/SOURCES/kvm-misc-Rename-man-page-qemu-1-to-qemu-kvm-1.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -356,7 +356,7 @@ install-doc: $(DOCS) + $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" + ifdef CONFIG_POSIX + $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" +- $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" ++ $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1/qemu-kvm.1" + ifneq ($(TOOLS),) + $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" + $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" diff --git a/SOURCES/kvm-misc-Undo-Enable-x2apic-by-default-for-compatibility.patch b/SOURCES/kvm-misc-Undo-Enable-x2apic-by-default-for-compatibility.patch new file mode 100644 index 0000000..de6b1ed --- /dev/null +++ b/SOURCES/kvm-misc-Undo-Enable-x2apic-by-default-for-compatibility.patch @@ -0,0 +1,36 @@ +From 6db0e725503caac1c10902e692fbb697626fb3f2 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 3 Jul 2014 14:15:58 +0200 +Subject: Undo 'Enable x2apic by default' for compatibility + +RH-Author: Dr. David Alan Gilbert (git) +Message-id: <1404396958-13568-5-git-send-email-dgilbert@redhat.com> +Patchwork-id: 59472 +O-Subject: [RHEL-7.1 qemu-kvm-rhev PATCH v5 4/4] Undo 'Enable x2apic by default' for compatibility +Bugzilla: 1085950 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +From: "Dr. David Alan Gilbert" + +This is forced on upstream by ef02ef5f4 but disabled for older +machine types. + +Signed-off-by: Dr. David Alan Gilbert + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e35a6d3..c4e1af4 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -927,6 +927,9 @@ machine_init(pc_machine_init); + + static void pc_compat_rhel700(MachineState *machine) + { ++ /* Upstream enables it for everyone, we're a little more selective */ ++ x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC); ++ + x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); diff --git a/SOURCES/kvm-misc-Use-kvm-by-default.patch b/SOURCES/kvm-misc-Use-kvm-by-default.patch new file mode 100644 index 0000000..a02f8c9 --- /dev/null +++ b/SOURCES/kvm-misc-Use-kvm-by-default.patch @@ -0,0 +1,24 @@ +From ede7be4e6e63746274207439a531a22e30aca96a Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 4 Apr 2013 11:00:41 +0200 +Subject: Use kvm by default + +Bugzilla: 906185 + +RHEL uses kvm accelerator by default, if available. + +Signed-off-by: Miroslav Rezanina + +diff --git a/vl.c b/vl.c +index fe451aa..a0a8630 100644 +--- a/vl.c ++++ b/vl.c +@@ -2685,7 +2685,7 @@ static int configure_accelerator(MachineClass *mc) + p = qemu_opt_get(qemu_get_machine_opts(), "accel"); + if (p == NULL) { + /* Use the default "accelerator", tcg */ +- p = "tcg"; ++ p = "kvm:tcg"; + } + + while (!accel_initialised && *p != '\0') { diff --git a/SOURCES/kvm-misc-Use-legacy-SMBIOS-for-rhel-machine-types.patch b/SOURCES/kvm-misc-Use-legacy-SMBIOS-for-rhel-machine-types.patch new file mode 100644 index 0000000..5c1e33d --- /dev/null +++ b/SOURCES/kvm-misc-Use-legacy-SMBIOS-for-rhel-machine-types.patch @@ -0,0 +1,22 @@ +From 6871e380d83d42541b89790129ae957c653e463c Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 10 Jul 2014 08:21:50 +0200 +Subject: Use legacy SMBIOS for rhel machine types. + +To prevent changes during migration we need to use legacy SMBIOS handling. + +Signed-off-by: Miroslav Rezanina + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3d0e764..021cf22 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1120,6 +1120,8 @@ static void pc_compat_rhel650(MachineState *machine) + if (!machine->cpu_model) { + machine->cpu_model = "cpu64-rhel6"; + } ++ smbios_legacy_mode = true; ++ + x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC); diff --git a/SOURCES/kvm-misc-add-qxl_screendump-monitor-command.patch b/SOURCES/kvm-misc-add-qxl_screendump-monitor-command.patch new file mode 100644 index 0000000..db92c31 --- /dev/null +++ b/SOURCES/kvm-misc-add-qxl_screendump-monitor-command.patch @@ -0,0 +1,160 @@ +From a2cf04f5572bccdb4dba10540ef93860bbd690de Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 4 Jul 2014 11:55:46 +0200 +Subject: add qxl_screendump monitor command + +RH-Author: Gerd Hoffmann +Message-id: <1375866764-17766-2-git-send-email-kraxel@redhat.com> +Patchwork-id: 53033 +O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] add qxl_screendump monitor command +Bugzilla: 903910 +RH-Acked-by: Hans de Goede +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Michal Novotny + +This patch ports the rhel-6 specific qxl_screendump command to rhel-7. +qxl_screendump takes the device id as additional argument and thus can +be used to take screenshots from non-primary displays. + +The plan to get that functionality upstream in time failed, so we go for +plan b and carry forward the rhel-6 specific qxl_screendump command. +Thanks to the major console subsystem cleanups which made it upstream +the implementation is (a) alot less hackier than the rhel-6 one and (b) +not qxl-specific any more. Given that qxl is the only graphic device +which can work as secondary vga card the later is only a theoretical +benefit though ;) + +RHEL-6 commit: 1c6074d107dff93c7c7b0edfb5da871504802946 + +bugzilla: #903910 - RHEL7 does not have equivalent functionality for +__com.redhat_qxl_screendump + +Signed-off-by: Gerd Hoffmann + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index d0943b1..f24a72a 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -247,6 +247,13 @@ ETEXI + .help = "save screen into PPM image 'filename'", + .mhandler.cmd = hmp_screen_dump, + }, ++ { ++ .name = "__com.redhat_qxl_screendump", ++ .args_type = "id:s,filename:F", ++ .params = "id filename", ++ .help = "save screen from qxl device 'id' into PPM image 'filename'", ++ .mhandler.cmd = hmp___com_redhat_qxl_screen_dump, ++ }, + + STEXI + @item screendump @var{filename} +diff --git a/hmp.c b/hmp.c +index 4d1838e..ad8f52d 100644 +--- a/hmp.c ++++ b/hmp.c +@@ -1547,6 +1547,16 @@ void hmp_screen_dump(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &err); + } + ++void hmp___com_redhat_qxl_screen_dump(Monitor *mon, const QDict *qdict) ++{ ++ const char *id = qdict_get_str(qdict, "id"); ++ const char *filename = qdict_get_str(qdict, "filename"); ++ Error *err = NULL; ++ ++ qmp___com_redhat_qxl_screendump(id, filename, &err); ++ hmp_handle_error(mon, &err); ++} ++ + void hmp_nbd_server_start(Monitor *mon, const QDict *qdict) + { + const char *uri = qdict_get_str(qdict, "uri"); +diff --git a/hmp.h b/hmp.h +index 4fd3c4a..856e026 100644 +--- a/hmp.h ++++ b/hmp.h +@@ -84,6 +84,7 @@ void hmp_getfd(Monitor *mon, const QDict *qdict); + void hmp_closefd(Monitor *mon, const QDict *qdict); + void hmp_send_key(Monitor *mon, const QDict *qdict); + void hmp_screen_dump(Monitor *mon, const QDict *qdict); ++void hmp___com_redhat_qxl_screen_dump(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_start(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_add(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict); +diff --git a/qapi-schema.json b/qapi-schema.json +index b11aad2..8cd7d19 100644 +--- a/qapi-schema.json ++++ b/qapi-schema.json +@@ -2610,6 +2610,21 @@ + { 'command': 'screendump', 'data': {'filename': 'str'} } + + ## ++# @__com.redhat_qxl_screendump: ++# ++# Write a PPM of secondary qxl devices to a file. ++# ++# @id: qxl device id ++# @filename: the path of a new PPM file to store the image ++# ++# Returns: Nothing on success ++# ++# Since: never (rhel-only, not upstream) ++## ++{ 'command': '__com.redhat_qxl_screendump', 'data': { 'id' : 'str', ++ 'filename': 'str' } } ++ ++## + # @ChardevFile: + # + # Configuration info for file chardevs. +diff --git a/qmp-commands.hx b/qmp-commands.hx +index 4be4765..4a02a51 100644 +--- a/qmp-commands.hx ++++ b/qmp-commands.hx +@@ -148,6 +148,11 @@ EQMP + .args_type = "filename:F", + .mhandler.cmd_new = qmp_marshal_input_screendump, + }, ++ { ++ .name = "__com.redhat_qxl_screendump", ++ .args_type = "id:s,filename:F", ++ .mhandler.cmd_new = qmp_marshal_input___com_redhat_qxl_screendump, ++ }, + + SQMP + screendump +diff --git a/ui/console.c b/ui/console.c +index ab84549..776b3d8 100644 +--- a/ui/console.c ++++ b/ui/console.c +@@ -331,6 +331,29 @@ void qmp_screendump(const char *filename, Error **errp) + ppm_save(filename, surface, errp); + } + ++void qmp___com_redhat_qxl_screendump(const char *id, const char *filename, Error **errp) ++{ ++ DeviceState *dev; ++ QemuConsole *con; ++ DisplaySurface *surface; ++ ++ dev = qdev_find_recursive(sysbus_get_default(), id); ++ if (NULL == dev) { ++ error_set(errp, QERR_DEVICE_NOT_FOUND, id); ++ return; ++ } ++ ++ con = qemu_console_lookup_by_device(dev, 0); ++ if (con == NULL) { ++ error_setg(errp, "Device %s has no QemuConsole attached to it.", id); ++ return; ++ } ++ ++ graphic_hw_update(con); ++ surface = qemu_console_surface(con); ++ ppm_save(filename, surface, errp); ++} ++ + void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata) + { + if (!con) { diff --git a/SOURCES/kvm-misc-disable-s3-s4-by-default.patch b/SOURCES/kvm-misc-disable-s3-s4-by-default.patch new file mode 100644 index 0000000..f64d388 --- /dev/null +++ b/SOURCES/kvm-misc-disable-s3-s4-by-default.patch @@ -0,0 +1,50 @@ +From b0afa7712a01145dd03e286e43b8b3aeeb414b2e Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:06:56 +0200 +Subject: disable s3/s4 by default + +Message-id: <1374235471-27096-2-git-send-email-armbru@redhat.com> +Patchwork-id: 52604 +O-Subject: [RHEL-7 PATCH qemu-kvm 1/2] disable s3/s4 by default +Bugzilla: 980840 +RH-Acked-by: Amit Shah +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Bandan Das +RH-Acked-by: Gleb Natapov + +From: Gleb Natapov + +After the changes proposed in Bug 827503, S3/S4 will be enabled by +default on qemu/seabios, but we want it disabled by default in RHEL6.4 +to avoid problems on problematic OSes (it'll be enabled on a +case-by-case basis in the management layer). + +Since we want to have it fully supported when enabled, QE should perform +the expected tests (which AFAIK have been run in rhel6.3 already, so +enabling it manually should not be a problem). + +Signed-off-by: Gleb Natapov +Signed-off-by: Eduardo Habkost +(cherry picked from commit 625992f4673989108819db751aa9066b65fc6020) + +Picked from qemu-kvm-rhel6. + +Conflicts: + hw/acpi.c +Signed-off-by: Markus Armbruster + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index b72b34e..913b2b0 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -582,8 +582,8 @@ static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list) + + static Property piix4_pm_properties[] = { + DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0), +- DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0), +- DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0), ++ DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1), ++ DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1), + DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2), + DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState, + use_acpi_pci_hotplug, true), diff --git a/SOURCES/kvm-misc-don-t-disable-ctrl_mac_addr-feature-for-6-5-machine-RHEL-only.patch b/SOURCES/kvm-misc-don-t-disable-ctrl_mac_addr-feature-for-6-5-machine-RHEL-only.patch new file mode 100644 index 0000000..0759d46 --- /dev/null +++ b/SOURCES/kvm-misc-don-t-disable-ctrl_mac_addr-feature-for-6-5-machine-RHEL-only.patch @@ -0,0 +1,49 @@ +From aab4187704935affc5f653d3bf673b608807b457 Mon Sep 17 00:00:00 2001 +From: Amos Kong +Date: Thu, 7 Nov 2013 08:38:28 +0100 +Subject: don't disable ctrl_mac_addr feature for 6.5 machine (RHEL only) + +RH-Author: Amos Kong +Message-id: <1383813508-6353-1-git-send-email-akong@redhat.com> +Patchwork-id: 55592 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] don't disable ctrl_mac_addr feature for 6.5 machine (RHEL only) +Bugzilla: 1005039 +RH-Acked-by: Orit Wasserman +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 1005039 +Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6540840 +Test: tested by myself + +ctrl_mac_addr is already supported in qemu-kvm 6.5, +we should not disable this feature for 6.5 machine type. + +Signed-off-by: Amos Kong + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 1b21f93..30a87d4 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -985,10 +985,6 @@ static QEMUMachine pc_machine_rhel700 = { + .value = stringify(1),\ + },{\ + .driver = "virtio-net-pci",\ +- .property = "ctrl_mac_addr",\ +- .value = "off",\ +- },{\ +- .driver = "virtio-net-pci",\ + .property = "mq",\ + .value = "off",\ + },{\ +@@ -1113,6 +1109,10 @@ static QEMUMachine pc_machine_rhel650 = { + .driver = "hda-output",\ + .property = "mixer",\ + .value = "off",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "ctrl_mac_addr",\ ++ .value = "off",\ + } + + static void pc_init_rhel640(MachineState *machine) diff --git a/SOURCES/kvm-misc-enable-pvticketlocks-by-default.patch b/SOURCES/kvm-misc-enable-pvticketlocks-by-default.patch new file mode 100644 index 0000000..9231f5f --- /dev/null +++ b/SOURCES/kvm-misc-enable-pvticketlocks-by-default.patch @@ -0,0 +1,56 @@ +From 71fdfccd8ed01846c2e89d522dad3143b31b4b88 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 14 Jan 2014 09:26:23 +0100 +Subject: enable pvticketlocks by default + +RH-Author: Andrew Jones +Message-id: <1389691583-3060-1-git-send-email-drjones@redhat.com> +Patchwork-id: 56650 +O-Subject: [RHEL7.0 qemu-kvm PATCH] enable pvticketlocks by default +Bugzilla: 1052340 +RH-Acked-by: Rik van Riel +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Laszlo Ersek + +RHEL-only +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1052340 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6860390 + +Let's turn pvticketlocks on by default. We need to get them more exposed +if we're ever going to make a final decision about them being on/off. +So we turn them on now, and if we'll have any issues during our +pre-release testing, then we'll just revert this patch. Since this is +something of a test patch, we leave it as RHEL only for now. We can post +an upstream patch later when we're sure it's the right way to go. + +We only enable by default on rhel7 for now, not rhel6 and earlier, +although rhel6 kernels wouldn't enable it anyway, as they don't have +pvticketlocks. Tested by me. + +Signed-off-by: Andrew Jones + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 189d2fa..3b28360 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1080,6 +1080,8 @@ static void pc_init_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, + 0, CPUID_EXT2_RDTSCP); + ++ x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_UNHALT); ++ + pc_init_rhel700(machine); + } + +diff --git a/target-i386/cpu.c b/target-i386/cpu.c +index cc3ca85..ad01183 100644 +--- a/target-i386/cpu.c ++++ b/target-i386/cpu.c +@@ -454,6 +454,7 @@ static uint32_t kvm_default_features[FEATURE_WORDS] = { + (1 << KVM_FEATURE_ASYNC_PF) | + (1 << KVM_FEATURE_STEAL_TIME) | + (1 << KVM_FEATURE_PV_EOI) | ++ (1 << KVM_FEATURE_PV_UNHALT) | + (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT), + [FEAT_1_ECX] = CPUID_EXT_X2APIC, + }; diff --git a/SOURCES/kvm-misc-fix-guest-physical-bits-to-match-host-to-go-beyond-1TB-guests.patch b/SOURCES/kvm-misc-fix-guest-physical-bits-to-match-host-to-go-beyond-1TB-guests.patch new file mode 100644 index 0000000..9097873 --- /dev/null +++ b/SOURCES/kvm-misc-fix-guest-physical-bits-to-match-host-to-go-beyond-1TB-guests.patch @@ -0,0 +1,51 @@ +From d3f90742bc47fbf2480683d0b8db3711816be88c Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Wed, 12 Feb 2014 13:30:18 +0100 +Subject: fix guest physical bits to match host, to go beyond 1TB guests + +RH-Author: Andrea Arcangeli +Message-id: <1392211818-14964-2-git-send-email-aarcange@redhat.com> +Patchwork-id: 57245 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] fix guest physical bits to match host, to go beyond 1TB guests +Bugzilla: 989677 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Andrew Jones +RH-Acked-by: Marcelo Tosatti + +Without this patch the guest physical bits are advertised as 40, not +44 or more depending on the hardware capability of the host. + +That leads to guest kernel crashes with injection of page faults 9 +(see oops: 0009) as bits above 40 in the guest pagetables are +considered reserved. + +exregion-0206 [324572448] [17] ex_system_memory_space: System-Memory (width 32) R/W 0 Address=00000000FED00000 +BUG: unable to handle kernel paging request at ffffc9006030e000 +IP: [] acpi_ex_system_memory_space_handler+0x23e/0x2cb +PGD e01f875067 PUD 1001f075067 PMD e0178d8067 PTE 80000000fed00173 +Oops: 0009 [#1] SMP + +(see PUD with bit >=40 set) + +Signed-off-by: Andrea Arcangeli +Reported-by: Chegu Vinod + +diff --git a/target-i386/cpu.c b/target-i386/cpu.c +index ad01183..65ebbaf 100644 +--- a/target-i386/cpu.c ++++ b/target-i386/cpu.c +@@ -2473,8 +2473,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, + /* XXX: This value must match the one used in the MMU code. */ + if (env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) { + /* 64 bit processor */ +-/* XXX: The physical address space is limited to 42 bits in exec.c. */ + *eax = 0x00003028; /* 48 bits virtual, 40 bits physical */ ++ if (kvm_enabled()) { ++ uint32_t _eax; ++ host_cpuid(0x80000000, 0, &_eax, NULL, NULL, NULL); ++ if (_eax >= 0x80000008) ++ host_cpuid(0x80000008, 0, eax, NULL, NULL, NULL); ++ } + } else { + if (env->features[FEAT_1_EDX] & CPUID_PSE36) { + *eax = 0x00000024; /* 36 bits physical */ diff --git a/SOURCES/kvm-misc-fix-intel-hda-live-migration.patch b/SOURCES/kvm-misc-fix-intel-hda-live-migration.patch new file mode 100644 index 0000000..0524c30 --- /dev/null +++ b/SOURCES/kvm-misc-fix-intel-hda-live-migration.patch @@ -0,0 +1,34 @@ +From 6e783b40766fb6664d3c49332da7a1cadfebfbc5 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 9 Dec 2013 13:57:35 +0100 +Subject: fix intel-hda live migration + +RH-Author: Gerd Hoffmann +Message-id: <1386597455-25593-2-git-send-email-kraxel@redhat.com> +Patchwork-id: 56035 +O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] fix intel-hda live migration +Bugzilla: 1036537 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Amos Kong +RH-Acked-by: Orit Wasserman + +RHEL-6 intel-hda emulation doesn't support MSI, so we have +to turn it off for thel RHEL-6 machine types in RHEL-7. + +Signed-off-by: Gerd Hoffmann + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3704933..189d2fa 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1012,6 +1012,10 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "use_broken_id",\ + .value = stringify(1),\ + },{\ ++ .driver = "intel-hda",\ ++ .property = "msi",\ ++ .value = stringify(0),\ ++ },{\ + .driver = "qemu32-" TYPE_X86_CPU,\ + .property = "xlevel",\ + .value = stringify(0),\ diff --git a/SOURCES/kvm-misc-introduce-RFQDN_REDHAT-RHEL-6-7-fwd.patch b/SOURCES/kvm-misc-introduce-RFQDN_REDHAT-RHEL-6-7-fwd.patch new file mode 100644 index 0000000..a46b44f --- /dev/null +++ b/SOURCES/kvm-misc-introduce-RFQDN_REDHAT-RHEL-6-7-fwd.patch @@ -0,0 +1,40 @@ +From 26cddb9446176f289b8448b61f5039b67ed88758 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 21 Nov 2013 16:27:17 +0100 +Subject: introduce RFQDN_REDHAT (RHEL 6->7 fwd) + +RH-Author: Laszlo Ersek +Message-id: <1385051239-3677-2-git-send-email-lersek@redhat.com> +Patchwork-id: 55836 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/3] introduce RFQDN_REDHAT (RHEL 6->7 fwd) +Bugzilla: 971933 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Jiri Denemark +RH-Acked-by: Luiz Capitulino + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=971933 + +This forward ports the final effect of RHEL-6 commit + + commit 8d99c4ad4d9fa53768bfbca8606457f8179f4404 + Author: Luiz Capitulino + Date: Fri May 14 22:49:19 2010 -0300 + + Monitor: Make RFQDN_REDHAT public + +Signed-off-by: Laszlo Ersek + +diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h +index 3d6929d..c1522c0 100644 +--- a/include/monitor/monitor.h ++++ b/include/monitor/monitor.h +@@ -19,6 +19,9 @@ extern Monitor *default_mon; + /* flags for monitor commands */ + #define MONITOR_CMD_ASYNC 0x0001 + ++/* Red Hat Monitor's prefix (reversed fully qualified domain) */ ++#define RFQDN_REDHAT "__com.redhat_" ++ + int monitor_cur_is_qmp(void); + + void monitor_init(CharDriverState *chr, int flags); diff --git a/SOURCES/kvm-misc-qga-fsfreeze-main-hook-adapt-to-RHEL-7-RH-only.patch b/SOURCES/kvm-misc-qga-fsfreeze-main-hook-adapt-to-RHEL-7-RH-only.patch new file mode 100644 index 0000000..fd7337b --- /dev/null +++ b/SOURCES/kvm-misc-qga-fsfreeze-main-hook-adapt-to-RHEL-7-RH-only.patch @@ -0,0 +1,78 @@ +From fa16ed971d23dd6c62ab9696dca6315fd1b63813 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Wed, 31 Jul 2013 22:15:05 +0200 +Subject: qga fsfreeze main hook: adapt to RHEL-7 (RH only) + +RH-Author: Laszlo Ersek +Message-id: <1375308906-23405-3-git-send-email-lersek@redhat.com> +Patchwork-id: 52885 +O-Subject: [RHEL-7 qemu-kvm PATCH v3 2/3] qga fsfreeze main hook: adapt to RHEL-7 (RH only) +Bugzilla: 969942 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michal Novotny +RH-Acked-by: Miroslav Rezanina + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=969942 + +LOGFILE should look like it does on RHEL-6. + +The main fsfreeze script should process hook files like systemd does +[Paolo]. + +Signed-off-by: Laszlo Ersek + +diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook +index c27b29f..45514fa 100755 +--- a/scripts/qemu-guest-agent/fsfreeze-hook ++++ b/scripts/qemu-guest-agent/fsfreeze-hook +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # This script is executed when a guest agent receives fsfreeze-freeze and + # fsfreeze-thaw command, if it is specified in --fsfreeze-hook (-F) +@@ -7,8 +7,7 @@ + # "freeze" argument before the filesystem is frozen. And for fsfreeze-thaw + # request, it is issued with "thaw" argument after filesystem is thawed. + +-LOGFILE=/var/log/qga-fsfreeze-hook.log +-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d ++LOGFILE=/var/log/qemu-ga.fsfreeze-hook.log + + # Check whether file $1 is a backup or rpm-generated file and should be ignored + is_ignored_file() { +@@ -19,15 +18,26 @@ is_ignored_file() { + return 1 + } + +-# Iterate executables in directory "fsfreeze-hook.d" with the specified args +-[ ! -d "$FSFREEZE_D" ] && exit 0 +-for file in "$FSFREEZE_D"/* ; do +- is_ignored_file "$file" && continue +- [ -x "$file" ] || continue +- printf "$(date): execute $file $@\n" >>$LOGFILE +- "$file" "$@" >>$LOGFILE 2>&1 ++shopt -s nullglob ++RELPATH=qemu-ga/fsfreeze-hook.d ++ ++for DIR in lib etc run; do ++ for FILE in /"$DIR/$RELPATH"/*; do ++ if is_ignored_file "$FILE" || ! [ -x "$FILE" ]; then ++ continue ++ fi ++ BNAME=$(basename -- "$FILE") ++ if ( [ lib = "$DIR" ] && ( [ -e /etc/"$RELPATH/$BNAME" ] || ++ [ -e /run/"$RELPATH/$BNAME" ] ) ) || ++ ( [ etc = "$DIR" ] && ( [ -e /run/"$RELPATH/$BNAME" ] ) ); then ++ continue ++ fi ++ ++ printf "$(date): execute $FILE $@\n" >>$LOGFILE ++ "$FILE" "$@" >>$LOGFILE 2>&1 + STATUS=$? +- printf "$(date): $file finished with status=$STATUS\n" >>$LOGFILE ++ printf "$(date): $FILE finished with status=$STATUS\n" >>$LOGFILE ++ done + done + + exit 0 diff --git a/SOURCES/kvm-misc-remove-superfluous-hot_add_cpu-and-max_cpus-initializers-RHEV-7-1.patch b/SOURCES/kvm-misc-remove-superfluous-hot_add_cpu-and-max_cpus-initializers-RHEV-7-1.patch new file mode 100644 index 0000000..fe11fe5 --- /dev/null +++ b/SOURCES/kvm-misc-remove-superfluous-hot_add_cpu-and-max_cpus-initializers-RHEV-7-1.patch @@ -0,0 +1,116 @@ +From afb57d2751616803f7d900bb9150c30546ab6de8 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 3 Jul 2014 14:15:56 +0200 +Subject: remove superfluous .hot_add_cpu and .max_cpus initializers (RHEV-7.1 + +RH-Author: Dr. David Alan Gilbert (git) +Message-id: <1404396958-13568-3-git-send-email-dgilbert@redhat.com> +Patchwork-id: 59470 +O-Subject: [RHEL-7.1 qemu-kvm-rhev PATCH v5 2/4] remove superfluous .hot_add_cpu and .max_cpus initializers (RHEV-7.1 only) +Bugzilla: 1085950 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +From: "Dr. David Alan Gilbert" + +The RHEL machine type structures all include PC_DEFAULT_MACHINE_OPTIONS. +The macro is defined as: + + #define PC_DEFAULT_MACHINE_OPTIONS \ + PC_COMMON_MACHINE_OPTIONS, \ + .hot_add_cpu = pc_hot_add_cpu, \ + .max_cpus = 255 + +Hence there's no need (and it is actually confusing) to re-initialize +those same two members with open-coded designated initializers. Remove +the +latter. + +This is a qemu-kvm-rhev-only patch (RHEL-7.1+), but it can be considered +the continuation of upstream qemu commit a0dba644 ("pc: reduce +duplication, fix PIIX descriptions"), originally released in v1.7.0. + +Signed-off-by: Laszlo Ersek + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 6ce7716..5caf5de 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -983,8 +983,6 @@ static QEMUMachine pc_machine_rhel700 = { + .alias = "pc", + .desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)", + .init = pc_init_rhel700, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .is_default = 1, + .default_machine_opts = "firmware=bios-256k.bin", + .compat_props = (GlobalProperty[]) { +@@ -1163,8 +1161,6 @@ static QEMUMachine pc_machine_rhel650 = { + .name = "rhel6.5.0", + .desc = "RHEL 6.5.0 PC", + .init = pc_init_rhel650, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_5_COMPAT, + { /* end of list */ } +@@ -1212,8 +1208,6 @@ static QEMUMachine pc_machine_rhel640 = { + .name = "rhel6.4.0", + .desc = "RHEL 6.4.0 PC", + .init = pc_init_rhel640, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_4_COMPAT, + { /* end of list */ } +@@ -1288,8 +1282,6 @@ static QEMUMachine pc_machine_rhel630 = { + .name = "rhel6.3.0", + .desc = "RHEL 6.3.0 PC", + .init = pc_init_rhel630, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_3_COMPAT, + { /* end of list */ } +@@ -1320,8 +1312,6 @@ static QEMUMachine pc_machine_rhel620 = { + .name = "rhel6.2.0", + .desc = "RHEL 6.2.0 PC", + .init = pc_init_rhel620, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_2_COMPAT, + { /* end of list */ } +@@ -1393,8 +1383,6 @@ static QEMUMachine pc_machine_rhel610 = { + .name = "rhel6.1.0", + .desc = "RHEL 6.1.0 PC", + .init = pc_init_rhel610, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_1_COMPAT, + { /* end of list */ } +@@ -1433,8 +1421,6 @@ static QEMUMachine pc_machine_rhel600 = { + .name = "rhel6.0.0", + .desc = "RHEL 6.0.0 PC", + .init = pc_init_rhel600, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_0_COMPAT, + { /* end of list */ } +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index df60f2e..dbf9983 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -476,8 +476,6 @@ static QEMUMachine pc_q35_machine_rhel700 = { + .alias = "q35", + .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)", + .init = pc_q35_init_rhel700, +- .hot_add_cpu = pc_hot_add_cpu, +- .max_cpus = 255, + .default_machine_opts = "firmware=bios-256k.bin", + }; + diff --git a/SOURCES/kvm-misc-rhel6-compat-usb-serial-numbers.patch b/SOURCES/kvm-misc-rhel6-compat-usb-serial-numbers.patch new file mode 100644 index 0000000..77b4467 --- /dev/null +++ b/SOURCES/kvm-misc-rhel6-compat-usb-serial-numbers.patch @@ -0,0 +1,84 @@ +From 60e13b489f488968301e739d6172d8eea0d77ed2 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 2 Sep 2013 13:26:16 +0200 +Subject: rhel6 compat: usb serial numbers + +RH-Author: Gerd Hoffmann +Message-id: <1378128376-25930-3-git-send-email-kraxel@redhat.com> +Patchwork-id: 53987 +O-Subject: [RHEL-7 qemu-kvm PATCH 2/2] rhel6 compat: usb serial numbers +Bugzilla: 953304 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Hans de Goede +RH-Acked-by: Paolo Bonzini + +Add serial number compat properties to the rhel6 machine types, +to match rhel6 behavior. Two things we have to watch out here: + +First the HID devices flipped serial from "1" to "42" to indicate +remote wakeup capability, in RHEL-6.2. + +rhel6 commit 85ae0a096fdbc4a6f5a660bf60a74c092f9c0f7a + +Second devices get unique serial numbers, by appending host adapter +pci address and port path, in RHEL-6.4, for usb-hub and usb-storage. +Also usb-net + usb-serial + usb-wacom, but those are disabled in RHEL. + +rhel6 commit e91156bc452250291f72b82b43654540be7101be + +usb-ccid has a unique serial in RHEL-7 but not in RHEL-6, so we need +a compat property for all RHEL-6.x machine types. + +bugzilla: 953304 + +Signed-off-by: Gerd Hoffmann + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 1d06c76..950cfc2 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1023,6 +1023,10 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "486-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(0),\ ++ },{\ ++ .driver = "usb-ccid",\ ++ .property = "serial",\ ++ .value = "1",\ + } + + static void pc_init_rhel650(MachineState *machine) +@@ -1121,6 +1125,14 @@ static QEMUMachine pc_machine_rhel640 = { + .driver = TYPE_X86_CPU,\ + .property = "pmu",\ + .value = "on",\ ++ },{\ ++ .driver = "usb-hub",\ ++ .property = "serial",\ ++ .value = "314159",\ ++ },{\ ++ .driver = "usb-storage",\ ++ .property = "serial",\ ++ .value = "1",\ + } + + static void pc_init_rhel630(MachineState *machine) +@@ -1203,6 +1215,18 @@ static QEMUMachine pc_machine_rhel620 = { + .driver = "virtio-balloon-pci",\ + .property = "event_idx",\ + .value = "off",\ ++ },{\ ++ .driver = "usb-kbd",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },{\ ++ .driver = "usb-mouse",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },{\ ++ .driver = "usb-tablet",\ ++ .property = "serial",\ ++ .value = "1",\ + } + + static void pc_init_rhel610(MachineState *machine) diff --git a/SOURCES/kvm-misc-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch b/SOURCES/kvm-misc-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch new file mode 100644 index 0000000..55a5545 --- /dev/null +++ b/SOURCES/kvm-misc-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch @@ -0,0 +1,32 @@ +From 4b782fcf97f81b2d503a60636769f89c400e17c6 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Tue, 8 Oct 2013 17:05:45 +0200 +Subject: seabios paravirt: allow more than 1TB in x86 guest + +RH-Author: Andrea Arcangeli +Message-id: <1381251945-13402-2-git-send-email-aarcange@redhat.com> +Patchwork-id: 54784 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] seabios paravirt: allow more than 1TB in x86 guest +Bugzilla: 989677 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Gleb Natapov +RH-Acked-by: Laszlo Ersek + +This patch should be applied to the qemu-kvm rpm package at the same +time of the other one for seabios, so qemu will forward the ram_size +bits over 40 to seabios without losing them. + +Signed-off-by: Andrea Arcangeli + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 2cf22b1..3cfe0ef 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -407,6 +407,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, + rtc_set_memory(s, 0x5b, val); + rtc_set_memory(s, 0x5c, val >> 8); + rtc_set_memory(s, 0x5d, val >> 16); ++ rtc_set_memory(s, 0x5e, val >> 24); + + /* set the number of CPU */ + rtc_set_memory(s, 0x5f, smp_cpus - 1); diff --git a/SOURCES/kvm-misc-set-model-in-PC_RHEL6_5_COMPAT-for-qemu32-VCPU-RHEV-7-1-only.patch b/SOURCES/kvm-misc-set-model-in-PC_RHEL6_5_COMPAT-for-qemu32-VCPU-RHEV-7-1-only.patch new file mode 100644 index 0000000..a5487df --- /dev/null +++ b/SOURCES/kvm-misc-set-model-in-PC_RHEL6_5_COMPAT-for-qemu32-VCPU-RHEV-7-1-only.patch @@ -0,0 +1,38 @@ +From 04a7c6ada3e0936093816ad72bd1dcd2c2426329 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 3 Jul 2014 14:15:57 +0200 +Subject: set model in PC_RHEL6_5_COMPAT for qemu32 VCPU (RHEV-7.1 only) + +RH-Author: Dr. David Alan Gilbert (git) +Message-id: <1404396958-13568-4-git-send-email-dgilbert@redhat.com> +Patchwork-id: 59471 +O-Subject: [RHEL-7.1 qemu-kvm-rhev PATCH v5 3/4] set model in PC_RHEL6_5_COMPAT for qemu32 VCPU (RHEV-7.1 only) +Bugzilla: 1085950 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +From: "Dr. David Alan Gilbert" + +This patch forward ports a missing hunk from RHEL-7.0 commit 9baf8db +("target-i386: Set model=6 on qemu64 & qemu32 CPU models"). It should +have no effect in practice (we don't care about qemu32* VCPUs). + +Signed-off-by: Laszlo Ersek + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 5caf5de..e35a6d3 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1075,6 +1075,10 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "level",\ + .value = stringify(0),\ + },{\ ++ .driver = "qemu32-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(3),\ ++ },{\ + .driver = "usb-ccid",\ + .property = "serial",\ + .value = "1",\ diff --git a/SOURCES/kvm-misc-switch-rhel7-machine-types-to-big-bios.patch b/SOURCES/kvm-misc-switch-rhel7-machine-types-to-big-bios.patch new file mode 100644 index 0000000..018c7c9 --- /dev/null +++ b/SOURCES/kvm-misc-switch-rhel7-machine-types-to-big-bios.patch @@ -0,0 +1,20 @@ +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -939,6 +939,7 @@ static QEMUMachine pc_machine_rhel700 = { + .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .is_default = 1, ++ .default_machine_opts = "firmware=bios-256k.bin", + }; + + #define PC_RHEL6_5_COMPAT \ +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -449,6 +449,7 @@ static QEMUMachine pc_q35_machine_rhel700 = { + .init = pc_q35_init_rhel700, + .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, ++ .default_machine_opts = "firmware=bios-256k.bin", + }; + + static void rhel_pc_q35_machine_init(void) diff --git a/SOURCES/kvm-misc-use-recommended-max-vcpu-count.patch b/SOURCES/kvm-misc-use-recommended-max-vcpu-count.patch new file mode 100644 index 0000000..0a51441 --- /dev/null +++ b/SOURCES/kvm-misc-use-recommended-max-vcpu-count.patch @@ -0,0 +1,39 @@ +From 73389ba0d6eabc68d6c6ac57a8ed55d7d0f855d9 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 21 Jan 2014 10:46:52 +0100 +Subject: use recommended max vcpu count + +RH-Author: Andrew Jones +Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com> +Patchwork-id: 56862 +O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count +Bugzilla: 998708 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Marcelo Tosatti + +RHEL-only +Bugzilla: 998708 +Brew: 6905708 + +The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead +of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error. + +This matches the limit tested by QE on RHEL6: 160. + +Signed-off-by: Andrew Jones + +diff --git a/kvm-all.c b/kvm-all.c +index 1402f4f..8f9bcb8 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -1444,6 +1444,9 @@ int kvm_init(MachineClass *mc) + soft_vcpus_limit = kvm_recommended_vcpus(s); + hard_vcpus_limit = kvm_max_vcpus(s); + ++ /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */ ++ hard_vcpus_limit = soft_vcpus_limit; ++ + while (nc->name) { + if (nc->num > soft_vcpus_limit) { + fprintf(stderr, diff --git a/SOURCES/kvm-monitor-Remove-host_net_add-remove-for-Red-Hat-Enterprise-Linux.patch b/SOURCES/kvm-monitor-Remove-host_net_add-remove-for-Red-Hat-Enterprise-Linux.patch new file mode 100644 index 0000000..5a63e7a --- /dev/null +++ b/SOURCES/kvm-monitor-Remove-host_net_add-remove-for-Red-Hat-Enterprise-Linux.patch @@ -0,0 +1,48 @@ +From dcb876d291d7de185b21d95a2cf6cfd1034a6b36 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:04 +0100 +Subject: monitor: Remove host_net_add/remove for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 55519 +O-Subject: [RHEL7 qemu-kvm PATCH v2 4/4] monitor: Remove host_net_add/remove for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit dd94505bd1b826db0c7e155ccee5c24f77987f16: + + monitor: Remove host_net_add/remove for Red Hat Enterprise Linux + + The host_net_add/remove commands are replaced by netdev_add/del. Remove + them. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 6946d37..71f19fb 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1217,6 +1217,7 @@ STEXI + Inject PCIe AER error + ETEXI + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "host_net_add", + .args_type = "device:s,opts:s?", +@@ -1246,6 +1247,7 @@ STEXI + @findex host_net_remove + Remove host VLAN client. + ETEXI ++#endif + + { + .name = "netdev_add", diff --git a/SOURCES/kvm-monitor-Remove-pci_add-command-for-Red-Hat-Enterprise-Linux.patch b/SOURCES/kvm-monitor-Remove-pci_add-command-for-Red-Hat-Enterprise-Linux.patch new file mode 100644 index 0000000..85a7b42 --- /dev/null +++ b/SOURCES/kvm-monitor-Remove-pci_add-command-for-Red-Hat-Enterprise-Linux.patch @@ -0,0 +1,41 @@ +From 31958755f9668805a0f22acbbfc95a79a397ebe8 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:01 +0100 +Subject: monitor: Remove pci_add command for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: <2e280a8060b33499eae1704843285ceb7f602470.1383741033.git.mrezanin@redhat.com> +Patchwork-id: 55518 +O-Subject: [RHEL7 qemu-kvm PATCH v2 1/4] monitor: Remove pci_add command for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit 22aef6c9882ac60bcf3df98e67c4b9b729a90707: + + monitor: Remove pci_add command for Red Hat Enterprise Linux + + pci_add is the old way of hot-plugging pci (nic or storage) devices. + The newer device_add is the recommended and suggested command. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index f24a72a..0717b89 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1158,7 +1158,7 @@ STEXI + Add drive to PCI storage controller. + ETEXI + +-#if defined(CONFIG_PCI_HOTPLUG_OLD) ++#if defined(CONFIG_PCI_HOTPLUG_OLD) && 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "pci_add", + .args_type = "pci_addr:s,type:s,opts:s?", diff --git a/SOURCES/kvm-monitor-Remove-pci_del-command-for-Red-Hat-Enterprise-Linux.patch b/SOURCES/kvm-monitor-Remove-pci_del-command-for-Red-Hat-Enterprise-Linux.patch new file mode 100644 index 0000000..c77a182 --- /dev/null +++ b/SOURCES/kvm-monitor-Remove-pci_del-command-for-Red-Hat-Enterprise-Linux.patch @@ -0,0 +1,41 @@ +From dfea89c27d480715b4d73b58c35064cc1b426995 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:02 +0100 +Subject: monitor: Remove pci_del command for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: <6e7cc8214fdc2fd6a95a7446c667bf36fc13f3ce.1383741033.git.mrezanin@redhat.com> +Patchwork-id: 55517 +O-Subject: [RHEL7 qemu-kvm PATCH v2 2/4] monitor: Remove pci_del command for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit 609b9f16a7443e86e55a3cdc76a484253e50267b: + + monitor: Remove pci_del command for Red Hat Enterprise Linux + + pci_del is the old way of hot-unplugging pci (nic or storage) devices. + The newer device_del is the recommended and suggested command. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 0717b89..68153b1 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1174,7 +1174,7 @@ STEXI + Hot-add PCI device. + ETEXI + +-#if defined(CONFIG_PCI_HOTPLUG_OLD) ++#if defined(CONFIG_PCI_HOTPLUG_OLD) && 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "pci_del", + .args_type = "pci_addr:s", diff --git a/SOURCES/kvm-monitor-Remove-usb_add-del-commands-for-Red-Hat-Enterprise-Linux.patch b/SOURCES/kvm-monitor-Remove-usb_add-del-commands-for-Red-Hat-Enterprise-Linux.patch new file mode 100644 index 0000000..c3967c2 --- /dev/null +++ b/SOURCES/kvm-monitor-Remove-usb_add-del-commands-for-Red-Hat-Enterprise-Linux.patch @@ -0,0 +1,48 @@ +From 779be22afd135cfd37eff20ce24f45166d8d6a23 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:03 +0100 +Subject: monitor: Remove usb_add/del commands for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 55520 +O-Subject: [RHEL7 qemu-kvm PATCH v2 3/4] monitor: Remove usb_add/del commands for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit 754e6292b4ab41c8848171555af830ab7284f4d3: + + monitor: Remove usb_add/del commands for Red Hat Enterprise Linux + + The usb_add/del commands have been obsoleted by the device_add/del + commands. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 68153b1..6946d37 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -628,6 +628,7 @@ STEXI + Compute the checksum of a memory region. + ETEXI + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "usb_add", + .args_type = "devname:s", +@@ -660,6 +661,7 @@ Remove the USB device @var{devname} from the QEMU virtual USB + hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor + command @code{info usb} to see the devices you can remove. + ETEXI ++#endif + + { + .name = "device_add", diff --git a/SOURCES/kvm-pc-Add-RHEL6-e1000-gPXE-image.patch b/SOURCES/kvm-pc-Add-RHEL6-e1000-gPXE-image.patch new file mode 100644 index 0000000..2419767 --- /dev/null +++ b/SOURCES/kvm-pc-Add-RHEL6-e1000-gPXE-image.patch @@ -0,0 +1,13 @@ +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1071,6 +1071,10 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "romfile",\ + .value = "rhel6-rtl8139.rom",\ + },{\ ++ .driver = "e1000",\ ++ .property = "romfile",\ ++ .value = "rhel6-e1000.rom",\ ++ },{\ + .driver = "virtio-net-pci",\ + .property = "romfile",\ + .value = "rhel6-virtio.rom",\ diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-0-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-0-0.patch new file mode 100644 index 0000000..5b03d55 --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-0-0.patch @@ -0,0 +1,269 @@ +From a2ca7b5bacc7d10d98c58ffd898c463e122ab869 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:02:14 +0200 +Subject: pc: Add machine type "rhel6.0.0" + +Message-id: <1375201922-6794-3-git-send-email-armbru@redhat.com> +Patchwork-id: 52821 +O-Subject: [RHEL-7 PATCH v3 02/15] pc: Add machine type "rhel6.0.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Make it a copy of upstream's pc-0.12 type. Change name and desc. +Collect the scattered compat_props in one place (no functional +change). Copy the init function. + +The next few commits will morph compat_props and init function from +"same as upstream's pc-0.12" into "compatible with RHEL-6's +rhel6.0.0". + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index ae8b34e..c540ad3 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,9 +941,241 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + ++#define PC_RHEL6_0_COMPAT \ ++ {\ ++ .driver = "Conroe-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Conroe-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Penryn-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Penryn-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Nehalem-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Nehalem-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "scsi-hd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "scsi-cd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "scsi-disk",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-hd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-cd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-drive",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "vectors",\ ++ /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\ ++ .value = stringify(0xFFFFFFFF),\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "romfile",\ ++ .value = "pxe-e1000.rom",\ ++ },{\ ++ .driver = "ne2k_pci",\ ++ .property = "romfile",\ ++ .value = "pxe-ne2k_pci.rom",\ ++ },{\ ++ .driver = "pcnet",\ ++ .property = "romfile",\ ++ .value = "pxe-pcnet.rom",\ ++ },{\ ++ .driver = "rtl8139",\ ++ .property = "romfile",\ ++ .value = "pxe-rtl8139.rom",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "romfile",\ ++ .value = "pxe-virtio.rom",\ ++ },{\ ++ .driver = "486-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "usb-tablet",\ ++ .property = "usb_version",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "ctrl_mac_addr",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "mq",\ ++ .value = "off",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "autonegotiation",\ ++ .value = "off",\ ++ },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "msi",\ ++ .value = "off",\ ++ },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "msix",\ ++ .value = "off",\ ++ },{\ ++ .driver = "ivshmem",\ ++ .property = "use64",\ ++ .value = "0",\ ++ },{\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "mmio",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "hotplug",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "param_change",\ ++ .value = "off",\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(8),\ ++ },{\ ++ .driver = "vmware-svga",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(8),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(8),\ ++ },{\ ++ .driver = "qxl",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(8),\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "config-wce",\ ++ .value = "off",\ ++ },{\ ++ .driver = "pc-sysfw",\ ++ .property = "rom_only",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = TYPE_ISA_FDC,\ ++ .property = "check_media_rate",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-balloon-pci",\ ++ .property = "class",\ ++ .value = stringify(PCI_CLASS_MEMORY_RAM),\ ++ },{\ ++ .driver = "apic",\ ++ .property = "vapic",\ ++ .value = "off",\ ++ },{\ ++ .driver = TYPE_USB_DEVICE,\ ++ .property = "full-path",\ ++ .value = "no",\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-balloon-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = TYPE_PCI_DEVICE,\ ++ .property = "command_serr_enable",\ ++ .value = "off",\ ++ },{\ ++ .driver = "AC97",\ ++ .property = "use_broken_id",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "max_ports",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "vectors",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "rombar",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "vmware-svga",\ ++ .property = "rombar",\ ++ .value = stringify(0),\ ++ } ++ ++static void pc_init_rhel600(MachineState *machine) ++{ ++ x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); ++ enable_compat_apic_id_mode(); ++ pc_init1(machine, 1, 0); ++} ++ ++static QEMUMachine pc_machine_rhel600 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.0.0", ++ .desc = "RHEL 6.0.0 PC", ++ .init = pc_init_rhel600, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_0_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel600); + } + + machine_init(rhel_machine_init); diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-1-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-1-0.patch new file mode 100644 index 0000000..814aeb7 --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-1-0.patch @@ -0,0 +1,106 @@ +From 3082c782507433d450155a436f89c99e7a723002 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:04:57 +0200 +Subject: pc: Add machine type "rhel6.1.0" + +Message-id: <1375201922-6794-11-git-send-email-armbru@redhat.com> +Patchwork-id: 52822 +O-Subject: [RHEL-7 PATCH v3 10/15] pc: Add machine type "rhel6.1.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Match RHEL-6's compat_props qxl.revision, qxl-vga.revision, +VGA.rombar. + +RHEL-6's vmware-svga.rombar isn't needed, as we won't ship the device. + +RHEL-6's non-upstream virtio-serial-pci.flow_control isn't needed. +RHEL-6 has it to enable migration back to RHEL-6.0 (see qemu-kvm-rhel6 +commit 975ced4), which isn't relevant in RHEL-7. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e4fbb08..99f12e8 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,7 +941,7 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + +-#define PC_RHEL6_0_COMPAT \ ++#define PC_RHEL6_1_COMPAT \ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "model",\ +@@ -1034,11 +1034,11 @@ static QEMUMachine pc_machine_rhel700 = { + },{\ + .driver = "qxl",\ + .property = "revision",\ +- .value = stringify(1),\ ++ .value = stringify(2),\ + },{\ + .driver = "qxl-vga",\ + .property = "revision",\ +- .value = stringify(1),\ ++ .value = stringify(2),\ + },{\ + .driver = "VGA",\ + .property = "mmio",\ +@@ -1087,6 +1087,37 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "AC97",\ + .property = "use_broken_id",\ + .value = stringify(1),\ ++ } ++ ++static void pc_init_rhel610(MachineState *machine) ++{ ++ x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); ++ enable_compat_apic_id_mode(); ++ pc_init_rhel700(machine ); ++} ++ ++static QEMUMachine pc_machine_rhel610 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.1.0", ++ .desc = "RHEL 6.1.0 PC", ++ .init = pc_init_rhel610, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_1_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ ++#define PC_RHEL6_0_COMPAT \ ++ PC_RHEL6_1_COMPAT,\ ++ {\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(1),\ + },{\ + .driver = "VGA",\ + .property = "rombar",\ +@@ -1097,7 +1128,7 @@ static void pc_init_rhel600(MachineState *machine) + { + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); +- pc_init_rhel700(machine); ++ pc_init_rhel610(machine); + } + + static QEMUMachine pc_machine_rhel600 = { +@@ -1115,6 +1146,7 @@ static QEMUMachine pc_machine_rhel600 = { + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel610); + qemu_register_pc_machine(&pc_machine_rhel600); + } + diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-2-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-2-0.patch new file mode 100644 index 0000000..6674a54 --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-2-0.patch @@ -0,0 +1,144 @@ +From b42f56083fdb9486c892982045459c0867583578 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:05:31 +0200 +Subject: pc: Add machine type "rhel6.2.0" + +Message-id: <1375201922-6794-12-git-send-email-armbru@redhat.com> +Patchwork-id: 52823 +O-Subject: [RHEL-7 PATCH v3 11/15] pc: Add machine type "rhel6.2.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Match RHEL-6's compat_props qxl.revision, +qxl-vga.revision. virtio-blk-pci.event_idx, +virtio-serial-pci.event_idx, virtio-net-pci.event_idx, +virtio-balloon-pci.event_idx. + +RHEL-6's non-upstream hda-duplex.mcompat, hda-micro.mcompat, +hda-output.mcompat aren't needed. RHEL-6 has them to enable migration +back to RHEL-6.1 (see qemu-kvm-rhel6 commit d619762), which isn't +relevant in RHEL-7. + +Non-upstream usb-tablet.migrate, usb-mouse.migrate, usb-kbd.migrate +will be covered separately (bug 953304). + +PIIX4_PM.disable_s3, PIIX4_PM.disable_s4 will be covered separately +(bug 980840). + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 99f12e8..3c0f9f7 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,7 +941,7 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + +-#define PC_RHEL6_1_COMPAT \ ++#define PC_RHEL6_2_COMPAT \ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "model",\ +@@ -1034,11 +1034,11 @@ static QEMUMachine pc_machine_rhel700 = { + },{\ + .driver = "qxl",\ + .property = "revision",\ +- .value = stringify(2),\ ++ .value = stringify(3),\ + },{\ + .driver = "qxl-vga",\ + .property = "revision",\ +- .value = stringify(2),\ ++ .value = stringify(3),\ + },{\ + .driver = "VGA",\ + .property = "mmio",\ +@@ -1064,6 +1064,45 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "class",\ + .value = stringify(PCI_CLASS_MEMORY_RAM),\ + },{\ ++ .driver = TYPE_PCI_DEVICE,\ ++ .property = "command_serr_enable",\ ++ .value = "off",\ ++ },{\ ++ .driver = "AC97",\ ++ .property = "use_broken_id",\ ++ .value = stringify(1),\ ++ } ++ ++static void pc_init_rhel620(MachineState *machine) ++{ ++ x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); ++ enable_compat_apic_id_mode(); ++ pc_init_rhel700(machine); ++} ++ ++static QEMUMachine pc_machine_rhel620 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.2.0", ++ .desc = "RHEL 6.2.0 PC", ++ .init = pc_init_rhel620, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_2_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ ++#define PC_RHEL6_1_COMPAT \ ++ PC_RHEL6_2_COMPAT,\ ++ {\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(2),\ ++ },{\ + .driver = "virtio-blk-pci",\ + .property = "event_idx",\ + .value = "off",\ +@@ -1079,21 +1118,11 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "virtio-balloon-pci",\ + .property = "event_idx",\ + .value = "off",\ +- },{\ +- .driver = TYPE_PCI_DEVICE,\ +- .property = "command_serr_enable",\ +- .value = "off",\ +- },{\ +- .driver = "AC97",\ +- .property = "use_broken_id",\ +- .value = stringify(1),\ + } + + static void pc_init_rhel610(MachineState *machine) + { +- x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); +- enable_compat_apic_id_mode(); +- pc_init_rhel700(machine ); ++ pc_init_rhel620(machine); + } + + static QEMUMachine pc_machine_rhel610 = { +@@ -1126,8 +1155,6 @@ static QEMUMachine pc_machine_rhel610 = { + + static void pc_init_rhel600(MachineState *machine) + { +- x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); +- enable_compat_apic_id_mode(); + pc_init_rhel610(machine); + } + +@@ -1146,6 +1173,7 @@ static QEMUMachine pc_machine_rhel600 = { + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel620); + qemu_register_pc_machine(&pc_machine_rhel610); + qemu_register_pc_machine(&pc_machine_rhel600); + } diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-3-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-3-0.patch new file mode 100644 index 0000000..d20dc0c --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-3-0.patch @@ -0,0 +1,74 @@ +From 0d5aa30b3fe342e97858feffa4477d7e99b9519a Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:05:46 +0200 +Subject: pc: Add machine type "rhel6.3.0" + +Message-id: <1375201922-6794-13-git-send-email-armbru@redhat.com> +Patchwork-id: 52826 +O-Subject: [RHEL-7 PATCH v3 12/15] pc: Add machine type "rhel6.3.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +RHEL-6's non-upstream virtio-net-pci.x-__com_redhat_rhel620_compat +will be covered separately, if necessary (no BZ yet). + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3c0f9f7..4636c5f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,7 +941,7 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + +-#define PC_RHEL6_2_COMPAT \ ++#define PC_RHEL6_3_COMPAT \ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "model",\ +@@ -1073,13 +1073,33 @@ static QEMUMachine pc_machine_rhel700 = { + .value = stringify(1),\ + } + +-static void pc_init_rhel620(MachineState *machine) ++static void pc_init_rhel630(MachineState *machine) + { + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); + pc_init_rhel700(machine); + } + ++static QEMUMachine pc_machine_rhel630 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.3.0", ++ .desc = "RHEL 6.3.0 PC", ++ .init = pc_init_rhel630, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_3_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ ++#define PC_RHEL6_2_COMPAT \ ++ PC_RHEL6_3_COMPAT ++ ++static void pc_init_rhel620(MachineState *machine) ++{ ++ pc_init_rhel630(machine); ++} ++ + static QEMUMachine pc_machine_rhel620 = { + PC_DEFAULT_MACHINE_OPTIONS, + .name = "rhel6.2.0", +@@ -1173,6 +1193,7 @@ static QEMUMachine pc_machine_rhel600 = { + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel630); + qemu_register_pc_machine(&pc_machine_rhel620); + qemu_register_pc_machine(&pc_machine_rhel610); + qemu_register_pc_machine(&pc_machine_rhel600); diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-4-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-4-0.patch new file mode 100644 index 0000000..320ffff --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-4-0.patch @@ -0,0 +1,206 @@ +From 914a240b74854c074d84bb8c298afc576841e5da Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:05:58 +0200 +Subject: pc: Add machine type "rhel6.4.0" + +Message-id: <1375201922-6794-14-git-send-email-armbru@redhat.com> +Patchwork-id: 52820 +O-Subject: [RHEL-7 PATCH v3 13/15] pc: Add machine type "rhel6.4.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Match RHEL-6's set_cpu_model_level() by equivalent compat_props model +and level. + +Match RHEL-6's compat_props qxl.revision, qxl-vga.revision, +virtio-scsi-pci.hotplug, virtio-scsi-pci.param_change. + +RHEL-6's non-upstream USB.create_unique_serial will be covered +separately (either bug 953304 or a new one). + +RHEL-6's non-upstream isa-fdc.migrate_dir isn't needed. RHEL-6 has it +to enable migration back to RHEL-6.3 (see qemu-kvm-rhel6 commit +a214015), which isn't relevant in RHEL-7. + +Match RHEL-6's non-upstream e1000.x-__com_redhat_rhel630_compat by +upstream's e1000.autonegotiation, as follows. + +Upstream commit 2af234e disables auto-negotiation for older machine +types, by defining property e1000.autonegotiation and putting it into +suitable compat_props. The corresponding RHEL-6 commit da4452c does +not add this property. Instead, it reuses +e1000.x-__com_redhat_rhel630_compat, with the sense reverted. This +turns autonegotiation off for rhel6.3.0 and older. + +RHEL-7 inherits the upstream solution. We need to set +e1000.autonegotiation for exactly the machine types where +e1000.x-__com_redhat_rhel630_compat is on in RHEL-6, namely rhel6.3.0 +and older. + +Match RHEL-6's disable_kvm_pv_eoi(). + +Match RHEL-6's compat_contiguous_apic_ids by upstream's +enable_compat_apic_id_mode(). + +RHEL-6's set_pmu_passthrough() and disable_tsc_deadline() will be +covered separately (bug 918907). + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 4636c5f..37ddc93 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,32 +941,8 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + +-#define PC_RHEL6_3_COMPAT \ ++#define PC_RHEL6_4_COMPAT \ + {\ +- .driver = "Conroe-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Conroe-" TYPE_X86_CPU,\ +- .property = "level",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Penryn-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Penryn-" TYPE_X86_CPU,\ +- .property = "level",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Nehalem-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Nehalem-" TYPE_X86_CPU,\ +- .property = "level",\ +- .value = stringify(2),\ +- },{\ + .driver = "scsi-hd",\ + .property = "discard_granularity",\ + .value = stringify(0),\ +@@ -1028,30 +1004,10 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "mq",\ + .value = "off",\ + },{\ +- .driver = "e1000",\ +- .property = "autonegotiation",\ +- .value = "off",\ +- },{\ +- .driver = "qxl",\ +- .property = "revision",\ +- .value = stringify(3),\ +- },{\ +- .driver = "qxl-vga",\ +- .property = "revision",\ +- .value = stringify(3),\ +- },{\ + .driver = "VGA",\ + .property = "mmio",\ + .value = "off",\ + },{\ +- .driver = "virtio-scsi-pci",\ +- .property = "hotplug",\ +- .value = "off",\ +- },{\ +- .driver = "virtio-scsi-pci",\ +- .property = "param_change",\ +- .value = "off",\ +- },{\ + .driver = "virtio-blk-pci",\ + .property = "config-wce",\ + .value = "off",\ +@@ -1073,11 +1029,76 @@ static QEMUMachine pc_machine_rhel700 = { + .value = stringify(1),\ + } + ++static void pc_init_rhel640(MachineState *machine) ++{ ++ pc_init_rhel700(machine); ++} ++ ++static QEMUMachine pc_machine_rhel640 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.4.0", ++ .desc = "RHEL 6.4.0 PC", ++ .init = pc_init_rhel640, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_4_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ ++#define PC_RHEL6_3_COMPAT \ ++ PC_RHEL6_4_COMPAT,\ ++ {\ ++ .driver = "Conroe-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Conroe-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Penryn-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Penryn-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Nehalem-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Nehalem-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "autonegotiation",\ ++ .value = "off",\ ++ },{\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "hotplug",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "param_change",\ ++ .value = "off",\ ++ } ++ + static void pc_init_rhel630(MachineState *machine) + { + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); +- pc_init_rhel700(machine); ++ pc_init_rhel640(machine); + } + + static QEMUMachine pc_machine_rhel630 = { +@@ -1193,6 +1214,7 @@ static QEMUMachine pc_machine_rhel600 = { + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel640); + qemu_register_pc_machine(&pc_machine_rhel630); + qemu_register_pc_machine(&pc_machine_rhel620); + qemu_register_pc_machine(&pc_machine_rhel610); diff --git a/SOURCES/kvm-pc-Add-machine-type-rhel6-5-0.patch b/SOURCES/kvm-pc-Add-machine-type-rhel6-5-0.patch new file mode 100644 index 0000000..a55a0be --- /dev/null +++ b/SOURCES/kvm-pc-Add-machine-type-rhel6-5-0.patch @@ -0,0 +1,84 @@ +From 32069b11e18b05f3103ae47dd95f10ee75df0f9e Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:06:25 +0200 +Subject: pc: Add machine type "rhel6.5.0" + +Message-id: <1375201922-6794-15-git-send-email-armbru@redhat.com> +Patchwork-id: 52824 +O-Subject: [RHEL-7 PATCH v3 14/15] pc: Add machine type "rhel6.5.0" +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Match RHEL-6's virtio-scsi-pci.vectors. Note: upstream commit 4c205d0 +"virtio-scsi: enable MSI-X support" changed vectors from 2 to +DEV_NVECTORS_UNSPECIFIED. The necessary compat_props to keep it at 2 +for old machine types were forgotten. The RHEL-6 backport (commit +0ef7672) added them. + +Match RHEL-6's has_pvpanic. + +RHEL-6's disable_kvm_sep() will be covered separately (bug 918907). + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 37ddc93..e77878f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -941,7 +941,7 @@ static QEMUMachine pc_machine_rhel700 = { + .is_default = 1, + }; + +-#define PC_RHEL6_4_COMPAT \ ++#define PC_RHEL6_5_COMPAT \ + {\ + .driver = "scsi-hd",\ + .property = "discard_granularity",\ +@@ -1029,11 +1029,36 @@ static QEMUMachine pc_machine_rhel700 = { + .value = stringify(1),\ + } + +-static void pc_init_rhel640(MachineState *machine) ++static void pc_init_rhel650(MachineState *machine) + { + pc_init_rhel700(machine); + } + ++static QEMUMachine pc_machine_rhel650 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "rhel6.5.0", ++ .desc = "RHEL 6.5.0 PC", ++ .init = pc_init_rhel650, ++ .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_RHEL6_5_COMPAT, ++ { /* end of list */ } ++ }, ++}; ++ ++#define PC_RHEL6_4_COMPAT \ ++ PC_RHEL6_5_COMPAT,\ ++ {\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "vectors",\ ++ .value = stringify(2),\ ++ } ++ ++static void pc_init_rhel640(MachineState *machine) ++{ ++ pc_init_rhel650(machine); ++} ++ + static QEMUMachine pc_machine_rhel640 = { + PC_DEFAULT_MACHINE_OPTIONS, + .name = "rhel6.4.0", +@@ -1214,6 +1239,7 @@ static QEMUMachine pc_machine_rhel600 = { + static void rhel_machine_init(void) + { + qemu_register_pc_machine(&pc_machine_rhel700); ++ qemu_register_pc_machine(&pc_machine_rhel650); + qemu_register_pc_machine(&pc_machine_rhel640); + qemu_register_pc_machine(&pc_machine_rhel630); + qemu_register_pc_machine(&pc_machine_rhel620); diff --git a/SOURCES/kvm-pc-Create-pc_compat_rhel-functions.patch b/SOURCES/kvm-pc-Create-pc_compat_rhel-functions.patch new file mode 100644 index 0000000..4bdbce4 --- /dev/null +++ b/SOURCES/kvm-pc-Create-pc_compat_rhel-functions.patch @@ -0,0 +1,184 @@ +From 234daf92e9636799a551a38ecc6ddb7a77f1ffe1 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 20 Jan 2014 19:05:29 +0100 +Subject: pc: Create pc_compat_rhel*() functions + +RH-Author: Eduardo Habkost +Message-id: <1390244730-31038-2-git-send-email-ehabkost@redhat.com> +Patchwork-id: 56847 +O-Subject: [RHEL7 qemu-kvm PATCH 1/2] pc: Create pc_compat_rhel*() functions +Bugzilla: 1049706 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +Bugzilla: 1049706 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6900764 +Upstream status: not applicable + +This is the RHEL equivalent of upstream +commit 396f79f45ea75bd1c421522f29b4f91d490df7cc. + +With the previous code, the compat code for a newer release could undo +the compat changes made by the compat code for an older release. With +the pc_init_*()/pc_compat_*() pattern, we can have two compat functions +touching the same bits, as the older compat functions will run last, +allowing it to undo changes done by newer compat functions. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 8fd7a95..9f2cf09 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -925,9 +925,15 @@ machine_init(pc_machine_init); + + /* Red Hat Enterprise Linux machine types */ + ++static void pc_compat_rhel700(MachineState *machine) ++{ ++} ++ + static void pc_init_rhel700(MachineState *machine) + { ++ pc_compat_rhel700(machine); + pc_init_pci(machine); ++ + } + + static QEMUMachine pc_machine_rhel700 = { +@@ -1046,8 +1052,9 @@ static QEMUMachine pc_machine_rhel700 = { + .value = "rhel6-virtio.rom",\ + } + +-static void pc_init_rhel650(MachineState *machine) ++static void pc_compat_rhel650(MachineState *machine) + { ++ pc_compat_rhel700(machine); + x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC); +@@ -1086,7 +1093,12 @@ static void pc_init_rhel650(MachineState *machine) + CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT); + + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_UNHALT); +- pc_init_rhel700(machine); ++} ++ ++static void pc_init_rhel650(MachineState *machine) ++{ ++ pc_compat_rhel650(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel650 = { +@@ -1125,10 +1137,16 @@ static QEMUMachine pc_machine_rhel650 = { + .value = "off",\ + } + +-static void pc_init_rhel640(MachineState *machine) ++static void pc_compat_rhel640(MachineState *machine) + { ++ pc_compat_rhel650(machine); + x86_cpu_compat_set_features(NULL, FEAT_1_EDX, 0, CPUID_SEP); +- pc_init_rhel650(machine); ++} ++ ++static void pc_init_rhel640(MachineState *machine) ++{ ++ pc_compat_rhel640(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel640 = { +@@ -1191,13 +1209,19 @@ static QEMUMachine pc_machine_rhel640 = { + .value = "1",\ + } + +-static void pc_init_rhel630(MachineState *machine) ++static void pc_compat_rhel630(MachineState *machine) + { ++ pc_compat_rhel640(machine); + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); + x86_cpu_compat_set_features("SandyBridge", FEAT_1_ECX, + 0, CPUID_EXT_TSC_DEADLINE_TIMER); +- pc_init_rhel640(machine); ++} ++ ++static void pc_init_rhel630(MachineState *machine) ++{ ++ pc_compat_rhel630(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel630 = { +@@ -1220,9 +1244,15 @@ static QEMUMachine pc_machine_rhel630 = { + .value = "off",\ + } + ++static void pc_compat_rhel620(MachineState *machine) ++{ ++ pc_compat_rhel630(machine); ++} ++ + static void pc_init_rhel620(MachineState *machine) + { +- pc_init_rhel630(machine); ++ pc_compat_rhel620(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel620 = { +@@ -1286,9 +1316,15 @@ static QEMUMachine pc_machine_rhel620 = { + .value = "1",\ + } + ++static void pc_compat_rhel610(MachineState *machine) ++{ ++ pc_compat_rhel620(machine); ++} ++ + static void pc_init_rhel610(MachineState *machine) + { +- pc_init_rhel620(machine); ++ pc_compat_rhel610(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel610 = { +@@ -1319,9 +1355,15 @@ static QEMUMachine pc_machine_rhel610 = { + .value = stringify(0),\ + } + ++static void pc_compat_rhel600(MachineState *machine) ++{ ++ pc_compat_rhel610(machine); ++} ++ + static void pc_init_rhel600(MachineState *machine) + { +- pc_init_rhel610(machine); ++ pc_compat_rhel600(machine); ++ pc_init_pci(machine); + } + + static QEMUMachine pc_machine_rhel600 = { +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index de81dce..4290f84 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -436,8 +436,13 @@ machine_init(pc_q35_machine_init); + + /* Red Hat Enterprise Linux machine types */ + ++static void pc_q35_compat_rhel700(MachineState *machine) ++{ ++} ++ + static void pc_q35_init_rhel700(MachineState *machine) + { ++ pc_q35_compat_rhel700(machine); + pc_q35_init(machine); + } + diff --git a/SOURCES/kvm-pc-Disable-RDTSCP-on-AMD-CPU-models.patch b/SOURCES/kvm-pc-Disable-RDTSCP-on-AMD-CPU-models.patch new file mode 100644 index 0000000..71928c2 --- /dev/null +++ b/SOURCES/kvm-pc-Disable-RDTSCP-on-AMD-CPU-models.patch @@ -0,0 +1,90 @@ +From 47d47cf36d5172dbe6d2c3b3794817d30d10610c Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 27 Jan 2014 16:07:43 +0100 +Subject: pc: Disable RDTSCP on AMD CPU models + +RH-Author: Eduardo Habkost +Message-id: <1390838863-11030-3-git-send-email-ehabkost@redhat.com> +Patchwork-id: 56961 +O-Subject: [RHEL7 qemu-kvm PATCH v2 2/2] pc: Disable RDTSCP on AMD CPU models +Bugzilla: 1056428 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Igor Mammedov +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 874400 +Upstream status: not applicable (see notes below) +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6953316 + +KVM can't expose RDTSCP to guests on AMD CPUs, so there's no point in +having RDTSCP enabled on AMD CPU models. + +About upstream status and rationale for making it RHEL-specific: + +This is another case where independently from the upstream decision, we +will want to add RHEL-specific code to fiddle with the CPU definitions. + +TCG does support RDTSCP, so it makes sense for upstream to keep RDTSCP +enabled on those CPU models. We, on the other hand, care about KVM and +know libvirt doesn't use enforce mode yet (but should eventually use +it), so it makes sense to disable RDTSCP on AMD models in RHEL. + +(This will eventually be a problem for libvirt upstream, when it starts +using or emulating "enforce" mode. I have added notes at: +http://wiki.qemu.org/Features/CPUModels#Disabling_features_that_were_always_disabled_on_KVM ) + +Changes v1 -> v2: + * Fix typo: "phenon" -> "phenom" + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index a10fb4f..2a6ac6d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -937,6 +937,20 @@ static void pc_compat_rhel700(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ ++ /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it ++ * on AMD CPU models. ++ */ ++ x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); + } + + static void pc_init_rhel700(MachineState *machine) +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 0b88f43..df60f2e 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -448,6 +448,20 @@ static void pc_q35_compat_rhel700(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ ++ /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it ++ * on AMD CPU models. ++ */ ++ x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); + } + + static void pc_q35_init_rhel700(MachineState *machine) diff --git a/SOURCES/kvm-pc-Disable-RDTSCP-unconditionally-on-rhel6-machine-types.patch b/SOURCES/kvm-pc-Disable-RDTSCP-unconditionally-on-rhel6-machine-types.patch new file mode 100644 index 0000000..fcce3ed --- /dev/null +++ b/SOURCES/kvm-pc-Disable-RDTSCP-unconditionally-on-rhel6-machine-types.patch @@ -0,0 +1,60 @@ +From 0f2d9f31fa4ccd5e133a16e26402518440a1a9f2 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 27 Jan 2014 16:07:42 +0100 +Subject: pc: Disable RDTSCP unconditionally on rhel6.* machine-types + +RH-Author: Eduardo Habkost +Message-id: <1390838863-11030-2-git-send-email-ehabkost@redhat.com> +Patchwork-id: 56960 +O-Subject: [RHEL7 qemu-kvm PATCH 1/2] pc: Disable RDTSCP unconditionally on rhel6.* machine-types +Bugzilla: 918907 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Igor Mammedov +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6953316 + +The RHEL-6 kernel didn't support exposing RDTSCP at all, so we need to +disable RDTSCP on all CPU models. + +The previous rhel6.5.0 compat code wasn't complete, because Opteron_G4 +and Opteron_G5 were not being changed. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 2818a15..a10fb4f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1080,10 +1080,9 @@ static void pc_compat_rhel650(MachineState *machine) + CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | + CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, + 0); +- x86_cpu_compat_set_features("SandyBridge", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Haswell", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); ++ ++ /* RHEL-6 kernel never supported exposing RDTSCP */ ++ x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0, CPUID_EXT2_RDTSCP); + + x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); +@@ -1091,15 +1090,6 @@ static void pc_compat_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, 0, CPUID_EXT_X2APIC); + x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, 0, CPUID_EXT_X2APIC); + +- x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G1", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, +- 0, CPUID_EXT2_RDTSCP); +- + /* RHEL-6 had 3dnow & 3dnowext unconditionally disabled on all models */ + x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0, + CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT); diff --git a/SOURCES/kvm-pc-Drop-RHEL-6-USB-device-compat_prop-full-path.patch b/SOURCES/kvm-pc-Drop-RHEL-6-USB-device-compat_prop-full-path.patch new file mode 100644 index 0000000..164c52d --- /dev/null +++ b/SOURCES/kvm-pc-Drop-RHEL-6-USB-device-compat_prop-full-path.patch @@ -0,0 +1,36 @@ +From e738745568a78160f661bbcb7159552c66f9a527 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:03:35 +0200 +Subject: pc: Drop RHEL-6 USB device compat_prop full-path + +Message-id: <1375201922-6794-6-git-send-email-armbru@redhat.com> +Patchwork-id: 52814 +O-Subject: [RHEL-7 PATCH v3 05/15] pc: Drop RHEL-6 USB device compat_prop full-path +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Upstream added property full-path to USB devices in commit eeb0cf9 +(v1.1) for migration compatibility. RHEL-6 got the feature in commit +29b10d1 (6.2), but without the property, because 6.2 was the first +version capable of migrating USB devices. Therefore, full-path needs +to remain on by default for all machine types. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 776689c..5c1fe1e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1068,10 +1068,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "vapic",\ + .value = "off",\ + },{\ +- .driver = TYPE_USB_DEVICE,\ +- .property = "full-path",\ +- .value = "no",\ +- },{\ + .driver = "virtio-blk-pci",\ + .property = "event_idx",\ + .value = "off",\ diff --git a/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-apic-kvm-apic-vapic.patch b/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-apic-kvm-apic-vapic.patch new file mode 100644 index 0000000..7fe8c16 --- /dev/null +++ b/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-apic-kvm-apic-vapic.patch @@ -0,0 +1,44 @@ +From 1dd2e614b20962173bd05519479e6271ae9cb4f0 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:04:01 +0200 +Subject: pc: Drop RHEL-6 compat_props {apic, kvm-apic}.vapic + +Message-id: <1375201922-6794-8-git-send-email-armbru@redhat.com> +Patchwork-id: 52816 +O-Subject: [RHEL-7 PATCH v3 07/15] pc: Drop RHEL-6 compat_props {apic, kvm-apic}.vapic +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +RHEL-6's kvm_arch_create() calls kvm_tpr_opt_setup() #ifdef +KVM_EXIT_TPR_ACCESS, which is defined in RHEL-6. Adds migration +section "kvm-tpr-opt" when KVM is enabled. Comes from qemu-kvm, +initial commit 885e90b. + +It went into upstream qemu v1.1.0, but in different form (commit +e5ad936 "kvmvapic: Introduce TPR access optimization for Windows +guests"). Here, migration section "kvm-tpr-opt" belongs to qdev +"kvmvapic", which is created when the property kvm-apic.vapic +(inherited from apic_common) is on. Commit 9bea6a2 disables it for +older machine types, with suitable compat_props. + +Drop them from the RHEL-6 machine types. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 00170cf..3c9c4a5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1064,10 +1064,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "class",\ + .value = stringify(PCI_CLASS_MEMORY_RAM),\ + },{\ +- .driver = "apic",\ +- .property = "vapic",\ +- .value = "off",\ +- },{\ + .driver = "virtio-blk-pci",\ + .property = "event_idx",\ + .value = "off",\ diff --git a/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-virtio-serial-pci-max_ports-vectors.patch b/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-virtio-serial-pci-max_ports-vectors.patch new file mode 100644 index 0000000..892ab37 --- /dev/null +++ b/SOURCES/kvm-pc-Drop-RHEL-6-compat_props-virtio-serial-pci-max_ports-vectors.patch @@ -0,0 +1,37 @@ +From 99a228cd145ca0e63b7067848de88ba902d5f502 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:03:48 +0200 +Subject: pc: Drop RHEL-6 compat_props virtio-serial-pci.{max_ports, vectors} + +Message-id: <1375201922-6794-7-git-send-email-armbru@redhat.com> +Patchwork-id: 52819 +O-Subject: [RHEL-7 PATCH v3 06/15] pc: Drop RHEL-6 compat_props virtio-serial-pci.{max_ports, vectors} +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +RHEL-6 has them only in RHEL-5 machine types. See qemu-kvm-rhel6 +commit aad5614. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 5c1fe1e..00170cf 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1092,14 +1092,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "use_broken_id",\ + .value = stringify(1),\ + },{\ +- .driver = "virtio-serial-pci",\ +- .property = "max_ports",\ +- .value = stringify(1),\ +- },{\ +- .driver = "virtio-serial-pci",\ +- .property = "vectors",\ +- .value = stringify(0),\ +- },{\ + .driver = "VGA",\ + .property = "rombar",\ + .value = stringify(0),\ diff --git a/SOURCES/kvm-pc-Drop-superfluous-RHEL-6-compat_props.patch b/SOURCES/kvm-pc-Drop-superfluous-RHEL-6-compat_props.patch new file mode 100644 index 0000000..c3a5189 --- /dev/null +++ b/SOURCES/kvm-pc-Drop-superfluous-RHEL-6-compat_props.patch @@ -0,0 +1,96 @@ +From d2951632003358f416d060885cf32c0ecf12cf58 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:02:36 +0200 +Subject: pc: Drop superfluous RHEL-6 compat_props + +Message-id: <1375201922-6794-4-git-send-email-armbru@redhat.com> +Patchwork-id: 52812 +O-Subject: [RHEL-7 PATCH v3 03/15] pc: Drop superfluous RHEL-6 compat_props +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Drop compatibility properties of + +* devices we won't ship: ne2k_pci, pcnet, pc-sysfw, vmware-svga + +* devices that are new in RHEL-7: nec-usb-xhci, ivshmem + +Re ivshmem: actually, the current plan is not to ship it (bug 787463). +Executing the plan will only flip the reason for dropping its +compatibility property, so no code conflict here. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index c540ad3..851d7bd 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1004,14 +1004,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "romfile",\ + .value = "pxe-e1000.rom",\ + },{\ +- .driver = "ne2k_pci",\ +- .property = "romfile",\ +- .value = "pxe-ne2k_pci.rom",\ +- },{\ +- .driver = "pcnet",\ +- .property = "romfile",\ +- .value = "pxe-pcnet.rom",\ +- },{\ + .driver = "rtl8139",\ + .property = "romfile",\ + .value = "pxe-rtl8139.rom",\ +@@ -1040,18 +1032,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "autonegotiation",\ + .value = "off",\ + },{\ +- .driver = "nec-usb-xhci",\ +- .property = "msi",\ +- .value = "off",\ +- },{\ +- .driver = "nec-usb-xhci",\ +- .property = "msix",\ +- .value = "off",\ +- },{\ +- .driver = "ivshmem",\ +- .property = "use64",\ +- .value = "0",\ +- },{\ + .driver = "qxl",\ + .property = "revision",\ + .value = stringify(3),\ +@@ -1076,10 +1056,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "vgamem_mb",\ + .value = stringify(8),\ + },{\ +- .driver = "vmware-svga",\ +- .property = "vgamem_mb",\ +- .value = stringify(8),\ +- },{\ + .driver = "qxl-vga",\ + .property = "vgamem_mb",\ + .value = stringify(8),\ +@@ -1092,10 +1068,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "config-wce",\ + .value = "off",\ + },{\ +- .driver = "pc-sysfw",\ +- .property = "rom_only",\ +- .value = stringify(1),\ +- },{\ + .driver = TYPE_ISA_FDC,\ + .property = "check_media_rate",\ + .value = "off",\ +@@ -1147,10 +1119,6 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "VGA",\ + .property = "rombar",\ + .value = stringify(0),\ +- },{\ +- .driver = "vmware-svga",\ +- .property = "rombar",\ +- .value = stringify(0),\ + } + + static void pc_init_rhel600(MachineState *machine) diff --git a/SOURCES/kvm-pc-Enable-x2apic-by-default-on-more-recent-CPU-models-v2.patch b/SOURCES/kvm-pc-Enable-x2apic-by-default-on-more-recent-CPU-models-v2.patch new file mode 100644 index 0000000..d1e18a5 --- /dev/null +++ b/SOURCES/kvm-pc-Enable-x2apic-by-default-on-more-recent-CPU-models-v2.patch @@ -0,0 +1,105 @@ +From 46a92daa96ab895f674f41ec21f3a5718e70570c Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 20 Jan 2014 19:05:30 +0100 +Subject: pc: Enable x2apic by default on more recent CPU models (v2) + +RH-Author: Eduardo Habkost +Message-id: <1390244730-31038-3-git-send-email-ehabkost@redhat.com> +Patchwork-id: 56848 +O-Subject: [RHEL7 qemu-kvm PATCH 2/2] pc: Enable x2apic by default on more recent CPU models (v2) +Bugzilla: 1049706 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Laszlo Ersek + +Bugzilla: 1049706 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6900764 +Upstream status: not applicable (see notes below) + +On RHEL-6 we already enabled x2apic by default on Conroe, Penryn, +Nehalem, Westmere, SandyBridge, Haswell, Opteron_G{1,2,3}. + +To not introduce performance regressions, this patch changes the rhel7 +machine-types to enable x2apic by default on all those models and also +on Opteron_G{4,5}. + +Quoting the patch I sent upstream[1]: + +> Normally we try to keep the CPU model definitions as close as the real +> CPUs as possible, but x2apic can be emulated by KVM without host CPU +> support for x2apic, and it improves performance by reducing APIC access +> overhead. x2apic emulation is available on KVM since 2009 (Linux +> 2.6.32-rc1), there's no reason for not enabling x2apic by default when +> running KVM. + +Upstream status is "not applicable" because this patch touches only the +rhel7-specific PC code. I am doing this because my plan is to enable +x2apic by default even if upstream rejects my patch, and I want to get +this done as soon as possible to get more testing exposure. + +[1] A patch was submitted to change cpu.c to add x2apic to those CPU models + upstream, and can be seen at: + Message-Id: <1390228618-21663-1-git-send-email-ehabkost@redhat.com> + http://article.gmane.org/gmane.comp.emulators.qemu/251492 + + The upstream patch is a resend. A similar patch was sent in + September 2013, was ACKed by Gleb, but was ignored by all + maintainers. + +Changes v2: + * Use the new pc_compat_rhel*() functions + * Disable x2apic explicitly on Opteron_G{4,5} on pc_compat_rhel650() + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 9f2cf09..2818a15 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -927,6 +927,16 @@ machine_init(pc_machine_init); + + static void pc_compat_rhel700(MachineState *machine) + { ++ x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ /* SandyBridge and Haswell already have x2apic enabled */ ++ x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + } + + static void pc_init_rhel700(MachineState *machine) +@@ -1078,6 +1088,8 @@ static void pc_compat_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, 0, CPUID_EXT_X2APIC); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, 0, CPUID_EXT_X2APIC); + + x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, + 0, CPUID_EXT2_RDTSCP); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 4290f84..0b88f43 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -438,6 +438,16 @@ machine_init(pc_q35_machine_init); + + static void pc_q35_compat_rhel700(MachineState *machine) + { ++ x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ /* SandyBridge and Haswell already have x2apic enabled */ ++ x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + } + + static void pc_q35_init_rhel700(MachineState *machine) diff --git a/SOURCES/kvm-pc-Fix-rhel6-3dnow-3dnowext-compat-bits.patch b/SOURCES/kvm-pc-Fix-rhel6-3dnow-3dnowext-compat-bits.patch new file mode 100644 index 0000000..cd167a5 --- /dev/null +++ b/SOURCES/kvm-pc-Fix-rhel6-3dnow-3dnowext-compat-bits.patch @@ -0,0 +1,52 @@ +From 7defeeedca3339356ccfd2fa3576165d6667e694 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 15 Jan 2014 19:37:36 -0500 +Subject: pc: Fix rhel6.* 3dnow & 3dnowext compat bits + +Message-id: <1389814656-20101-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 56728 +O-Subject: [RHEL-7 qemu-kvm PATCH] pc: Fix rhel6.* 3dnow & 3dnowext compat bits +Bugzilla: 918907 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Bandan Das + +Bugzilla: 918907 +Upstream status: not applicable +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6879262 + +RHEL-6 qemu-kvm has a hack that unconditionally disables 3dnow and +3dnowext on the CPUID handling code. To keep compatibility we need to do +the same on the rhel6.* machine-types. + +The hack on RHEL-6 is at target-i386/cpuid.c:cpu_x86_cpuid(): + + switch(index) { + [...] + case 0x80000001: + [...] + if (kvm_enabled()) { + [...] + /* 3dnow */ + *edx &= ~0xc0000000; + } [...] + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3b28360..e3f217e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1080,8 +1080,11 @@ static void pc_init_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, + 0, CPUID_EXT2_RDTSCP); + +- x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_UNHALT); ++ /* RHEL-6 had 3dnow & 3dnowext unconditionally disabled on all models */ ++ x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT); + ++ x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_UNHALT); + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-Give-rhel6-0-0-a-kvmclock.patch b/SOURCES/kvm-pc-Give-rhel6-0-0-a-kvmclock.patch new file mode 100644 index 0000000..a38078b --- /dev/null +++ b/SOURCES/kvm-pc-Give-rhel6-0-0-a-kvmclock.patch @@ -0,0 +1,38 @@ +From 4b4cb7be021a48a3406e1f14c17d739a5c4a3453 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:04:35 +0200 +Subject: pc: Give rhel6.0.0 a kvmclock + +Message-id: <1375201922-6794-10-git-send-email-armbru@redhat.com> +Patchwork-id: 52817 +O-Subject: [RHEL-7 PATCH v3 09/15] pc: Give rhel6.0.0 a kvmclock +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +RHEL-6.0 inherited kvmclock from upstream qemu-kvm. It later made its +way into upstream qemu (commit 0ec329d), and we switched to it in +RHEL-6.2 (commit 17ca2d2). + +Since kvmclock was new in upstream qemu, the commit took care to +enable it only for new machine types. Since it wasn't new in RHEL-6, +the backport dropped that part. + +Drop it in RHEL-7, too. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index c6e30e2..e4fbb08 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1097,7 +1097,7 @@ static void pc_init_rhel600(MachineState *machine) + { + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); +- pc_init1(machine, 1, 0); ++ pc_init_rhel700(machine); + } + + static QEMUMachine pc_machine_rhel600 = { diff --git a/SOURCES/kvm-pc-Haswell-doesn-t-have-rdtscp-on-rhel6-x.patch b/SOURCES/kvm-pc-Haswell-doesn-t-have-rdtscp-on-rhel6-x.patch new file mode 100644 index 0000000..afc8929 --- /dev/null +++ b/SOURCES/kvm-pc-Haswell-doesn-t-have-rdtscp-on-rhel6-x.patch @@ -0,0 +1,35 @@ +From 30a192e4409fcf69b4104b6390a6de1550a5d0dc Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:52 +0200 +Subject: pc: Haswell doesn't have rdtscp on rhel6.x + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-8-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53615 +O-Subject: [RHEL7 PATCH 7/7] pc: Haswell doesn't have rdtscp on rhel6.x +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + +This adds compat code to disable rdtscp on the rhel6.x machine-types, to +match the features found on RHEL-6. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 6a1cc45..1d06c76 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1040,6 +1040,8 @@ static void pc_init_rhel650(MachineState *machine) + 0); + x86_cpu_compat_set_features("SandyBridge", FEAT_8000_0001_EDX, + 0, CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Haswell", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-RHEL-6-don-t-have-RDTSCP.patch b/SOURCES/kvm-pc-RHEL-6-don-t-have-RDTSCP.patch new file mode 100644 index 0000000..a99526c --- /dev/null +++ b/SOURCES/kvm-pc-RHEL-6-don-t-have-RDTSCP.patch @@ -0,0 +1,46 @@ +From a07ff4892ae6e43b8e4b88bbf9796c09bd41aa5f Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 16 Sep 2013 20:39:57 +0200 +Subject: pc: RHEL-6 don't have RDTSCP + +RH-Author: Eduardo Habkost +Message-id: <1379363997-11783-5-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54399 +O-Subject: [RHEL7 PATCH 4/4] pc: RHEL-6 don't have RDTSCP +Bugzilla: 918907 +RH-Acked-by: Bandan Das +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + (RHEL-6-only quirk that is not going to be included upstream) +Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6290888 + +The phenom and Opteron_G[123] CPU models don't have RDTSCP enabled on +RHEL-6, so we have to explicitly disable it on pc_init_rhel650() to keep +compatibility. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 5075187..663e4ff 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1054,6 +1054,16 @@ static void pc_init_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ ++ x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G1", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); ++ + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-RHEL-6-had-x2apic-set-on-Opteron_G-123.patch b/SOURCES/kvm-pc-RHEL-6-had-x2apic-set-on-Opteron_G-123.patch new file mode 100644 index 0000000..6548080 --- /dev/null +++ b/SOURCES/kvm-pc-RHEL-6-had-x2apic-set-on-Opteron_G-123.patch @@ -0,0 +1,42 @@ +From 4a7bdc0ff912b66f57b83de6ee63c96760a84d4c Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 16 Sep 2013 20:39:56 +0200 +Subject: pc: RHEL-6 had x2apic set on Opteron_G[123] + +RH-Author: Eduardo Habkost +Message-id: <1379363997-11783-4-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54401 +O-Subject: [RHEL7 PATCH 3/4] pc: RHEL-6 had x2apic set on Opteron_G[123] +Bugzilla: 918907 +RH-Acked-by: Bandan Das +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +From: Eduardo Habkost + +Bugzilla: 918907 +Upstream status: not applicable + (RHEL-6-only quirk that is not going to be included upstream) +Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6290888 + +The Opteron_G[123] CPU models had x2apic set since they were first added +to RHEL-6, but they don't have it set upstream. We need to explicitly +set it on pc_init_rhel650() to keep compatibility. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 27b6504..5075187 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1050,6 +1050,10 @@ static void pc_init_rhel650(MachineState *machine) + 0, CPUID_EXT2_RDTSCP); + x86_cpu_compat_set_features("Haswell", FEAT_8000_0001_EDX, + 0, CPUID_EXT2_RDTSCP); ++ ++ x86_cpu_compat_set_features("Opteron_G1", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-Remove-PCLMULQDQ-from-Westmere-on-rhel6-x-machine-types.patch b/SOURCES/kvm-pc-Remove-PCLMULQDQ-from-Westmere-on-rhel6-x-machine-types.patch new file mode 100644 index 0000000..47f6cfa --- /dev/null +++ b/SOURCES/kvm-pc-Remove-PCLMULQDQ-from-Westmere-on-rhel6-x-machine-types.patch @@ -0,0 +1,39 @@ +From dc4067b9a00aef49a8f787524ecb993c2344d485 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:50 +0200 +Subject: pc: Remove PCLMULQDQ from Westmere on rhel6.x machine-types + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-6-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53612 +O-Subject: [RHEL7 PATCH 5/7] pc: Remove PCLMULQDQ from Westmere on rhel6.x machine-types +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: commit 56383703c060777fd01aaf8d63d5f46d660e9fb9 + +commit 41cb383f42d0cb51d8e3e25e3ecebc954dd4196f made a guest-visible +change by adding the PCLMULQDQ bit to Westmere without adding +compatibility code to keep the ABI for older machine-types. + +Add the corresponding compat code to the rhel6.x machine-types (like it +was done on upstream commit 56383703c060777fd01aaf8d63d5f46d660e9fb9 for +pc-1.4). + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 141497e..b3dcc21 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1031,6 +1031,7 @@ static void pc_init_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); + x86_cpu_compat_set_features("Westmere", FEAT_8000_0001_EDX, + CPUID_EXT2_FXSR | CPUID_EXT2_MMX | CPUID_EXT2_PAT | + CPUID_EXT2_CMOV | CPUID_EXT2_PGE | CPUID_EXT2_APIC | diff --git a/SOURCES/kvm-pc-Remove-incorrect-rhel6-x-compat-model-value-for.patch b/SOURCES/kvm-pc-Remove-incorrect-rhel6-x-compat-model-value-for.patch new file mode 100644 index 0000000..afa92bf --- /dev/null +++ b/SOURCES/kvm-pc-Remove-incorrect-rhel6-x-compat-model-value-for.patch @@ -0,0 +1,56 @@ +From 067ca8e52297c84e3aa171788c6454eda6c3d1f4 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:47 +0200 +Subject: pc: Remove incorrect rhel6.x compat "model" value for + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-3-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53610 +O-Subject: [RHEL7 PATCH 2/7] pc: Remove incorrect rhel6.x compat "model" value for Conroe/Penryn/Nehalem +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + +The series that introduced the rhel6.x machine-types added compat +"model" values for Conroe, Penryn and Nehalem that were copied from +PC_COMPAT_1_5 but are not applicable to rhel6.x, as the CPU models had +the correct model value since RHEL-6.0 (see RHEL-6 commit +9a2e04fed8d1c4b44c4122b211e236a36a036cc7). + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index d46dfe5..779e76d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1072,26 +1072,14 @@ static QEMUMachine pc_machine_rhel640 = { + PC_RHEL6_4_COMPAT,\ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ + },{\ + .driver = "Penryn-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Penryn-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ + },{\ + .driver = "Nehalem-" TYPE_X86_CPU,\ +- .property = "model",\ +- .value = stringify(2),\ +- },{\ +- .driver = "Nehalem-" TYPE_X86_CPU,\ + .property = "level",\ + .value = stringify(2),\ + },{\ diff --git a/SOURCES/kvm-pc-Replace-upstream-machine-types-by-RHEL-7-types.patch b/SOURCES/kvm-pc-Replace-upstream-machine-types-by-RHEL-7-types.patch new file mode 100644 index 0000000..a27e852 --- /dev/null +++ b/SOURCES/kvm-pc-Replace-upstream-machine-types-by-RHEL-7-types.patch @@ -0,0 +1,111 @@ +From 0171fe37781fac8e8f2af144210050554bd824e1 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Fri, 4 Jul 2014 09:52:35 +0200 +Subject: pc: Replace upstream machine types by RHEL-7 types + +RH-Author: Eduardo Habkost +Message-id: <1372348663-1706-2-git-send-email-ehabkost@redhat.com> +Patchwork-id: 52251 +O-Subject: [PATCH v2 1/3] pc: Replace upstream machine types by RHEL-7 types +Bugzilla: 977864 +RH-Acked-by: Bandan Das +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini + +From: Markus Armbruster + +Bugzilla: 977864 +Upstream status: not applicable + +Existing machine-types are commented-out instead of being deleted, to +help avoid backport conflicts in the future. + +Signed-off-by: Markus Armbruster +[ehabkost: edited patch description] +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 9694f88..ae8b34e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -297,6 +297,7 @@ static void pc_init_pci(MachineState *machine) + pc_init1(machine, 1, 1); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_compat_2_0(MachineState *machine) + { + /* This value depends on the actual DSDT and SSDT compiled into +@@ -919,3 +920,30 @@ static void pc_machine_init(void) + } + + machine_init(pc_machine_init); ++ ++#endif /* Disabled for Red Hat Enterprise Linux */ ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++static void pc_init_rhel700(MachineState *machine) ++{ ++ pc_init_pci(machine); ++} ++ ++static QEMUMachine pc_machine_rhel700 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "pc-i440fx-rhel7.0.0", ++ .alias = "pc", ++ .desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)", ++ .init = pc_init_rhel700, ++ .hot_add_cpu = pc_hot_add_cpu, ++ .max_cpus = 255, ++ .is_default = 1, ++}; ++ ++static void rhel_machine_init(void) ++{ ++ qemu_register_pc_machine(&pc_machine_rhel700); ++} ++ ++machine_init(rhel_machine_init); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index c39ee98..5f271c2 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -278,6 +278,7 @@ static void pc_q35_init(MachineState *machine) + } + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_compat_2_0(MachineState *machine) + { + smbios_legacy_mode = true; +@@ -430,3 +431,29 @@ static void pc_q35_machine_init(void) + } + + machine_init(pc_q35_machine_init); ++ ++#endif /* Disabled for Red Hat Enterprise Linux */ ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++static void pc_q35_init_rhel700(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static QEMUMachine pc_q35_machine_rhel700 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "pc-q35-rhel7.0.0", ++ .alias = "q35", ++ .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)", ++ .init = pc_q35_init_rhel700, ++ .hot_add_cpu = pc_hot_add_cpu, ++ .max_cpus = 255, ++}; ++ ++static void rhel_pc_q35_machine_init(void) ++{ ++ qemu_register_pc_machine(&pc_q35_machine_rhel700); ++} ++ ++machine_init(rhel_pc_q35_machine_init); diff --git a/SOURCES/kvm-pc-SandyBridge-rhel6-x-compat-fixes.patch b/SOURCES/kvm-pc-SandyBridge-rhel6-x-compat-fixes.patch new file mode 100644 index 0000000..9aceac7 --- /dev/null +++ b/SOURCES/kvm-pc-SandyBridge-rhel6-x-compat-fixes.patch @@ -0,0 +1,48 @@ +From 7273820709675377a0cf8a1445f92007e65fa008 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:51 +0200 +Subject: pc: SandyBridge rhel6.x compat fixes + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-7-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53614 +O-Subject: [RHEL7 PATCH 6/7] pc: SandyBridge rhel6.x compat fixes +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + +This patch implements the following changes, to match the SandyBridge +CPU features on RHEL-6: + + * rhel6.3.0 and older don't have tsc-deadline on SandyBridge + (commit 10ce057) + * rhel6.5.0 and older don't have rdtscp on SandyBridge + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index b3dcc21..6a1cc45 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1038,6 +1038,8 @@ static void pc_init_rhel650(MachineState *machine) + CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | + CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, + 0); ++ x86_cpu_compat_set_features("SandyBridge", FEAT_8000_0001_EDX, ++ 0, CPUID_EXT2_RDTSCP); + pc_init_rhel700(machine); + } + +@@ -1123,6 +1125,8 @@ static void pc_init_rhel630(MachineState *machine) + { + x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); + enable_compat_apic_id_mode(); ++ x86_cpu_compat_set_features("SandyBridge", FEAT_1_ECX, ++ 0, CPUID_EXT_TSC_DEADLINE_TIMER); + pc_init_rhel640(machine); + } + diff --git a/SOURCES/kvm-pc-Use-cpu64-rhel6-CPU-model-by-default-on-rhel6-machine-types.patch b/SOURCES/kvm-pc-Use-cpu64-rhel6-CPU-model-by-default-on-rhel6-machine-types.patch new file mode 100644 index 0000000..9fe0337 --- /dev/null +++ b/SOURCES/kvm-pc-Use-cpu64-rhel6-CPU-model-by-default-on-rhel6-machine-types.patch @@ -0,0 +1,38 @@ +From 25f1317dc99267a2e0a47e2f7275398d8b5d2e66 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 25 Mar 2014 16:03:46 +0100 +Subject: pc: Use cpu64-rhel6 CPU model by default on rhel6 machine-types + +RH-Author: Eduardo Habkost +Message-id: <1395763427-31684-2-git-send-email-ehabkost@redhat.com> +Patchwork-id: 58246 +O-Subject: [RHEL7 qemu-kvm PATCH 1/2] pc: Use cpu64-rhel6 CPU model by default on rhel6 machine-types +Bugzilla: 1080170 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Alex Williamson +RH-Acked-by: Bandan Das + +Bugzilla: 1080170 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7250917 +Upstream status: not applicable + +On RHEL-6, cpu64-rhel6 was the default CPU model, so use it as default +on rhel6.* machine-types so we keep the ABI and not break RHEL6->RHEL7 +live-migration. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 1631499..715d55e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1087,6 +1087,9 @@ static QEMUMachine pc_machine_rhel700 = { + static void pc_compat_rhel650(MachineState *machine) + { + pc_compat_rhel700(machine); ++ if (!machine->cpu_model) { ++ machine->cpu_model = "cpu64-rhel6"; ++ } + x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC); + x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC); diff --git a/SOURCES/kvm-pc-add-hot_add_cpu-callback-to-all-machine-types.patch b/SOURCES/kvm-pc-add-hot_add_cpu-callback-to-all-machine-types.patch new file mode 100644 index 0000000..a28235e --- /dev/null +++ b/SOURCES/kvm-pc-add-hot_add_cpu-callback-to-all-machine-types.patch @@ -0,0 +1,83 @@ +From 956bfdc1b90e0d241128ea2463932e2705a8ecf3 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 5 May 2014 20:27:12 +0200 +Subject: pc: add hot_add_cpu callback to all machine types + +RH-Author: Paolo Bonzini +Message-id: <1399321632-26203-1-git-send-email-pbonzini@redhat.com> +Patchwork-id: 58691 +O-Subject: [RHEL 7.0.z qemu-kvm PATCH] pc: add hot_add_cpu callback to all machine types +Bugzilla: 1093411 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Igor Mammedov +RH-Acked-by: Laszlo Ersek + +Bugzilla: 1093411 + +Upstream status: N/A + +Brew build: 7416220 + +Due to the lack of the callback, RHEL6-compatible machine types +failed CPU hotplug with a "not supported" error message. + +However CPU hotplug is supported in RHEL6, albeit with a different +monitor command that we had inherited from qemu-kvm, and for all machine +types. So, add it to all machine types in RHEL7 too. + +Tested locally with a RHEL6.5 guest and -Mrhel6.5.0. + +Signed-off-by: Paolo Bonzini + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 715d55e..67573fe 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1133,6 +1133,7 @@ static QEMUMachine pc_machine_rhel650 = { + .name = "rhel6.5.0", + .desc = "RHEL 6.5.0 PC", + .init = pc_init_rhel650, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_5_COMPAT, +@@ -1181,6 +1182,7 @@ static QEMUMachine pc_machine_rhel640 = { + .name = "rhel6.4.0", + .desc = "RHEL 6.4.0 PC", + .init = pc_init_rhel640, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_4_COMPAT, +@@ -1256,6 +1258,7 @@ static QEMUMachine pc_machine_rhel630 = { + .name = "rhel6.3.0", + .desc = "RHEL 6.3.0 PC", + .init = pc_init_rhel630, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_3_COMPAT, +@@ -1287,6 +1290,7 @@ static QEMUMachine pc_machine_rhel620 = { + .name = "rhel6.2.0", + .desc = "RHEL 6.2.0 PC", + .init = pc_init_rhel620, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_2_COMPAT, +@@ -1359,6 +1363,7 @@ static QEMUMachine pc_machine_rhel610 = { + .name = "rhel6.1.0", + .desc = "RHEL 6.1.0 PC", + .init = pc_init_rhel610, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_1_COMPAT, +@@ -1398,6 +1403,7 @@ static QEMUMachine pc_machine_rhel600 = { + .name = "rhel6.0.0", + .desc = "RHEL 6.0.0 PC", + .init = pc_init_rhel600, ++ .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .compat_props = (GlobalProperty[]) { + PC_RHEL6_0_COMPAT, diff --git a/SOURCES/kvm-pc-drop-virtio-balloon-pci-event_idx-compat-property.patch b/SOURCES/kvm-pc-drop-virtio-balloon-pci-event_idx-compat-property.patch new file mode 100644 index 0000000..a461972 --- /dev/null +++ b/SOURCES/kvm-pc-drop-virtio-balloon-pci-event_idx-compat-property.patch @@ -0,0 +1,60 @@ +From cd6985d95635c2d3dc8a4c7835840212cd082aef Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Tue, 12 Nov 2013 17:10:04 +0100 +Subject: pc: drop virtio-balloon-pci event_idx compat property + +RH-Author: Luiz Capitulino +Message-id: <20131112121004.12eb9431@redhat.com> +Patchwork-id: 55664 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] pc: drop virtio-balloon-pci event_idx compat property +Bugzilla: 1029539 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Juan Quintela + +Bugzilla: 1029539 +Brew-build: https://brewweb.devel.redhat.com/taskinfo?taskID=6564546 + +Due to a bug, RHEL6 has never disabled the virtio-balloon-pci +driver's event_idx property for machine types rhel6.0.0 and +rhel6.1.0. The end result is that migration from RHEL6 to RHEL7 +fails for those machine types. + +The most obvious way to fix this problem is to fix RHEL6 to +really disable the property. But this won't solve the problem +for old RHEL6 binaries. Actually, it will make migration +incompatible between old RHEL6 binaries and newer ones. + +This commit makes the mistake official instead by dropping +the compat property for RHEL7. This fixes migration between +RHEL6 and RHEL7 without adding any new problems. + +Signed-off-by: Luiz Capitulino + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 30a87d4..3704933 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1227,6 +1227,11 @@ static QEMUMachine pc_machine_rhel620 = { + }, + }; + ++/* ++ * NOTE: We don't have the event_idx compat entry for the ++ * virtio-balloon-pci driver because RHEL6 doesn't disable ++ * it either due to a bug (see RHBZ 1029539 fo more info) ++ */ + #define PC_RHEL6_1_COMPAT \ + PC_RHEL6_2_COMPAT,\ + {\ +@@ -1258,10 +1263,6 @@ static QEMUMachine pc_machine_rhel620 = { + .property = "event_idx",\ + .value = "off",\ + },{\ +- .driver = "virtio-balloon-pci",\ +- .property = "event_idx",\ +- .value = "off",\ +- },{\ + .driver = "usb-kbd",\ + .property = "serial",\ + .value = "1",\ diff --git a/SOURCES/kvm-pc-increase-maximal-VCPU-count-to-240.patch b/SOURCES/kvm-pc-increase-maximal-VCPU-count-to-240.patch new file mode 100644 index 0000000..1f6b56b --- /dev/null +++ b/SOURCES/kvm-pc-increase-maximal-VCPU-count-to-240.patch @@ -0,0 +1,53 @@ +From dc62aae4952b2fc6f8778a16bb8dc2d9b636d6fd Mon Sep 17 00:00:00 2001 +From: Radim Krcmar +Date: Thu, 18 Sep 2014 16:29:58 +0200 +Subject: [PATCH 29/32] pc: increase maximal VCPU count to 240 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Message-id: <1411057798-18761-1-git-send-email-rkrcmar@redhat.com> +Patchwork-id: 61299 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH] pc: increase maximal VCPU count to 240 +Bugzilla: 1144089 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Andrew Jones +RH-Acked-by: Eduardo Habkost + +To prevent TCG from going over RHEV KVM's limit in d832249687, we added +another downstream constraint that needs to be bumped. +(forwardport of RHEL7 commit aa6910ca37db66c51b7a9a6431b68f7223b8fd7b) + +RHEV does the limiting differently than RHEL, because all models are +using one template. (See d832249687 for details.) + +There's missing comment (in compare with RHEL version): + +/* KVM can't exceed KVM_SOFT_MAX_VCPUS (arch/x86/include/asm/kvm_host.h) */ + +We have independent ways to limit the VCPU count that need to be +synchronized (ugh) and the main purpose of that comment was to aid +subsequent modifications starting in qemu. + +Signed-off-by: Radim Krčmář +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index d30ff14..c7ef58e 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -511,7 +511,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + #define PC_DEFAULT_MACHINE_OPTIONS \ + PC_COMMON_MACHINE_OPTIONS, \ + .hot_add_cpu = pc_hot_add_cpu, \ +- .max_cpus = 160 ++ .max_cpus = 240 + + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pc-rhel6-compat-enable-S3-S4-for-6-1-and-lower-machine-types.patch b/SOURCES/kvm-pc-rhel6-compat-enable-S3-S4-for-6-1-and-lower-machine-types.patch new file mode 100644 index 0000000..b225c79 --- /dev/null +++ b/SOURCES/kvm-pc-rhel6-compat-enable-S3-S4-for-6-1-and-lower-machine-types.patch @@ -0,0 +1,67 @@ +From 84d62c5bc8c6e55168a6e1ed3b54c19fa0cee8b0 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:07:32 +0200 +Subject: pc: rhel6-compat: enable S3, S4 for 6.1 and lower machine types + +Message-id: <1374235471-27096-3-git-send-email-armbru@redhat.com> +Patchwork-id: 52605 +O-Subject: [RHEL-7 PATCH qemu-kvm 2/2] pc: rhel6-compat: enable S3, S4 for 6.1 and lower machine types +Bugzilla: 980840 +RH-Acked-by: Amit Shah +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Bandan Das +RH-Acked-by: Gleb Natapov + +From: Amit Shah + +We don't advertise S3/S4 support by default since RHEL6.2: + +RHEL6.4 has S3/S4 advertisement disabled by default (can be overriden by + the disable_s3 and disable_s4 properties of the PIIX4). +RHEL6.3 and 6.2 had S3/S4 advertisement disabled by default (can be + overriden by using the alternative bios-pm.bin SeaBIOS image). +RHEL6.1 and 6.0 had S3/S4 advertisement enabled by default. + +We need to ensure we keep that behaviour, so adjust the 6.1 and 6.0 +machine types to allow S3/S4. + +As a side note, migrating a RHEL6.0 or RHEL6.1 VM to a RHEL6.2 or 6.3 +host would have caused a guest-visible change, but we can do better +starting with 6.4, so let's do the right thing now. This, however, has +the potential to cause two guest-visible changes if a VM is migrated +like this: + +RHEL6.1 host --1--> RHEL6.3 host --2--> RHEL6.4 host + +After (1) above, guest will stop seeing S3/S4 advertised. After (2), +S3/S4 will be advertised again. + +Signed-off-by: Amit Shah +Signed-off-by: Michal Novotny +(cherry picked from commit ffc7768db990f0587b84e08e06095ed26f095fde) + +Picked from qemu-kvm-rhel6. + +Conflicts: + hw/pc.c +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e77878f..498fb37 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1161,6 +1161,14 @@ static QEMUMachine pc_machine_rhel620 = { + #define PC_RHEL6_1_COMPAT \ + PC_RHEL6_2_COMPAT,\ + {\ ++ .driver = "PIIX4_PM",\ ++ .property = "disable_s3",\ ++ .value = "0",\ ++ },{\ ++ .driver = "PIIX4_PM",\ ++ .property = "disable_s4",\ ++ .value = "0",\ ++ },{\ + .driver = "qxl",\ + .property = "revision",\ + .value = stringify(2),\ diff --git a/SOURCES/kvm-pc-rhel6-doesn-t-have-APIC-on-pentium-CPU-models.patch b/SOURCES/kvm-pc-rhel6-doesn-t-have-APIC-on-pentium-CPU-models.patch new file mode 100644 index 0000000..8d09bab --- /dev/null +++ b/SOURCES/kvm-pc-rhel6-doesn-t-have-APIC-on-pentium-CPU-models.patch @@ -0,0 +1,44 @@ +From cd8e278cd1b8bdd713838e61b7a9acda30d53ceb Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Mon, 16 Sep 2013 20:39:55 +0200 +Subject: pc: rhel6 doesn't have APIC on pentium* CPU models + +RH-Author: Eduardo Habkost +Message-id: <1379363997-11783-3-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54400 +O-Subject: [RHEL7 PATCH 2/4] pc: rhel6 doesn't have APIC on pentium* CPU models +Bugzilla: 918907 +RH-Acked-by: Bandan Das +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +From: Eduardo Habkost + +Bugzilla: 918907 +Upstream status: not applicable + (pc-0.12 already have CPUID_APIC enabled for almost 4 years) +Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6290888 + +QEMU v0.13 and newer has CPUID_APIC set on pentium, pentium2, and +pentium3 CPU models[1], but v0.12 (and RHEL-6) don't have it. We need to +disable the flag on pc_init_rhel650() to keep compatibility. + +[1] Upstream commit c84bd4f104098861e162be848a00d64c1fa76ed4 + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 950cfc2..27b6504 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1031,6 +1031,10 @@ static QEMUMachine pc_machine_rhel700 = { + + static void pc_init_rhel650(MachineState *machine) + { ++ x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC); ++ x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC); ++ x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC); ++ + x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); diff --git a/SOURCES/kvm-pc-rhel6-x-has-x2apic-present-on-Conroe-Penryn-Nehalem-CPU-models.patch b/SOURCES/kvm-pc-rhel6-x-has-x2apic-present-on-Conroe-Penryn-Nehalem-CPU-models.patch new file mode 100644 index 0000000..5c36b1b --- /dev/null +++ b/SOURCES/kvm-pc-rhel6-x-has-x2apic-present-on-Conroe-Penryn-Nehalem-CPU-models.patch @@ -0,0 +1,38 @@ +From 733f45c8f379e10a13b964dafb787853887f73a4 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:48 +0200 +Subject: pc: rhel6.x has x2apic present on Conroe/Penryn/Nehalem CPU models + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-4-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53613 +O-Subject: [RHEL7 PATCH 3/7] pc: rhel6.x has x2apic present on Conroe/Penryn/Nehalem CPU models +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + +The Conroe/Penryn/Nehalem CPU models all have x2apic enabled on rhel6.x +(added by RHEL-6 commit 19ab65a663cfdfa8365f3ec324af6b0ab26be5a1). Add +compat bits to make sure they are set on the rhel6.x machine-types. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 779e76d..fec4a7d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1027,6 +1027,10 @@ static QEMUMachine pc_machine_rhel700 = { + + static void pc_init_rhel650(MachineState *machine) + { ++ x86_cpu_compat_set_features("Conroe", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-set-compat-CPUID-0x80000001-EDX-bits-on-Westmere-for-rhel6-x.patch b/SOURCES/kvm-pc-set-compat-CPUID-0x80000001-EDX-bits-on-Westmere-for-rhel6-x.patch new file mode 100644 index 0000000..c053e7e --- /dev/null +++ b/SOURCES/kvm-pc-set-compat-CPUID-0x80000001-EDX-bits-on-Westmere-for-rhel6-x.patch @@ -0,0 +1,42 @@ +From b20a41ea788295d0f859265397676d4c3428ca6e Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:49 +0200 +Subject: pc: set compat CPUID[0x80000001].EDX bits on Westmere for rhel6.x + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-5-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53611 +O-Subject: [RHEL7 PATCH 4/7] pc: set compat CPUID[0x80000001].EDX bits on Westmere for rhel6.x +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + +On RHEL-6 the Westmere CPU model has many CPU feature alias bits +incorrectly set on CPUID[0x80000001].EDX. This is a RHEL-6 bug (that +doesn't cause problems because those bits are documented as reserved on +Intel CPUs), but we need to keep exactly the same bits for compatibility +on the rhel6.x machine-types. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index fec4a7d..141497e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1031,6 +1031,12 @@ static void pc_init_rhel650(MachineState *machine) + x86_cpu_compat_set_features("Penryn", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Nehalem", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); ++ x86_cpu_compat_set_features("Westmere", FEAT_8000_0001_EDX, ++ CPUID_EXT2_FXSR | CPUID_EXT2_MMX | CPUID_EXT2_PAT | ++ CPUID_EXT2_CMOV | CPUID_EXT2_PGE | CPUID_EXT2_APIC | ++ CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | ++ CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ 0); + pc_init_rhel700(machine); + } + diff --git a/SOURCES/kvm-pc-set-compat-pmu-property-for-rhel6-x-machine-types.patch b/SOURCES/kvm-pc-set-compat-pmu-property-for-rhel6-x-machine-types.patch new file mode 100644 index 0000000..7615a86 --- /dev/null +++ b/SOURCES/kvm-pc-set-compat-pmu-property-for-rhel6-x-machine-types.patch @@ -0,0 +1,55 @@ +From b7bba36493f13e2656ba83fbf2e330425d958c7a Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Fri, 2 Aug 2013 14:08:53 +0200 +Subject: pc: set compat "pmu" property for rhel6.x machine-types + +RH-Author: Eduardo Habkost +Message-id: <1375452533-12507-4-git-send-email-ehabkost@redhat.com> +Patchwork-id: 52934 +O-Subject: [RHEL-7 PATCH 3/3] pc: set compat "pmu" property for rhel6.x machine-types +Bugzilla: 853101 +RH-Acked-by: Bandan Das +RH-Acked-by: Markus Armbruster +RH-Acked-by: Gleb Natapov + +Bugzilla: 853101 +Upstream status: not applicable + +This adds compatibility values to the rhel6.* machine-types for the +"pmu" property on X86CPU: + + * rhel6.2 and older doesn't have vPMU support + * rhel6.3 has the broken passthrough-mode vPMU enabled + * rhel6.4 and newer have vPMU disabled by default + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 79fbde6..e4e512d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1105,6 +1105,10 @@ static QEMUMachine pc_machine_rhel640 = { + .driver = "virtio-scsi-pci",\ + .property = "param_change",\ + .value = "off",\ ++ },{\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "pmu",\ ++ .value = "on",\ + } + + static void pc_init_rhel630(MachineState *machine) +@@ -1127,7 +1131,12 @@ static QEMUMachine pc_machine_rhel630 = { + }; + + #define PC_RHEL6_2_COMPAT \ +- PC_RHEL6_3_COMPAT ++ PC_RHEL6_3_COMPAT,\ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "pmu",\ ++ .value = "off",\ ++ } + + static void pc_init_rhel620(MachineState *machine) + { diff --git a/SOURCES/kvm-pc-set-level-xlevel-correctly-on-486-qemu32-CPU-models-for-rhel6-x.patch b/SOURCES/kvm-pc-set-level-xlevel-correctly-on-486-qemu32-CPU-models-for-rhel6-x.patch new file mode 100644 index 0000000..7cdb925 --- /dev/null +++ b/SOURCES/kvm-pc-set-level-xlevel-correctly-on-486-qemu32-CPU-models-for-rhel6-x.patch @@ -0,0 +1,43 @@ +From 119cdbaff1348588bd01cf5881157af90580a123 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 20 Aug 2013 15:09:46 +0200 +Subject: pc: set level/xlevel correctly on 486/qemu32 CPU models for rhel6.x + +RH-Author: Eduardo Habkost +Message-id: <1377011392-9336-2-git-send-email-ehabkost@redhat.com> +Patchwork-id: 53609 +O-Subject: [RHEL7 PATCH 1/7] pc: set level/xlevel correctly on 486/qemu32 CPU models for rhel6.x +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Bugzilla: 918907 +Upstream status: not applicable + (Upstream have the new xlevel on all machine-types since v0.13) + +Upstream commit 58012d66dc7323f48e9bad3be6d65a50ed3d76bc changed xlevel +on the "qemu32" CPU model and level on "486", but we need to keep a +compatible value on the rhel6.x machine-types. + +Signed-off-by: Eduardo Habkost + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index b1bc87e..d46dfe5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1015,6 +1015,14 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "AC97",\ + .property = "use_broken_id",\ + .value = stringify(1),\ ++ },{\ ++ .driver = "qemu32-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "486-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(0),\ + } + + static void pc_init_rhel650(MachineState *machine) diff --git a/SOURCES/kvm-pc_piix-disable-CPUID_SEP-for-6-4-0-machine-types-and-below.patch b/SOURCES/kvm-pc_piix-disable-CPUID_SEP-for-6-4-0-machine-types-and-below.patch new file mode 100644 index 0000000..5b56db9 --- /dev/null +++ b/SOURCES/kvm-pc_piix-disable-CPUID_SEP-for-6-4-0-machine-types-and-below.patch @@ -0,0 +1,41 @@ +From 3f0af70bb7b186d425d20b8a1d52f4f7f154816c Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Wed, 7 Aug 2013 17:28:00 +0200 +Subject: pc_piix: disable CPUID_SEP for 6.4.0 machine types and below + +RH-Author: Bandan Das +Message-id: +Patchwork-id: 53052 +O-Subject: [PATCH RHEL-7 qemu-kvm v2] pc_piix: disable CPUID_SEP for 6.4.0 machine types and below +Bugzilla: 960216 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Laszlo Ersek + +Bugzilla : 960216 +Brew : https://brewweb.devel.redhat.com/taskinfo?taskID=6140166 + +With c88f862d9 the SEP flag was disabled for RHEL 6.4 and below +machine types due to a kernel bug. 3af51f9^..8f38a22 enabled it +back again for RHEL 6.5 machine type. This change implements +this rhel 6 compatibility behavior + +Implementation differences : Simply call x86_cpu_compat_set_features, +NULL signifies all applicable CPU models + +v2 : specify correct comment range for rhel 6 commits + +Signed-off-by: Bandan Das + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index e4e512d..b1bc87e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1044,6 +1044,7 @@ static QEMUMachine pc_machine_rhel650 = { + + static void pc_init_rhel640(MachineState *machine) + { ++ x86_cpu_compat_set_features(NULL, FEAT_1_EDX, 0, CPUID_SEP); + pc_init_rhel650(machine); + } + diff --git a/SOURCES/kvm-pc_piix-disable-mixer-for-6-4-0-machine-types-and-below.patch b/SOURCES/kvm-pc_piix-disable-mixer-for-6-4-0-machine-types-and-below.patch new file mode 100644 index 0000000..13e564a --- /dev/null +++ b/SOURCES/kvm-pc_piix-disable-mixer-for-6-4-0-machine-types-and-below.patch @@ -0,0 +1,39 @@ +From 6bb693930b108b0f02a55c30a2856779afaec6af Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Tue, 15 Oct 2013 17:11:01 +0200 +Subject: pc_piix: disable mixer for 6.4.0 machine types and below + +RH-Author: Bandan Das +Message-id: <1381857067-9399-5-git-send-email-bsd@redhat.com> +Patchwork-id: 54952 +O-Subject: [PATCH RHEL-7 qemu-kvm v3 4/5] pc_piix: disable mixer for 6.4.0 machine types and below +Bugzilla: 954195 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Markus Armbruster + +Signed-off-by: Bandan Das + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 663e4ff..05a60a1 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1085,6 +1085,18 @@ static QEMUMachine pc_machine_rhel650 = { + .driver = "virtio-scsi-pci",\ + .property = "vectors",\ + .value = stringify(2),\ ++ },{\ ++ .driver = "hda-micro",\ ++ .property = "mixer",\ ++ .value = "off",\ ++ },{\ ++ .driver = "hda-duplex",\ ++ .property = "mixer",\ ++ .value = "off",\ ++ },{\ ++ .driver = "hda-output",\ ++ .property = "mixer",\ ++ .value = "off",\ + } + + static void pc_init_rhel640(MachineState *machine) diff --git a/SOURCES/kvm-pci-assign-cap-number-of-devices-that-can-be-assigned.patch b/SOURCES/kvm-pci-assign-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..0e7b33b --- /dev/null +++ b/SOURCES/kvm-pci-assign-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,82 @@ +From ae2772a4a070c29d05b872e39809760f404ba439 Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Tue, 3 Dec 2013 20:05:12 +0100 +Subject: pci-assign: cap number of devices that can be assigned + +RH-Author: Bandan Das +Message-id: <1386101113-31560-2-git-send-email-bsd@redhat.com> +Patchwork-id: 55983 +O-Subject: [PATCH RHEL7 qemu-kvm v2 1/2] pci-assign: cap number of devices that can be assigned +Bugzilla: 678368 +RH-Acked-by: Alex Williamson +RH-Acked-by: Marcelo Tosatti +RH-Acked-by: Michael S. Tsirkin + +Legacy device assignment is not supported for RHEL7, nevertheless, +it makes sense to enforce the limit here was well in case we need +to support it in the future. Note that 8 is the limit enforced on +RHEL 6, RHEL 5 too has a static limit of 8 assigned devices. + +Signed-off-by: Bandan Das + +diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c +index de33657..befe763 100644 +--- a/hw/i386/kvm/pci-assign.c ++++ b/hw/i386/kvm/pci-assign.c +@@ -139,8 +139,12 @@ typedef struct AssignedDevice { + MemoryRegion mmio; + char *configfd_name; + int32_t bootindex; ++ QLIST_ENTRY(AssignedDevice) next; + } AssignedDevice; + ++#define MAX_DEV_ASSIGN_CMDLINE 8 ++static QLIST_HEAD(, AssignedDevice) devs = QLIST_HEAD_INITIALIZER(devs); ++ + static void assigned_dev_update_irq_routing(PCIDevice *dev); + + static void assigned_dev_load_option_rom(AssignedDevice *dev); +@@ -1752,8 +1756,9 @@ static void reset_assigned_device(DeviceState *dev) + static int assigned_initfn(struct PCIDevice *pci_dev) + { + AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); ++ AssignedDevice *adev; + uint8_t e_intx; +- int r; ++ int r, i = 0; + Error *local_err = NULL; + + if (!kvm_enabled()) { +@@ -1761,6 +1766,16 @@ static int assigned_initfn(struct PCIDevice *pci_dev) + goto exit_with_error; + } + ++ QLIST_FOREACH(adev, &devs, next) { ++ i++; ++ } ++ ++ if (i >= MAX_DEV_ASSIGN_CMDLINE) { ++ error_setg(&local_err, "pci-assign: Maximum supported assigned devices" ++ " (%d) already attached\n", MAX_DEV_ASSIGN_CMDLINE); ++ goto exit_with_error; ++ } ++ + if (!dev->host.domain && !dev->host.bus && !dev->host.slot && + !dev->host.function) { + error_setg(&local_err, "no host device specified"); +@@ -1830,6 +1845,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev) + goto assigned_out; + } + ++ QLIST_INSERT_HEAD(&devs, dev, next); + assigned_dev_load_option_rom(dev); + + add_boot_device_path(dev->bootindex, &pci_dev->qdev, NULL); +@@ -1853,6 +1869,7 @@ static void assigned_exitfn(struct PCIDevice *pci_dev) + { + AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); + ++ QLIST_REMOVE(dev, next); + deassign_device(dev); + free_assigned_device(dev); + } diff --git a/SOURCES/kvm-pflash_cfi01-fixup-stale-DPRINTF-calls.patch b/SOURCES/kvm-pflash_cfi01-fixup-stale-DPRINTF-calls.patch new file mode 100644 index 0000000..9b53d03 --- /dev/null +++ b/SOURCES/kvm-pflash_cfi01-fixup-stale-DPRINTF-calls.patch @@ -0,0 +1,46 @@ +From e45bb7bfed7d794d13997030c05882f32afc022b Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Tue, 9 Sep 2014 16:04:43 +0200 +Subject: [PATCH 11/32] pflash_cfi01: fixup stale DPRINTF() calls + +Message-id: <1410278684-29754-2-git-send-email-lersek@redhat.com> +Patchwork-id: 60920 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 1/2] pflash_cfi01: fixup stale DPRINTF() calls +Bugzilla: 1139706 +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Stefan Hajnoczi + +Signed-off-by: Laszlo Ersek +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit afeb25f9263e470ad715cab2b79b8965c0519fb7) +--- + hw/block/pflash_cfi01.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/block/pflash_cfi01.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c +index f9507b4..ced937d 100644 +--- a/hw/block/pflash_cfi01.c ++++ b/hw/block/pflash_cfi01.c +@@ -209,11 +209,11 @@ static uint32_t pflash_devid_query(pflash_t *pfl, hwaddr offset) + switch (boff & 0xFF) { + case 0: + resp = pfl->ident0; +- DPRINTF("%s: Manufacturer Code %04x\n", __func__, ret); ++ DPRINTF("%s: Manufacturer Code %04x\n", __func__, resp); + break; + case 1: + resp = pfl->ident1; +- DPRINTF("%s: Device ID Code %04x\n", __func__, ret); ++ DPRINTF("%s: Device ID Code %04x\n", __func__, resp); + break; + default: + DPRINTF("%s: Read Device Information offset=%x\n", __func__, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pflash_cfi01-write-flash-contents-to-bdrv-on-incomin.patch b/SOURCES/kvm-pflash_cfi01-write-flash-contents-to-bdrv-on-incomin.patch new file mode 100644 index 0000000..a0b10dd --- /dev/null +++ b/SOURCES/kvm-pflash_cfi01-write-flash-contents-to-bdrv-on-incomin.patch @@ -0,0 +1,106 @@ +From abc23dfed1e85c27fdb5f3e1a395a058c68498ef Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Tue, 9 Sep 2014 16:04:44 +0200 +Subject: [PATCH 12/32] pflash_cfi01: write flash contents to bdrv on incoming + migration + +Message-id: <1410278684-29754-3-git-send-email-lersek@redhat.com> +Patchwork-id: 60921 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 2/2] pflash_cfi01: write flash contents to bdrv on incoming migration +Bugzilla: 1139706 +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Stefan Hajnoczi + +A drive that backs a pflash device is special: +- it is very small, +- its entire contents are kept in a RAMBlock at all times, covering the + guest-phys address range that provides the guest's view of the emulated + flash chip. + +The pflash device model keeps the drive (the host-side file) and the +guest-visible flash contents in sync. When migrating the guest, the +guest-visible flash contents (the RAMBlock) is migrated by default, but on +the target host, the drive (the host-side file) remains in full sync with +the RAMBlock only if: +- the source and target hosts share the storage underlying the pflash + drive, +- or the migration requests full or incremental block migration too, which + then covers all drives. + +Due to the special nature of pflash drives, the following scenario makes +sense as well: +- no full nor incremental block migration, covering all drives, alongside + the base migration (justified eg. by shared storage for "normal" (big) + drives), +- non-shared storage for pflash drives. + +In this case, currently only those portions of the flash drive are updated +on the target disk that the guest reprograms while running on the target +host. + +In order to restore accord, dump the entire flash contents to the bdrv in +a post_load() callback. + +- The read-only check follows the other call-sites of pflash_update(); +- both "pfl->ro" and pflash_update() reflect / consider the case when + "pfl->bs" is NULL; +- the total size of the flash device is calculated as in + pflash_cfi01_realize(). + +When using shared storage, or requesting full or incremental block +migration along with the normal migration, the patch should incur a +harmless rewrite from the target side. + +It is assumed that, on the target host, RAM is loaded ahead of the call to +pflash_post_load(). + +Suggested-by: Paolo Bonzini +Signed-off-by: Laszlo Ersek +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 4c0cfc72b31a79f737a64ebbe0411e4b83e25771) +--- + hw/block/pflash_cfi01.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/block/pflash_cfi01.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c +index ced937d..edffc1c 100644 +--- a/hw/block/pflash_cfi01.c ++++ b/hw/block/pflash_cfi01.c +@@ -94,10 +94,13 @@ struct pflash_t { + void *storage; + }; + ++static int pflash_post_load(void *opaque, int version_id); ++ + static const VMStateDescription vmstate_pflash = { + .name = "pflash_cfi01", + .version_id = 1, + .minimum_version_id = 1, ++ .post_load = pflash_post_load, + .fields = (VMStateField[]) { + VMSTATE_UINT8(wcycle, pflash_t), + VMSTATE_UINT8(cmd, pflash_t), +@@ -983,3 +986,14 @@ MemoryRegion *pflash_cfi01_get_memory(pflash_t *fl) + { + return &fl->mem; + } ++ ++static int pflash_post_load(void *opaque, int version_id) ++{ ++ pflash_t *pfl = opaque; ++ ++ if (!pfl->ro) { ++ DPRINTF("%s: updating bdrv for %s\n", __func__, pfl->name); ++ pflash_update(pfl, 0, pfl->sector_len * pfl->nb_blocs); ++ } ++ return 0; ++} +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qdev-monitor-include-QOM-properties-in-device-FOO-he.patch b/SOURCES/kvm-qdev-monitor-include-QOM-properties-in-device-FOO-he.patch new file mode 100644 index 0000000..95a08ed --- /dev/null +++ b/SOURCES/kvm-qdev-monitor-include-QOM-properties-in-device-FOO-he.patch @@ -0,0 +1,113 @@ +From 1c5c50193147854ca3ae844a4b85813d191d5510 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Tue, 2 Sep 2014 19:32:34 +0200 +Subject: [PATCH 04/32] qdev-monitor: include QOM properties in -device FOO, + help output + +Message-id: <1409686354-5978-1-git-send-email-stefanha@redhat.com> +Patchwork-id: 60814 +O-Subject: [PATCH] qdev-monitor: include QOM properties in -device FOO, help output +Bugzilla: 1133736 +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Fam Zheng + +Bugzilla: 1133736 +Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7907194 + +Update -device FOO,help to include QOM properties in addition to qdev +properties. Devices are gradually adding more QOM properties that are +not reflected as qdev properties. + +It is important to report all device properties since management tools +like libvirt use this information (and device-list-properties QMP) to +detect the presence of QEMU features. + +This patch reuses the device-list-properties QMP machinery to avoid code +duplication. + +Reported-by: Cole Robinson +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Eric Blake +Tested-by: Cole Robinson +(cherry picked from commit ef523587da4f213ca17133a90402d0815ecf08ee) +Signed-off-by: Stefan Hajnoczi +--- + qdev-monitor.c | 40 +++++++++++++++++----------------------- + 1 file changed, 17 insertions(+), 23 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + qdev-monitor.c | 40 +++++++++++++++++----------------------- + 1 file changed, 17 insertions(+), 23 deletions(-) + +diff --git a/qdev-monitor.c b/qdev-monitor.c +index f87f3d8..5fe5e75 100644 +--- a/qdev-monitor.c ++++ b/qdev-monitor.c +@@ -182,9 +182,10 @@ static const char *find_typename_by_alias(const char *alias) + + int qdev_device_help(QemuOpts *opts) + { ++ Error *local_err = NULL; + const char *driver; +- Property *prop; +- ObjectClass *klass; ++ DevicePropertyInfoList *prop_list; ++ DevicePropertyInfoList *prop; + + driver = qemu_opt_get(opts, "driver"); + if (driver && is_help_option(driver)) { +@@ -196,35 +197,28 @@ int qdev_device_help(QemuOpts *opts) + return 0; + } + +- klass = object_class_by_name(driver); +- if (!klass) { ++ if (!object_class_by_name(driver)) { + const char *typename = find_typename_by_alias(driver); + + if (typename) { + driver = typename; +- klass = object_class_by_name(driver); + } + } + +- if (!object_class_dynamic_cast(klass, TYPE_DEVICE)) { +- return 0; ++ prop_list = qmp_device_list_properties(driver, &local_err); ++ if (!prop_list) { ++ error_printf("%s\n", error_get_pretty(local_err)); ++ error_free(local_err); ++ return 1; + } +- do { +- for (prop = DEVICE_CLASS(klass)->props; prop && prop->name; prop++) { +- /* +- * TODO Properties without a parser are just for dirty hacks. +- * qdev_prop_ptr is the only such PropertyInfo. It's marked +- * for removal. This conditional should be removed along with +- * it. +- */ +- if (!prop->info->set) { +- continue; /* no way to set it, don't show */ +- } +- error_printf("%s.%s=%s\n", driver, prop->name, +- prop->info->legacy_name ?: prop->info->name); +- } +- klass = object_class_get_parent(klass); +- } while (klass != object_class_by_name(TYPE_DEVICE)); ++ ++ for (prop = prop_list; prop; prop = prop->next) { ++ error_printf("%s.%s=%s\n", driver, ++ prop->value->name, ++ prop->value->type); ++ } ++ ++ qapi_free_DevicePropertyInfoList(prop_list); + return 1; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-Remove-lsi53c895a-tests-from-051.patch b/SOURCES/kvm-qemu-iotests-Remove-lsi53c895a-tests-from-051.patch new file mode 100644 index 0000000..7af3b05 --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-Remove-lsi53c895a-tests-from-051.patch @@ -0,0 +1,178 @@ +From 5f9e8c46b9438e9290f65d21c7db0c789639fe84 Mon Sep 17 00:00:00 2001 +From: Max Reitz +Date: Wed, 18 Sep 2013 10:31:44 +0200 +Subject: qemu-iotests: Remove lsi53c895a tests from 051 + +Message-id: <1379499002-5231-7-git-send-email-mreitz@redhat.com> +Patchwork-id: 54437 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 6/6] qemu-iotests: Remove lsi53c895a tests from 051 +Bugzilla: 1006959 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Fam Zheng +RH-Acked-by: Kevin Wolf + +BZ: 1006959 +Upstream: N/A, RHEL-only + +LSI SCSI is disabled in RHEL7, the corresponding checks in 051 are +therefore bound to fail. This patch removes these checks and their +expected output from test 051. + +Signed-off-by: Max Reitz + +diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 +index a41334e..5357374 100755 +--- a/tests/qemu-iotests/051 ++++ b/tests/qemu-iotests/051 +@@ -131,19 +131,19 @@ echo + + run_qemu -drive if=floppy + run_qemu -drive if=ide,media=cdrom +-run_qemu -drive if=scsi,media=cdrom ++#run_qemu -drive if=scsi,media=cdrom + + run_qemu -drive if=ide + run_qemu -drive if=virtio +-run_qemu -drive if=scsi ++#run_qemu -drive if=scsi + + run_qemu -drive if=none,id=disk -device ide-cd,drive=disk +-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk ++#run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk + + run_qemu -drive if=none,id=disk -device ide-drive,drive=disk + run_qemu -drive if=none,id=disk -device ide-hd,drive=disk +-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk +-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk ++#run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk ++#run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk + + echo + echo === Read-only === +@@ -151,19 +151,19 @@ echo + + run_qemu -drive file="$TEST_IMG",if=floppy,readonly=on + run_qemu -drive file="$TEST_IMG",if=ide,media=cdrom,readonly=on +-run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on ++#run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on + + run_qemu -drive file="$TEST_IMG",if=ide,readonly=on + run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on +-run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on ++#run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on + + run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk +-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk ++#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk + + run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk + run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk +-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk +-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk ++#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk ++#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk + + echo + echo === Cache modes === +diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out +index d7b0f50..3ea7998 100644 +--- a/tests/qemu-iotests/051.out ++++ b/tests/qemu-iotests/051.out +@@ -104,10 +104,6 @@ Testing: -drive if=ide,media=cdrom + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) qququiquit + +-Testing: -drive if=scsi,media=cdrom +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- + Testing: -drive if=ide + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) QEMU_PROG: Device needs media, but drive is empty +@@ -120,20 +116,10 @@ QEMU X.Y.Z monitor - type 'help' for more information + QEMU_PROG: -drive if=virtio: Device initialization failed. + QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized + +-Testing: -drive if=scsi +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty +-QEMU_PROG: Device initialization failed. +-QEMU_PROG: Initialization of device lsi53c895a failed +- + Testing: -drive if=none,id=disk -device ide-cd,drive=disk + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) qququiquit + +-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- + Testing: -drive if=none,id=disk -device ide-drive,drive=disk + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty +@@ -146,19 +132,6 @@ QEMU X.Y.Z monitor - type 'help' for more information + QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed. + QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized + +-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty +-QEMU_PROG: -device scsi-disk,drive=disk: Device initialization failed. +-QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized +- +-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty +-QEMU_PROG: -device scsi-hd,drive=disk: Device initialization failed. +-QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized +- +- + === Read-only === + + Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on +@@ -169,10 +142,6 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) qququiquit + +-Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- + Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) QEMU_PROG: Can't use a read-only drive +@@ -183,18 +152,10 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) qququiquit + +-Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- + Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-cd,drive=disk + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) qququiquit + +-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- + Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk + QEMU X.Y.Z monitor - type 'help' for more information + (qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive +@@ -207,15 +168,6 @@ QEMU X.Y.Z monitor - type 'help' for more information + QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed. + QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized + +-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- +-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk +-QEMU X.Y.Z monitor - type 'help' for more information +-(qemu) qququiquit +- +- + === Cache modes === + + Testing: -drive media=cdrom,cache=none diff --git a/SOURCES/kvm-qemu-kvm-Fix-migration-from-older-version-due-to-i8254-changes.patch b/SOURCES/kvm-qemu-kvm-Fix-migration-from-older-version-due-to-i8254-changes.patch new file mode 100644 index 0000000..aa916f8 --- /dev/null +++ b/SOURCES/kvm-qemu-kvm-Fix-migration-from-older-version-due-to-i8254-changes.patch @@ -0,0 +1,64 @@ +From 9e78c7b16a7d6ce25cbf40affbc309b90b913a2b Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:01:44 +0200 +Subject: qemu-kvm: Fix migration from older version due to i8254 changes + +Message-id: <1375201922-6794-2-git-send-email-armbru@redhat.com> +Patchwork-id: 52815 +O-Subject: [RHEL-7 PATCH v3 01/15] qemu-kvm: Fix migration from older version due to i8254 changes +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +Old qemu-kvm already contained an equivalent field to i8254's +irq_disabled. We therefore have to remove upstream's version restriction +here to allow migration from older versions. + +Signed-off-by: Jan Kiszka +Signed-off-by: Avi Kivity +(cherry picked from commit 81bdec908fb2be0ccaff1d4ee67956c509e440ad) + +Conflicts: + hw/i8254.c + +Picked from qemu-kvm-1.1. + +qemu-kvm-0.11.0 commit f69b3e2 added PITState member flags, added it +to migration section "i8254", and bumped its version to 2. + +qemu v0.12.0 commit 5122b43 ported i8254 to VMState, and also bumped +section version to 2. Version 2 now means different things in qemu +and qemu-kvm. + +This got merged into qemu-kvm-0.12.0 in commit f4f2edc. The merge +added migration of flags to qemu's code. Yet another version of +version 2. This is what we got in RHEL-6. + +qemu v1.1.0 commit ce967e2 added PITState member irq_disabled, +included it in migration section "i8254", and bumped its version to 3. +Because qemu's irq_disabled is compatible with qemu-kvm's flags, +qemu's version 3 is migration compatible with the latest instance of +qemu-kvm's version 2. + +When this got merged into qemu-kvm-1.1.0, it changed qemu-kvm's +version 2 to no longer include flags / irq_disabled. Commit 81bdec9 +reverted the change of version 2. + +We need to do the same to enable incoming migration from RHEL-6. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c +index 07345f6..649c7ee 100644 +--- a/hw/timer/i8254_common.c ++++ b/hw/timer/i8254_common.c +@@ -266,7 +266,7 @@ static const VMStateDescription vmstate_pit_common = { + .pre_save = pit_dispatch_pre_save, + .post_load = pit_dispatch_post_load, + .fields = (VMStateField[]) { +- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), ++ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */ + VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, + vmstate_pit_channel, PITChannelState), + VMSTATE_INT64(channels[0].next_transition_time, diff --git a/SOURCES/kvm-qemu_loadvm_state-shadow-SeaBIOS-for-VM-incoming-from-RHEL-6-host.patch b/SOURCES/kvm-qemu_loadvm_state-shadow-SeaBIOS-for-VM-incoming-from-RHEL-6-host.patch new file mode 100644 index 0000000..98fc7bc --- /dev/null +++ b/SOURCES/kvm-qemu_loadvm_state-shadow-SeaBIOS-for-VM-incoming-from-RHEL-6-host.patch @@ -0,0 +1,144 @@ +From 960075802f1c30e656c118916c7ea32de0fa8563 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 17 Apr 2014 11:13:59 +0200 +Subject: qemu_loadvm_state(): shadow SeaBIOS for VM incoming from RHEL-6 host + +RH-Author: Laszlo Ersek +Message-id: <1397733239-8835-1-git-send-email-lersek@redhat.com> +Patchwork-id: 58498 +O-Subject: [RHEL-7.0 0day qemu-kvm PATCH v2] qemu_loadvm_state(): shadow SeaBIOS for VM incoming from RHEL-6 host +Bugzilla: 1103579 +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Eduardo Habkost + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1027565 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=7352678 + +RHEL-only patch. + +SeaBIOS's shadowing logic has no effect on "pc.ram" (only on "pc.bios" and +"pc.rom") when it runs on the RHEL-6 emulator. When such a guest is +migrated to the RHEL-7 emulator, where the PAM registers actually work, +these two UMBs under 1MB simply disappear from the guest's view, breaking +reboot and S3 resume. + +Tested extensively by QE. + +Signed-off-by: Laszlo Ersek + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index c4e1af4..6f8420d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1155,6 +1155,7 @@ static void pc_compat_rhel650(MachineState *machine) + rom_file_has_mr = false; + has_acpi_build = false; + gigabyte_align = false; ++ shadow_bios_after_incoming = true; + } + + static void pc_init_rhel650(MachineState *machine) +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 4faa8af..a369c3b 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -89,6 +89,7 @@ void qemu_savevm_state_complete(QEMUFile *f); + void qemu_savevm_state_cancel(void); + uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size); + int qemu_loadvm_state(QEMUFile *f); ++extern bool shadow_bios_after_incoming; + + /* SLIRP */ + void do_info_slirp(Monitor *mon); +diff --git a/savevm.c b/savevm.c +index e19ae0a..41495bc 100644 +--- a/savevm.c ++++ b/savevm.c +@@ -51,6 +51,8 @@ + #define ARP_PTYPE_IP 0x0800 + #define ARP_OP_REQUEST_REV 0x3 + ++bool shadow_bios_after_incoming; ++ + static int announce_self_create(uint8_t *buf, + uint8_t *mac_addr) + { +@@ -878,6 +880,63 @@ typedef struct LoadStateEntry { + int version_id; + } LoadStateEntry; + ++static void shadow_bios(void) ++{ ++ RAMBlock *block, *ram, *oprom, *bios; ++ size_t one_meg, oprom_size, bios_size; ++ uint8_t *cd_seg_host, *ef_seg_host; ++ ++ ram = NULL; ++ oprom = NULL; ++ bios = NULL; ++ QTAILQ_FOREACH(block, &ram_list.blocks, next) { ++ if (strcmp("pc.ram", block->idstr) == 0) { ++ assert(ram == NULL); ++ ram = block; ++ } else if (strcmp("pc.rom", block->idstr) == 0) { ++ assert(oprom == NULL); ++ oprom = block; ++ } else if (strcmp("pc.bios", block->idstr) == 0) { ++ assert(bios == NULL); ++ bios = block; ++ } ++ } ++ assert(ram != NULL); ++ assert(oprom != NULL); ++ assert(bios != NULL); ++ assert(memory_region_is_ram(ram->mr)); ++ assert(memory_region_is_ram(oprom->mr)); ++ assert(memory_region_is_ram(bios->mr)); ++ assert(int128_eq(ram->mr->size, int128_make64(ram->length))); ++ assert(int128_eq(oprom->mr->size, int128_make64(oprom->length))); ++ assert(int128_eq(bios->mr->size, int128_make64(bios->length))); ++ ++ one_meg = 1024 * 1024; ++ oprom_size = 128 * 1024; ++ bios_size = 128 * 1024; ++ assert(ram->length >= one_meg); ++ assert(oprom->length == oprom_size); ++ assert(bios->length == bios_size); ++ ++ ef_seg_host = memory_region_get_ram_ptr(ram->mr) + (one_meg - bios_size); ++ cd_seg_host = ef_seg_host - oprom_size; ++ ++ /* This is a crude hack, but we must distinguish a rhel6.x.0 machtype guest ++ * coming in from a RHEL-6 emulator (where shadowing has had no effect on ++ * "pc.ram") from a similar guest coming in from a RHEL-7 emulator (where ++ * shadowing has worked). In the latter case we must not trample the live ++ * SeaBIOS variables in "pc.ram". ++ */ ++ if (buffer_is_zero(ef_seg_host, bios_size)) { ++ fprintf(stderr, "copying E and F segments from pc.bios to pc.ram\n"); ++ memcpy(ef_seg_host, memory_region_get_ram_ptr(bios->mr), bios_size); ++ } ++ if (buffer_is_zero(cd_seg_host, oprom_size)) { ++ fprintf(stderr, "copying C and D segments from pc.rom to pc.ram\n"); ++ memcpy(cd_seg_host, memory_region_get_ram_ptr(oprom->mr), oprom_size); ++ } ++} ++ + int qemu_loadvm_state(QEMUFile *f) + { + QLIST_HEAD(, LoadStateEntry) loadvm_handlers = +@@ -982,6 +1041,13 @@ int qemu_loadvm_state(QEMUFile *f) + } + } + ++ /* Supplement SeaBIOS's shadowing now, because it was useless when the ++ * incoming VM started on the RHEL-6 emulator. ++ */ ++ if (shadow_bios_after_incoming) { ++ shadow_bios(); ++ } ++ + cpu_synchronize_all_post_init(); + + ret = 0; diff --git a/SOURCES/kvm-qga-move-logfiles-to-new-directory-for-easier-SELinux-labeling-RHEL.patch b/SOURCES/kvm-qga-move-logfiles-to-new-directory-for-easier-SELinux-labeling-RHEL.patch new file mode 100644 index 0000000..44eabe6 --- /dev/null +++ b/SOURCES/kvm-qga-move-logfiles-to-new-directory-for-easier-SELinux-labeling-RHEL.patch @@ -0,0 +1,11 @@ +--- a/scripts/qemu-guest-agent/fsfreeze-hook ++++ b/scripts/qemu-guest-agent/fsfreeze-hook +@@ -7,7 +7,7 @@ + # "freeze" argument before the filesystem is frozen. And for fsfreeze-thaw + # request, it is issued with "thaw" argument after filesystem is thawed. + +-LOGFILE=/var/log/qemu-ga.fsfreeze-hook.log ++LOGFILE=/var/log/qemu-ga/fsfreeze-hook.log + + # Check whether file $1 is a backup or rpm-generated file and should be ignored + is_ignored_file() { diff --git a/SOURCES/kvm-qmp-add-error-reason-to-the-BLOCK_IO_ERROR-event.patch b/SOURCES/kvm-qmp-add-error-reason-to-the-BLOCK_IO_ERROR-event.patch new file mode 100644 index 0000000..43d7065 --- /dev/null +++ b/SOURCES/kvm-qmp-add-error-reason-to-the-BLOCK_IO_ERROR-event.patch @@ -0,0 +1,148 @@ +From 1a2fe5a329ffe4b89dcd5c27c8f53ff87a28702b Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Wed, 9 Jul 2014 14:31:51 +0200 +Subject: qmp: add error reason to the BLOCK_IO_ERROR event + +Message-id: <1404916312-27953-3-git-send-email-lcapitulino@redhat.com> +Patchwork-id: 59729 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH 2/3] qmp: add error reason to the BLOCK_IO_ERROR event +Bugzilla: 1116772 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Eric Blake +RH-Acked-by: Laszlo Ersek + +This commit forward ports the following RHEL-7.0 commit to RHEL-7.1: + + commit 771a3a333eb0c9299a69a78ddb9c4181850b827d + Author: Laszlo Ersek + Date: Thu Nov 21 16:27:18 2013 +0100 + + error reason in BLOCK_IO_ERROR / BLOCK_JOB_ERROR events (RHEL 6->7 fwd) + +I had to redo the work because now events use the QAPI, but it +was straightforward. + +There's one significant difference though: this commit does not +extend the BLOCK_JOB_ERROR event as did the RHEL-7.0 commit. The +reason is that this extension was supposed to be used only by vdsm +and I don't think there's a requirement to have the extension +in BLOCK_JOB_ERROR too. Let's not spread it. + +Signed-off-by: Luiz Capitulino + +diff --git a/block.c b/block.c +index 8cf519b..aab65d9 100644 +--- a/block.c ++++ b/block.c +@@ -3596,6 +3596,21 @@ BlockErrorAction bdrv_get_error_action(BlockDriverState *bs, bool is_read, int e + } + } + ++/* https://bugzilla.redhat.com/show_bug.cgi?id=1116772 */ ++static RHEL7BlockErrorReason get_rhel7_error_reason(int error) ++{ ++ switch (error) { ++ case ENOSPC: ++ return RHEL7_BLOCK_ERROR_REASON_ENOSPC; ++ case EPERM: ++ return RHEL7_BLOCK_ERROR_REASON_EPERM; ++ case EIO: ++ return RHEL7_BLOCK_ERROR_REASON_EIO; ++ default: ++ return RHEL7_BLOCK_ERROR_REASON_EOTHER; ++ } ++} ++ + /* This is done by device models because, while the block layer knows + * about the error, it does not know whether an operation comes from + * the device or the block layer (from a job, for example). +@@ -3603,7 +3618,10 @@ BlockErrorAction bdrv_get_error_action(BlockDriverState *bs, bool is_read, int e + void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, + bool is_read, int error) + { ++ RHEL7BlockErrorReason res; ++ + assert(error >= 0); ++ res = get_rhel7_error_reason(error); + + if (action == BLOCK_ERROR_ACTION_STOP) { + /* First set the iostatus, so that "info block" returns an iostatus +@@ -3624,13 +3642,13 @@ void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, + qapi_event_send_block_io_error(bdrv_get_device_name(bs), + is_read ? IO_OPERATION_TYPE_READ : + IO_OPERATION_TYPE_WRITE, +- action, &error_abort); ++ action, res, &error_abort); + qemu_system_vmstop_request(RUN_STATE_IO_ERROR); + } else { + qapi_event_send_block_io_error(bdrv_get_device_name(bs), + is_read ? IO_OPERATION_TYPE_READ : + IO_OPERATION_TYPE_WRITE, +- action, &error_abort); ++ action, res, &error_abort); + } + } + +diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt +index d759d19..40c2917 100644 +--- a/docs/qmp/qmp-events.txt ++++ b/docs/qmp/qmp-events.txt +@@ -63,13 +63,20 @@ Data: + "ignore": error has been ignored + "report": error has been reported to the device + "stop": the VM is going to stop because of the error ++- "__com.redhat_reason": error reason, this is a RHEL7 extension, it's one of ++ the following (json-string): ++ "eio": errno EIO ++ "eperm": errno EPERM ++ "enospc": errno ENOSPC ++ "eother": any other errno (other than EIO, EPERM, ENOSPC) + + Example: + + { "event": "BLOCK_IO_ERROR", + "data": { "device": "ide0-hd1", + "operation": "write", +- "action": "stop" }, ++ "action": "stop", ++ "__com.redhat_reason": "enospc" }, + "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } + + Note: If action is "stop", a STOP event will eventually follow the +diff --git a/qapi/block-core.json b/qapi/block-core.json +index e378653..404059b 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -1496,6 +1496,13 @@ + { 'enum': 'BlockErrorAction', + 'data': [ 'ignore', 'report', 'stop' ] } + ++## ++# @RHEL7BlockErrorReason ++# ++# Block I/O error reason ++## ++{ 'enum': 'RHEL7BlockErrorReason', ++ 'data': [ 'enospc', 'eperm', 'eio', 'eother' ] } + + ## + # @BLOCK_IMAGE_CORRUPTED +@@ -1533,6 +1540,8 @@ + # + # @action: action that has been taken + # ++# @__com.redhat_reason: error reason (RHEL7 vendor extension) ++# + # Note: If action is "stop", a STOP event will eventually follow the + # BLOCK_IO_ERROR event + # +@@ -1540,7 +1549,8 @@ + ## + { 'event': 'BLOCK_IO_ERROR', + 'data': { 'device': 'str', 'operation': 'IoOperationType', +- 'action': 'BlockErrorAction' } } ++ 'action': 'BlockErrorAction', ++ '__com.redhat_reason': 'RHEL7BlockErrorReason' } } + + ## + # @BLOCK_JOB_COMPLETED diff --git a/SOURCES/kvm-qmp-improve-debuggability-of-BLOCK_IO_ERROR-event.patch b/SOURCES/kvm-qmp-improve-debuggability-of-BLOCK_IO_ERROR-event.patch new file mode 100644 index 0000000..a5135e5 --- /dev/null +++ b/SOURCES/kvm-qmp-improve-debuggability-of-BLOCK_IO_ERROR-event.patch @@ -0,0 +1,151 @@ +From d6b3fb3db9409f62de3735f967b46fb23e97fda2 Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Wed, 9 Jul 2014 14:31:52 +0200 +Subject: qmp: improve debuggability of BLOCK_IO_ERROR event + +Message-id: <1404916312-27953-4-git-send-email-lcapitulino@redhat.com> +Patchwork-id: 59730 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH 3/3] qmp: improve debuggability of BLOCK_IO_ERROR event +Bugzilla: 1116772 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Eric Blake +RH-Acked-by: Laszlo Ersek + +This commit forward ports the following RHEL-7.0 commit to RHEL-7.1: + + commit bfea65d6f229fd65c78ae4daaddf0d0711d0aedd + Author: Laszlo Ersek + Date: Thu Nov 21 16:27:19 2013 +0100 + + improve debuggability of BLOCK_IO_ERROR / BLOCK_JOB_ERROR (RHEL 6->7 fwd) + +I had to redo the work because now events use the QAPI, but it +was straightforward. + +There's one significant difference though: this commit does not +extend the BLOCK_JOB_ERROR event as did the RHEL-7.0 commit. The +reason is that the original requirement was to have this only on +the BLOCK_IO_ERROR event. Let's not spread it unless we're asked to. + +Signed-off-by: Luiz Capitulino + +diff --git a/block.c b/block.c +index aab65d9..f1b1cd4 100644 +--- a/block.c ++++ b/block.c +@@ -3611,6 +3611,13 @@ static RHEL7BlockErrorReason get_rhel7_error_reason(int error) + } + } + ++static void get_rhel7_error_debug_info(RHEL7BlockErrorDebugInfo *info, ++ int error) ++{ ++ info->q_errno = error; ++ info->message = strerror(error); ++} ++ + /* This is done by device models because, while the block layer knows + * about the error, it does not know whether an operation comes from + * the device or the block layer (from a job, for example). +@@ -3619,9 +3626,14 @@ void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, + bool is_read, int error) + { + RHEL7BlockErrorReason res; ++ RHEL7BlockErrorDebugInfo info; + + assert(error >= 0); + res = get_rhel7_error_reason(error); ++ get_rhel7_error_debug_info(&info, error); ++ ++ fprintf(stderr, "block I/O error in device '%s': %s (%d)\n", ++ bdrv_get_device_name(bs), info.message, (int) info.q_errno); + + if (action == BLOCK_ERROR_ACTION_STOP) { + /* First set the iostatus, so that "info block" returns an iostatus +@@ -3642,13 +3654,13 @@ void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, + qapi_event_send_block_io_error(bdrv_get_device_name(bs), + is_read ? IO_OPERATION_TYPE_READ : + IO_OPERATION_TYPE_WRITE, +- action, res, &error_abort); ++ action, res, &info, &error_abort); + qemu_system_vmstop_request(RUN_STATE_IO_ERROR); + } else { + qapi_event_send_block_io_error(bdrv_get_device_name(bs), + is_read ? IO_OPERATION_TYPE_READ : + IO_OPERATION_TYPE_WRITE, +- action, res, &error_abort); ++ action, res, &info, &error_abort); + } + } + +diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt +index 40c2917..c9dec63 100644 +--- a/docs/qmp/qmp-events.txt ++++ b/docs/qmp/qmp-events.txt +@@ -69,6 +69,11 @@ Data: + "eperm": errno EPERM + "enospc": errno ENOSPC + "eother": any other errno (other than EIO, EPERM, ENOSPC) ++- "__com.redhat_debug_info": RHEL7 extension containing debug information for ++ humans, applications should NOT read any ++ information from this member (json-object): ++ - "errno": errno value (json-int) ++ - "message": error message returned by strerror() (json-string) + + Example: + +@@ -76,7 +81,10 @@ Example: + "data": { "device": "ide0-hd1", + "operation": "write", + "action": "stop", +- "__com.redhat_reason": "enospc" }, ++ "__com.redhat_reason": "enospc", ++ "__com.redhat_debug_info": { ++ "message": "No space left on device", ++ "errno": 28 } } + "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } + + Note: If action is "stop", a STOP event will eventually follow the +diff --git a/qapi/block-core.json b/qapi/block-core.json +index 404059b..706c5d9 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -1505,6 +1505,17 @@ + 'data': [ 'enospc', 'eperm', 'eio', 'eother' ] } + + ## ++# @RHEL7BlockErrorDebugInfo ++# ++# Debug information for a block I/O error ++# ++# @message: error message returned by strerror() ++# @errno: errno value ++## ++{ 'type': 'RHEL7BlockErrorDebugInfo', ++ 'data': { 'message': 'str', 'errno': 'int' } } ++ ++## + # @BLOCK_IMAGE_CORRUPTED + # + # Emitted when a disk image is being marked corrupt +@@ -1542,6 +1553,10 @@ + # + # @__com.redhat_reason: error reason (RHEL7 vendor extension) + # ++# @__com.redhat_debug_info: debug information for humans, applications ++# should NOT read any information from this ++# member (RHEL7 vendor extension) ++# + # Note: If action is "stop", a STOP event will eventually follow the + # BLOCK_IO_ERROR event + # +@@ -1550,7 +1565,8 @@ + { 'event': 'BLOCK_IO_ERROR', + 'data': { 'device': 'str', 'operation': 'IoOperationType', + 'action': 'BlockErrorAction', +- '__com.redhat_reason': 'RHEL7BlockErrorReason' } } ++ '__com.redhat_reason': 'RHEL7BlockErrorReason', ++ '__com.redhat_debug_info': 'RHEL7BlockErrorDebugInfo' } } + + ## + # @BLOCK_JOB_COMPLETED diff --git a/SOURCES/kvm-qxl-set-revision-to-1-for-rhel6-0-0.patch b/SOURCES/kvm-qxl-set-revision-to-1-for-rhel6-0-0.patch new file mode 100644 index 0000000..bc32fe1 --- /dev/null +++ b/SOURCES/kvm-qxl-set-revision-to-1-for-rhel6-0-0.patch @@ -0,0 +1,48 @@ +From 150b68f2c5037adba24b7b0b7ef3f4087d2b5387 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:04:20 +0200 +Subject: qxl: set revision to 1 for rhel6.0.0 + +Message-id: <1375201922-6794-9-git-send-email-armbru@redhat.com> +Patchwork-id: 52818 +O-Subject: [RHEL-7 PATCH v3 08/15] qxl: set revision to 1 for rhel6.0.0 +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +From: Gerd Hoffmann + +bugzilla: #893344 - info qtree mismatch +upstream: No (rhel6.0.0 spice code base predates upstream merge, + so this compat property isn't relevant there). + +Signed-off-by: Gerd Hoffmann +Signed-off-by: Michal Novotny +(cherry picked from commit 69f07de9ed3678198578fe036da202cbbca3f312) + +Conflicts: + hw/pc.c + +Picked from qemu-kvm-rhel6. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3c9c4a5..c6e30e2 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1034,11 +1034,11 @@ static QEMUMachine pc_machine_rhel700 = { + },{\ + .driver = "qxl",\ + .property = "revision",\ +- .value = stringify(3),\ ++ .value = stringify(1),\ + },{\ + .driver = "qxl-vga",\ + .property = "revision",\ +- .value = stringify(3),\ ++ .value = stringify(1),\ + },{\ + .driver = "VGA",\ + .property = "mmio",\ diff --git a/SOURCES/kvm-rbd-Only-look-for-qemu-specific-copy-of-librbd-so-1.patch b/SOURCES/kvm-rbd-Only-look-for-qemu-specific-copy-of-librbd-so-1.patch new file mode 100644 index 0000000..0db6016 --- /dev/null +++ b/SOURCES/kvm-rbd-Only-look-for-qemu-specific-copy-of-librbd-so-1.patch @@ -0,0 +1,39 @@ +From bde9375fac3dbdac12c5dc31255e4123ea0ba4d6 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 31 Oct 2013 12:13:14 +0100 +Subject: rbd: Only look for qemu-specific copy of librbd.so.1 + +RH-Author: Kevin Wolf +Message-id: <1383221595-24285-3-git-send-email-kwolf@redhat.com> +Patchwork-id: 55184 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/3] rbd: Only look for qemu-specific copy of librbd.so.1 +Bugzilla: 989608 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 989608 +Upstream status: n/a +Downstream status: Forward ported from RHEL 6 + +For non-technical reasons, we don't want to pick up a random librbd that +may be installed for other reasons on this system, but only a librbd +that was specificially installed in order to consciously extend qemu. + +So change the gmodule_open() argument to an absolute path. + +Signed-off-by: Kevin Wolf + +diff --git a/block/rbd.c b/block/rbd.c +index 8fdd04d..75db2e7 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -1056,7 +1056,7 @@ static int qemu_rbd_load_libs(void) + return -1; + } + +- librbd_handle = g_module_open("librbd.so.1", 0); ++ librbd_handle = g_module_open("/usr/lib64/qemu/librbd.so.1", 0); + if (!librbd_handle) { + error_report("error loading librbd: %s", g_module_error()); + return -1; diff --git a/SOURCES/kvm-rbd-link-and-load-librbd-dynamically.patch b/SOURCES/kvm-rbd-link-and-load-librbd-dynamically.patch new file mode 100644 index 0000000..38316bf --- /dev/null +++ b/SOURCES/kvm-rbd-link-and-load-librbd-dynamically.patch @@ -0,0 +1,590 @@ +From d46654d71226df0989d21a519bf13ac8680dc06e Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 31 Oct 2013 12:13:13 +0100 +Subject: rbd: link and load librbd dynamically + +RH-Author: Kevin Wolf +Message-id: <1383221595-24285-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 55183 +O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/3] rbd: link and load librbd dynamically +Bugzilla: 989608 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 989608 +Upstream status: Rejected +Downstream status: Forward ported from RHEL 6 + +This is the downstream-only part that gets us rid of the build-time +dependency on librbd and loads it dynamically when using an image. +It is based on a patch submitted to qemu-devel and archived as +http://lists.gnu.org/archive/html/qemu-devel/2013-04/msg01814.html + +For the forward-port to RHEL 7, I decided to implement the review +suggestions from RHEL 6 to move the function pointers out of a separate +struct to the top level, so that callers don't have to be changed +compared to upstream. This should also reduce merge conflicts in future +forward-ports. + +Note that this is not much more than compile tested; the real testing +will be done by Inktank as soon as they can access RHEL 7. + +Original commit message follows: + +This allows the rbd block driver to detect symbols in the installed +version of librbd, and enable or disable features appropriately. This +obviates the #ifdefs regarding librbd versions. + +Loading librbd dynamically also makes the rbd block driver easier to +install and package, since it removes the dependency on librbd at +build time. + +Add structures containing the necessary function pointer signatures +and types from librbd, and fill them in the first time the rbd module +is used. Use glib's g_module interface so we don't preclude future +portability, and don't have to deal with odd dlopen behavior directly. + +Internally, librbd and some libraries it depends on use C++ templates, +which mean that they each contain a defined weak symbol for their +definition. Due to the way the linker resolves duplicate symbols, the +libraries loaded by librbd end up using the template definitions from +librbd, creating a circular dependency. This means that once librbd is +loaded, it won't be unloaded. Changing this behavior might work with a +Sun ld, but there doesn't seem to be a portable (or even working with +GNU ld) way to hide these C++ symbols correctly. Instead, never unload +librbd, and explicitly make it resident. + +Signed-off-by: Josh Durgin +Signed-off-by: Kevin Wolf + +diff --git a/block/Makefile.objs b/block/Makefile.objs +index fd88c03..908c966 100644 +--- a/block/Makefile.objs ++++ b/block/Makefile.objs +@@ -15,7 +15,7 @@ block-obj-y += nbd.o nbd-client.o sheepdog.o + block-obj-$(CONFIG_LIBISCSI) += iscsi.o + block-obj-$(CONFIG_LIBNFS) += nfs.o + block-obj-$(CONFIG_CURL) += curl.o +-block-obj-$(CONFIG_RBD) += rbd.o ++block-obj-y += rbd.o + block-obj-$(CONFIG_GLUSTERFS) += gluster.o + block-obj-$(CONFIG_LIBSSH2) += ssh.o + endif +diff --git a/block/rbd.c b/block/rbd.c +index 2b797d3..8fdd04d 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -11,13 +11,14 @@ + * GNU GPL, version 2 or (at your option) any later version. + */ + ++#include + #include + + #include "qemu-common.h" + #include "qemu/error-report.h" + #include "block/block_int.h" + +-#include ++#include "rbd_types.h" + + /* + * When specifying the image filename use: +@@ -44,13 +45,6 @@ + * leading "\". + */ + +-/* rbd_aio_discard added in 0.1.2 */ +-#if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 2) +-#define LIBRBD_SUPPORTS_DISCARD +-#else +-#undef LIBRBD_SUPPORTS_DISCARD +-#endif +- + #define OBJ_MAX_SIZE (1UL << OBJ_DEFAULT_OBJ_ORDER) + + #define RBD_MAX_CONF_NAME_SIZE 128 +@@ -102,6 +96,10 @@ typedef struct BDRVRBDState { + char *snap; + } BDRVRBDState; + ++static bool librbd_loaded; ++static GModule *librbd_handle; ++ ++static int qemu_rbd_load_libs(void); + static int qemu_rbd_next_tok(char *dst, int dst_len, + char *src, char delim, + const char *name, +@@ -313,6 +311,10 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp) + return -EINVAL; + } + ++ if (qemu_rbd_load_libs() < 0) { ++ return -EIO; ++ } ++ + /* Read out options */ + bytes = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0); + objsize = qemu_opt_get_size_del(opts, BLOCK_OPT_CLUSTER_SIZE, 0); +@@ -458,6 +460,10 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + goto failed_opts; + } + ++ if (qemu_rbd_load_libs() < 0) { ++ return -EIO; ++ } ++ + clientname = qemu_rbd_parse_clientname(conf, clientname_buf); + r = rados_create(&s->cluster, clientname); + if (r < 0) { +@@ -586,28 +592,6 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSCB *rcb) + qemu_bh_schedule(acb->bh); + } + +-static int rbd_aio_discard_wrapper(rbd_image_t image, +- uint64_t off, +- uint64_t len, +- rbd_completion_t comp) +-{ +-#ifdef LIBRBD_SUPPORTS_DISCARD +- return rbd_aio_discard(image, off, len, comp); +-#else +- return -ENOTSUP; +-#endif +-} +- +-static int rbd_aio_flush_wrapper(rbd_image_t image, +- rbd_completion_t comp) +-{ +-#ifdef LIBRBD_SUPPORTS_AIO_FLUSH +- return rbd_aio_flush(image, comp); +-#else +- return -ENOTSUP; +-#endif +-} +- + static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, + int64_t sector_num, + QEMUIOVector *qiov, +@@ -668,10 +652,10 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, + r = rbd_aio_read(s->image, off, size, buf, c); + break; + case RBD_AIO_DISCARD: +- r = rbd_aio_discard_wrapper(s->image, off, size, c); ++ r = rbd_aio_discard(s->image, off, size, c); + break; + case RBD_AIO_FLUSH: +- r = rbd_aio_flush_wrapper(s->image, c); ++ r = rbd_aio_flush(s->image, c); + break; + default: + r = -EINVAL; +@@ -714,7 +698,6 @@ static BlockDriverAIOCB *qemu_rbd_aio_writev(BlockDriverState *bs, + RBD_AIO_WRITE); + } + +-#ifdef LIBRBD_SUPPORTS_AIO_FLUSH + static BlockDriverAIOCB *qemu_rbd_aio_flush(BlockDriverState *bs, + BlockDriverCompletionFunc *cb, + void *opaque) +@@ -722,19 +705,14 @@ static BlockDriverAIOCB *qemu_rbd_aio_flush(BlockDriverState *bs, + return rbd_start_aio(bs, 0, NULL, 0, cb, opaque, RBD_AIO_FLUSH); + } + +-#else +- + static int qemu_rbd_co_flush(BlockDriverState *bs) + { +-#if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1) +- /* rbd_flush added in 0.1.1 */ + BDRVRBDState *s = bs->opaque; +- return rbd_flush(s->image); +-#else ++ if (rbd_flush) { ++ return rbd_flush(s->image); ++ } + return 0; +-#endif + } +-#endif + + static int qemu_rbd_getinfo(BlockDriverState *bs, BlockDriverInfo *bdi) + { +@@ -892,7 +870,6 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, + return snap_count; + } + +-#ifdef LIBRBD_SUPPORTS_DISCARD + static BlockDriverAIOCB* qemu_rbd_aio_discard(BlockDriverState *bs, + int64_t sector_num, + int nb_sectors, +@@ -902,7 +879,6 @@ static BlockDriverAIOCB* qemu_rbd_aio_discard(BlockDriverState *bs, + return rbd_start_aio(bs, sector_num, NULL, nb_sectors, cb, opaque, + RBD_AIO_DISCARD); + } +-#endif + + static QemuOptsList qemu_rbd_create_opts = { + .name = "rbd-create-opts", +@@ -938,16 +914,9 @@ static BlockDriver bdrv_rbd = { + + .bdrv_aio_readv = qemu_rbd_aio_readv, + .bdrv_aio_writev = qemu_rbd_aio_writev, +- +-#ifdef LIBRBD_SUPPORTS_AIO_FLUSH + .bdrv_aio_flush = qemu_rbd_aio_flush, +-#else + .bdrv_co_flush_to_disk = qemu_rbd_co_flush, +-#endif +- +-#ifdef LIBRBD_SUPPORTS_DISCARD + .bdrv_aio_discard = qemu_rbd_aio_discard, +-#endif + + .bdrv_snapshot_create = qemu_rbd_snap_create, + .bdrv_snapshot_delete = qemu_rbd_snap_remove, +@@ -960,4 +929,153 @@ static void bdrv_rbd_init(void) + bdrv_register(&bdrv_rbd); + } + ++typedef struct LibSymbol { ++ const char *name; ++ gpointer *addr; ++} LibSymbol; ++ ++static int qemu_rbd_set_functions(GModule *lib, const LibSymbol *funcs) ++{ ++ int i = 0; ++ while (funcs[i].name) { ++ const char *name = funcs[i].name; ++ if (!g_module_symbol(lib, name, funcs[i].addr)) { ++ error_report("%s could not be loaded from librbd or librados: %s", ++ name, g_module_error()); ++ return -1; ++ } ++ ++i; ++ } ++ return 0; ++} ++ ++/* ++ * Set function pointers for basic librados and librbd ++ * functions that have always been present in these libraries. ++ */ ++static int qemu_rbd_set_mandatory_functions(void) ++{ ++ LibSymbol symbols[] = { ++ {"rados_create", ++ (gpointer *) &rados_create}, ++ {"rados_connect", ++ (gpointer *) &rados_connect}, ++ {"rados_shutdown", ++ (gpointer *) &rados_shutdown}, ++ {"rados_conf_read_file", ++ (gpointer *) &rados_conf_read_file}, ++ {"rados_conf_set", ++ (gpointer *) &rados_conf_set}, ++ {"rados_ioctx_create", ++ (gpointer *) &rados_ioctx_create}, ++ {"rados_ioctx_destroy", ++ (gpointer *) &rados_ioctx_destroy}, ++ {"rbd_create", ++ (gpointer *) &rbd_create}, ++ {"rbd_open", ++ (gpointer *) &rbd_open}, ++ {"rbd_close", ++ (gpointer *) &rbd_close}, ++ {"rbd_resize", ++ (gpointer *) &rbd_resize}, ++ {"rbd_stat", ++ (gpointer *) &rbd_stat}, ++ {"rbd_snap_list", ++ (gpointer *) &rbd_snap_list}, ++ {"rbd_snap_list_end", ++ (gpointer *) &rbd_snap_list_end}, ++ {"rbd_snap_create", ++ (gpointer *) &rbd_snap_create}, ++ {"rbd_snap_remove", ++ (gpointer *) &rbd_snap_remove}, ++ {"rbd_snap_rollback", ++ (gpointer *) &rbd_snap_rollback}, ++ {"rbd_aio_write", ++ (gpointer *) &rbd_aio_write}, ++ {"rbd_aio_read", ++ (gpointer *) &rbd_aio_read}, ++ {"rbd_aio_create_completion", ++ (gpointer *) &rbd_aio_create_completion}, ++ {"rbd_aio_get_return_value", ++ (gpointer *) &rbd_aio_get_return_value}, ++ {"rbd_aio_release", ++ (gpointer *) &rbd_aio_release}, ++ {NULL} ++ }; ++ ++ if (qemu_rbd_set_functions(librbd_handle, symbols) < 0) { ++ return -1; ++ } ++ ++ return 0; ++} ++ ++/* ++ * Detect whether the installed version of librbd ++ * supports newer functionality, and enable or disable ++ * it appropriately in bdrv_rbd. ++ */ ++static void qemu_rbd_set_optional_functions(void) ++{ ++ if (g_module_symbol(librbd_handle, "rbd_flush", ++ (gpointer *) &rbd_flush)) { ++ bdrv_rbd.bdrv_aio_flush = NULL; ++ bdrv_rbd.bdrv_co_flush_to_disk = qemu_rbd_co_flush; ++ } else { ++ rbd_flush = NULL; ++ bdrv_rbd.bdrv_co_flush_to_disk = NULL; ++ } ++ ++ if (g_module_symbol(librbd_handle, "rbd_aio_flush", ++ (gpointer *) &rbd_aio_flush)) { ++ bdrv_rbd.bdrv_co_flush_to_disk = NULL; ++ bdrv_rbd.bdrv_aio_flush = qemu_rbd_aio_flush; ++ } else { ++ rbd_aio_flush = NULL; ++ bdrv_rbd.bdrv_aio_flush = NULL; ++ } ++ ++ if (g_module_symbol(librbd_handle, "rbd_aio_discard", ++ (gpointer *) &rbd_aio_discard)) { ++ bdrv_rbd.bdrv_aio_discard = qemu_rbd_aio_discard; ++ } else { ++ rbd_aio_discard = NULL; ++ bdrv_rbd.bdrv_aio_discard = NULL; ++ } ++} ++ ++static int qemu_rbd_load_libs(void) ++{ ++ if (librbd_loaded) { ++ return 0; ++ } ++ ++ if (!g_module_supported()) { ++ error_report("modules are not supported on this platform: %s", ++ g_module_error()); ++ return -1; ++ } ++ ++ librbd_handle = g_module_open("librbd.so.1", 0); ++ if (!librbd_handle) { ++ error_report("error loading librbd: %s", g_module_error()); ++ return -1; ++ } ++ ++ /* ++ * Due to c++ templates used in librbd/librados and their ++ * dependencies, and linker duplicate trimming rules, closing ++ * librbd would leave it mapped. Make this explicit. ++ */ ++ g_module_make_resident(librbd_handle); ++ ++ if (qemu_rbd_set_mandatory_functions() < 0) { ++ return -1; ++ } ++ qemu_rbd_set_optional_functions(); ++ librbd_loaded = true; ++ ++ return 0; ++} ++ + block_init(bdrv_rbd_init); +diff --git a/block/rbd_types.h b/block/rbd_types.h +new file mode 100644 +index 0000000..f327cb4 +--- /dev/null ++++ b/block/rbd_types.h +@@ -0,0 +1,91 @@ ++/* ++ * Types and signatures for librados and librbd ++ * ++ * Copyright (C) 2013 Inktank Storage Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, see . ++ */ ++ ++#ifndef QEMU_BLOCK_RBD_TYPES_H ++#define QEMU_BLOCK_RBD_TYPES_H ++ ++/* types from librados used by the rbd block driver */ ++ ++typedef void *rados_t; ++typedef void *rados_ioctx_t; ++ ++static int (*rados_create)(rados_t *cluster, const char * const id); ++static int (*rados_connect)(rados_t cluster); ++static void (*rados_shutdown)(rados_t cluster); ++static int (*rados_conf_read_file)(rados_t cluster, const char *path); ++static int (*rados_conf_set)(rados_t cluster, const char *option, ++ const char *value); ++static int (*rados_ioctx_create)(rados_t cluster, const char *pool_name, ++ rados_ioctx_t *ioctx); ++static void (*rados_ioctx_destroy)(rados_ioctx_t io); ++ ++/* types from librbd used by the rbd block driver*/ ++ ++typedef void *rbd_image_t; ++typedef void *rbd_completion_t; ++typedef void (*rbd_callback_t)(rbd_completion_t cb, void *arg); ++ ++typedef struct { ++ uint64_t id; ++ uint64_t size; ++ const char *name; ++} rbd_snap_info_t; ++ ++#define RBD_MAX_IMAGE_NAME_SIZE 96 ++#define RBD_MAX_BLOCK_NAME_SIZE 24 ++ ++typedef struct { ++ uint64_t size; ++ uint64_t obj_size; ++ uint64_t num_objs; ++ int order; ++ char block_name_prefix[RBD_MAX_BLOCK_NAME_SIZE]; ++ int64_t parent_pool; ++ char parent_name[RBD_MAX_IMAGE_NAME_SIZE]; ++} rbd_image_info_t; ++ ++static int (*rbd_create)(rados_ioctx_t io, const char *name, uint64_t size, ++ int *order); ++static int (*rbd_open)(rados_ioctx_t io, const char *name, rbd_image_t *image, ++ const char *snap_name); ++static int (*rbd_close)(rbd_image_t image); ++static int (*rbd_resize)(rbd_image_t image, uint64_t size); ++static int (*rbd_stat)(rbd_image_t image, rbd_image_info_t *info, ++ size_t infosize); ++static int (*rbd_snap_list)(rbd_image_t image, rbd_snap_info_t *snaps, ++ int *max_snaps); ++static void (*rbd_snap_list_end)(rbd_snap_info_t *snaps); ++static int (*rbd_snap_create)(rbd_image_t image, const char *snapname); ++static int (*rbd_snap_remove)(rbd_image_t image, const char *snapname); ++static int (*rbd_snap_rollback)(rbd_image_t image, const char *snapname); ++static int (*rbd_aio_write)(rbd_image_t image, uint64_t off, size_t len, ++ const char *buf, rbd_completion_t c); ++static int (*rbd_aio_read)(rbd_image_t image, uint64_t off, size_t len, ++ char *buf, rbd_completion_t c); ++static int (*rbd_aio_discard)(rbd_image_t image, uint64_t off, uint64_t len, ++ rbd_completion_t c); ++static int (*rbd_aio_create_completion)(void *cb_arg, ++ rbd_callback_t complete_cb, ++ rbd_completion_t *c); ++static ssize_t (*rbd_aio_get_return_value)(rbd_completion_t c); ++static void (*rbd_aio_release)(rbd_completion_t c); ++static int (*rbd_flush)(rbd_image_t image); ++static int (*rbd_aio_flush)(rbd_image_t image, rbd_completion_t c); ++ ++#endif +diff --git a/configure b/configure +index f7685b5..f552374 100755 +--- a/configure ++++ b/configure +@@ -305,7 +305,6 @@ qom_cast_debug="yes" + trace_backends="nop" + trace_file="trace" + spice="" +-rbd="" + smartcard_nss="" + libusb="" + usb_redir="" +@@ -1029,10 +1028,6 @@ for opt do + ;; + --enable-glx) glx="yes" + ;; +- --disable-rbd) rbd="no" +- ;; +- --enable-rbd) rbd="yes" +- ;; + --disable-xfsctl) xfs="no" + ;; + --enable-xfsctl) xfs="yes" +@@ -1357,7 +1352,6 @@ Advanced options (experts only): + Default:trace- + --disable-spice disable spice + --enable-spice enable spice +- --enable-rbd enable building the rados block device (rbd) + --disable-libiscsi disable iscsi support + --enable-libiscsi enable iscsi support + --disable-libnfs disable nfs support +@@ -2691,10 +2685,7 @@ if test "$mingw32" = yes; then + else + glib_req_ver=2.12 + fi +-glib_modules=gthread-2.0 +-if test "$modules" = yes; then +- glib_modules="$glib_modules gmodule-2.0" +-fi ++glib_modules="gthread-2.0 gmodule-2.0" + + for i in $glib_modules; do + if $pkg_config --atleast-version=$glib_req_ver $i; then +@@ -2835,29 +2826,6 @@ if compile_prog "" "$pthread_lib" ; then + fi + + ########################################## +-# rbd probe +-if test "$rbd" != "no" ; then +- cat > $TMPC < +-#include +-int main(void) { +- rados_t cluster; +- rados_create(&cluster, NULL); +- return 0; +-} +-EOF +- rbd_libs="-lrbd -lrados" +- if compile_prog "" "$rbd_libs" ; then +- rbd=yes +- else +- if test "$rbd" = "yes" ; then +- feature_not_found "rados block device" "Install librbd/ceph devel" +- fi +- rbd=no +- fi +-fi +- +-########################################## + # libssh2 probe + min_libssh2_version=1.2.8 + if test "$libssh2" != "no" ; then +@@ -4236,7 +4204,6 @@ echo "spice support $spice ($spice_protocol_version/$spice_server_version)" + else + echo "spice support $spice" + fi +-echo "rbd support $rbd" + echo "xfsctl support $xfs" + echo "nss used $smartcard_nss" + echo "libusb $libusb" +@@ -4629,11 +4596,6 @@ fi + if test "$qom_cast_debug" = "yes" ; then + echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak + fi +-if test "$rbd" = "yes" ; then +- echo "CONFIG_RBD=m" >> $config_host_mak +- echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak +- echo "RBD_LIBS=$rbd_libs" >> $config_host_mak +-fi + + echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak + if test "$coroutine_pool" = "yes" ; then diff --git a/SOURCES/kvm-rh-machine-types-xhci-PCIe-endpoint-migration-compat.patch b/SOURCES/kvm-rh-machine-types-xhci-PCIe-endpoint-migration-compat.patch new file mode 100644 index 0000000..b514d7a --- /dev/null +++ b/SOURCES/kvm-rh-machine-types-xhci-PCIe-endpoint-migration-compat.patch @@ -0,0 +1,43 @@ +From ad59da63c012affa839c57cd84911461c01d93b8 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 11 Sep 2014 12:25:45 +0200 +Subject: [PATCH 15/32] rh machine types: xhci PCIe endpoint migration + compatibility + +Message-id: <1410438345-22590-3-git-send-email-dgilbert@redhat.com> +Patchwork-id: 61009 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 2/2] rh machine types: xhci PCIe endpoint migration compatibility +Bugzilla: 1138579 +RH-Acked-by: Alex Williamson +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Michael S. Tsirkin + +From: "Dr. David Alan Gilbert" + +Enable the 'xhci PCIe endpoint migration compatibility fix' for +rhel7.0 compatibility. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index aa6ddc4..d30ff14 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -546,6 +546,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .property = "superspeed-ports-first",\ + .value = "off",\ + },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "force-pcie-endcap",\ ++ .value = "on",\ ++ },{\ + .driver = "pci-serial",\ + .property = "prog_if",\ + .value = stringify(0),\ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-rhel-Add-rhel7.1.0-machine-types.patch b/SOURCES/kvm-rhel-Add-rhel7.1.0-machine-types.patch new file mode 100644 index 0000000..b316888 --- /dev/null +++ b/SOURCES/kvm-rhel-Add-rhel7.1.0-machine-types.patch @@ -0,0 +1,219 @@ +From c6c148f7c5a1c7731c42eb1d98df0171deda6552 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 8 Sep 2014 09:23:13 +0200 +Subject: [PATCH 09/32] rhel: Add rhel7.1.0 machine types + +Message-id: <1410168194-26833-2-git-send-email-armbru@redhat.com> +Patchwork-id: 60898 +O-Subject: [PATCH v3 RHEV-7.1 qemu-kvm-rhev 1/2] rhel: Add rhel7.1.0 machine types +Bugzilla: 1093023 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Paolo Bonzini + +Clean slate, except keep the CPU RDTSCP tweaks, because they aren't +just for backward compatibility, they're for avoiding issues that +still need to be addressed upstream. + +Signed-off-by: Markus Armbruster +--- +Bugzilla: 1093023 + + hw/i386/pc_piix.c | 58 ++++++++++++++++++++++++++++++++++++++----------------- + hw/i386/pc_q35.c | 53 ++++++++++++++++++++++++++++++++++++-------------- + 2 files changed, 78 insertions(+), 33 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 56 ++++++++++++++++++++++++++++++++++++++----------------- + hw/i386/pc_q35.c | 53 +++++++++++++++++++++++++++++++++++++--------------- + 2 files changed, 77 insertions(+), 32 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 38018f6..855c951 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -924,8 +924,46 @@ machine_init(pc_machine_init); + + /* Red Hat Enterprise Linux machine types */ + ++static void pc_compat_rhel710(MachineState *machine) ++{ ++ /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it ++ * on AMD CPU models. ++ */ ++ x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++} ++ ++static void pc_init_rhel710(MachineState *machine) ++{ ++ pc_compat_rhel710(machine); ++ pc_init_pci(machine); ++} ++ ++static QEMUMachine pc_machine_rhel710 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "pc-i440fx-rhel7.1.0", ++ .alias = "pc", ++ .desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)", ++ .init = pc_init_rhel710, ++ .is_default = 1, ++ .default_machine_opts = "firmware=bios-256k.bin", ++ .compat_props = (GlobalProperty[]) { ++ { /* end of list */ } ++ }, ++}; ++ + static void pc_compat_rhel700(MachineState *machine) + { ++ pc_compat_rhel710(machine); ++ + /* Upstream enables it for everyone, we're a little more selective */ + x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC); + +@@ -940,20 +978,6 @@ static void pc_compat_rhel700(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + +- /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it +- * on AMD CPU models. +- */ +- x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- + legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ + smbios_legacy_mode = true; + has_reserved_memory = false; +@@ -963,16 +987,13 @@ static void pc_init_rhel700(MachineState *machine) + { + pc_compat_rhel700(machine); + pc_init_pci(machine); +- + } + + static QEMUMachine pc_machine_rhel700 = { + PC_DEFAULT_MACHINE_OPTIONS, + .name = "pc-i440fx-rhel7.0.0", +- .alias = "pc", + .desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)", + .init = pc_init_rhel700, +- .is_default = 1, + .default_machine_opts = "firmware=bios-256k.bin", + .compat_props = (GlobalProperty[]) { + PC_RHEL7_0_COMPAT, +@@ -1428,6 +1449,7 @@ static QEMUMachine pc_machine_rhel600 = { + + static void rhel_machine_init(void) + { ++ qemu_register_pc_machine(&pc_machine_rhel710); + qemu_register_pc_machine(&pc_machine_rhel700); + qemu_register_pc_machine(&pc_machine_rhel650); + qemu_register_pc_machine(&pc_machine_rhel640); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index bed13a2..098151e 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -435,8 +435,45 @@ machine_init(pc_q35_machine_init); + + /* Red Hat Enterprise Linux machine types */ + ++static void pc_q35_compat_rhel710(MachineState *machine) ++{ ++ /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it ++ * on AMD CPU models. ++ */ ++ x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++ x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, ++ CPUID_EXT2_RDTSCP); ++} ++ ++static void pc_q35_init_rhel710(MachineState *machine) ++{ ++ pc_q35_compat_rhel710(machine); ++ pc_q35_init(machine); ++} ++ ++static QEMUMachine pc_q35_machine_rhel710 = { ++ PC_DEFAULT_MACHINE_OPTIONS, ++ .name = "pc-q35-rhel7.1.0", ++ .alias = "q35", ++ .desc = "RHEL-7.1.0 PC (Q35 + ICH9, 2009)", ++ .init = pc_q35_init_rhel710, ++ .default_machine_opts = "firmware=bios-256k.bin", ++ .compat_props = (GlobalProperty[]) { ++ { /* end of list */ } ++ }, ++}; ++ + static void pc_q35_compat_rhel700(MachineState *machine) + { ++ pc_q35_compat_rhel710(machine); ++ + /* Upstream enables it for everyone, we're a little more selective */ + x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC); + +@@ -451,20 +488,6 @@ static void pc_q35_compat_rhel700(MachineState *machine) + x86_cpu_compat_set_features("Opteron_G4", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + x86_cpu_compat_set_features("Opteron_G5", FEAT_1_ECX, CPUID_EXT_X2APIC, 0); + +- /* KVM can't expose RDTSCP on AMD CPUs, so there's no point in enabling it +- * on AMD CPU models. +- */ +- x86_cpu_compat_set_features("phenom", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G2", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G4", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- x86_cpu_compat_set_features("Opteron_G5", FEAT_8000_0001_EDX, 0, +- CPUID_EXT2_RDTSCP); +- + smbios_legacy_mode = true; + has_reserved_memory = false; + } +@@ -478,7 +501,6 @@ static void pc_q35_init_rhel700(MachineState *machine) + static QEMUMachine pc_q35_machine_rhel700 = { + PC_DEFAULT_MACHINE_OPTIONS, + .name = "pc-q35-rhel7.0.0", +- .alias = "q35", + .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)", + .init = pc_q35_init_rhel700, + .default_machine_opts = "firmware=bios-256k.bin", +@@ -490,6 +512,7 @@ static QEMUMachine pc_q35_machine_rhel700 = { + + static void rhel_pc_q35_machine_init(void) + { ++ qemu_register_pc_machine(&pc_q35_machine_rhel710); + qemu_register_pc_machine(&pc_q35_machine_rhel700); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch b/SOURCES/kvm-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch new file mode 100644 index 0000000..9321901 --- /dev/null +++ b/SOURCES/kvm-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch @@ -0,0 +1,50 @@ +From 75e13be918f567469054a2bc387d202b0848757b Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 14:10:18 +0100 +Subject: rhel: Drop "cfi.pflash01" and "isa-ide" device + +RH-Author: Markus Armbruster +Message-id: <1383401418-4444-3-git-send-email-armbru@redhat.com> +Patchwork-id: 55269 +O-Subject: [PATCH 7.0 qemu-kvm 2/2] rhel: Drop "cfi.pflash01" and "isa-ide" device +Bugzilla: 1001076 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Alex Williamson + +From: Markus Armbruster + +We can drop a device from the build only when it isn't referenced from +code we build. References come in two forms: extern symbols, and qdev +driver names. + +Unresolved extern symbols pose no real danger, because they fail +safely at link time. Note for the curious: the optimizer gets rid of +the reference to isa_ide_init() in hw/i386/pc_piix.c. + +Unresolved driver names get detected only at runtime, so we better be +extra careful. There is just one occurence of either driver name +outside the code dropped by this patch: "isa-ide" in hw/isa/pc87312.c. +Compiled only when CONFIG_PC87312 is enabled. It isn't in our build. + +"cfi.pflash01" is already no-user. Drop it anyway, because it's easy +and safe. + +Signed-off-by: Markus Armbruster + +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index ddf71dc..c79d215 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -17,11 +17,9 @@ CONFIG_FDC=y + CONFIG_ACPI=y + CONFIG_APM=y + CONFIG_I8257=y +-CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_PIIX_PCI=y + CONFIG_I8259=y +-CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) + CONFIG_PCI_HOTPLUG_OLD=y + CONFIG_MC146818RTC=y diff --git a/SOURCES/kvm-rhel-Drop-isa-vga-device.patch b/SOURCES/kvm-rhel-Drop-isa-vga-device.patch new file mode 100644 index 0000000..3bc70a3 --- /dev/null +++ b/SOURCES/kvm-rhel-Drop-isa-vga-device.patch @@ -0,0 +1,52 @@ +From 58314bdb4079b5dac021034b303ba38816ebec8e Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 15:05:06 +0100 +Subject: rhel: Drop "isa-vga" device + +RH-Author: Markus Armbruster +Message-id: <1383404707-6015-2-git-send-email-armbru@redhat.com> +Patchwork-id: 55272 +O-Subject: [PATCH 7.0 qemu-kvm 1/2] rhel: Drop "isa-vga" device +Bugzilla: 1001088 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Alex Williamson + +From: Markus Armbruster + +We can drop a device from the build only when it isn't referenced from +code we build. References come in two forms: extern symbols, and qdev +driver names. + +Unresolved extern symbols pose no real danger, because they fail +safely at link time. The dropped code doesn't define any extern +symbols anyway. + +Unresolved driver names get detected only at runtime, so we better be +extra careful. Occurences of the driver name outside the code dropped +by this patch: + +* default_list[] in vl.c: Used only to disable default VGA with + -device isa-vga. Safe. + +* vga_available() in vl.c: Tests whether the device is compiled in. + No change, because device "VGA" is still compiled in, therfore safe. + +* isa_vga_init() in hw/isa/isa-bus.c: Its only potential caller + pc_vga_init() never calls in RHEL, because it never gets a null + pci_bus argument. Safe. + +Signed-off-by: Markus Armbruster + +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index c79d215..288ef72 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -6,7 +6,6 @@ include usb.mak + CONFIG_VGA=y + CONFIG_QXL=$(CONFIG_SPICE) + CONFIG_VGA_PCI=y +-CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y diff --git a/SOURCES/kvm-rhel-Drop-ivshmem-device.patch b/SOURCES/kvm-rhel-Drop-ivshmem-device.patch new file mode 100644 index 0000000..9bd0b4e --- /dev/null +++ b/SOURCES/kvm-rhel-Drop-ivshmem-device.patch @@ -0,0 +1,49 @@ +From ee0b3fa7a671840e1e6a308fd9e964b425292fb7 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 16:09:08 +0100 +Subject: rhel: Drop "ivshmem" device + +RH-Author: Markus Armbruster +Message-id: <1383408548-7760-2-git-send-email-armbru@redhat.com> +Patchwork-id: 55277 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] rhel: Drop "ivshmem" device +Bugzilla: 787463 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Miroslav Rezanina + +From: Markus Armbruster + +We can drop a device from the build only when it isn't referenced from +code we build. References come in two forms: extern symbols, and qdev +driver names. + +Unresolved extern symbols pose no real danger, because they fail +safely at link time. But the dropped code doesn't define any extern +symbols anyway. + +Unresolved driver names get detected only at runtime, so we better be +extra careful. The only occurences of the driver name outside the +code dropped by this patch is in machine type compat properties +(safe), and those aren't even compiled for RHEL (extra safe). + +Since there's no CONFIG_IVSHMEM, we need to hack the Makefile +directly. Creating CONFIG_IVSHMEM upstream would be nice, but we're +out of time. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs +index 979e532..c07727b 100644 +--- a/hw/misc/Makefile.objs ++++ b/hw/misc/Makefile.objs +@@ -20,7 +20,8 @@ common-obj-$(CONFIG_PUV3) += puv3_pm.o + common-obj-$(CONFIG_MACIO) += macio/ + + ifeq ($(CONFIG_PCI), y) +-obj-$(CONFIG_KVM) += ivshmem.o ++# Disabled for Red Hat Enterprise Linux: ++# obj-$(CONFIG_KVM) += ivshmem.o + obj-$(CONFIG_LINUX) += vfio.o + endif + diff --git a/SOURCES/kvm-rhel-Make-ccid-card-emulated-device-unavailable.patch b/SOURCES/kvm-rhel-Make-ccid-card-emulated-device-unavailable.patch new file mode 100644 index 0000000..60a44af --- /dev/null +++ b/SOURCES/kvm-rhel-Make-ccid-card-emulated-device-unavailable.patch @@ -0,0 +1,37 @@ +From a5d74cbfb850a57c04e03241eeeeef81dc8cbdfd Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 15:24:00 +0100 +Subject: rhel: Make "ccid-card-emulated" device unavailable + +RH-Author: Markus Armbruster +Message-id: <1383405840-6221-2-git-send-email-armbru@redhat.com> +Patchwork-id: 55273 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] rhel: Make "ccid-card-emulated" device unavailable +Bugzilla: 1001123 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Alex Williamson + +From: Markus Armbruster + +We can't just --disable-smartcard-nss, because that also disables +libcacard. Instead, make it unavailable with -device / device_add. +Suffices, because there's no other way to get it: the device model +defines no external symbols, and the driver name doesn't occur in code +outside the device model. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c +index aa1c37a..17921a3 100644 +--- a/hw/usb/ccid-card-emulated.c ++++ b/hw/usb/ccid-card-emulated.c +@@ -586,6 +586,8 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + dc->desc = "emulated smartcard"; + dc->props = emulated_card_properties; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo emulated_card_info = { diff --git a/SOURCES/kvm-rhel-Make-isa-cirrus-vga-device-unavailable.patch b/SOURCES/kvm-rhel-Make-isa-cirrus-vga-device-unavailable.patch new file mode 100644 index 0000000..5b67106 --- /dev/null +++ b/SOURCES/kvm-rhel-Make-isa-cirrus-vga-device-unavailable.patch @@ -0,0 +1,40 @@ +From baf64ed57de359bb093c9557108edcab6f77dfb9 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 15:05:07 +0100 +Subject: rhel: Make "isa-cirrus-vga" device unavailable + +RH-Author: Markus Armbruster +Message-id: <1383404707-6015-3-git-send-email-armbru@redhat.com> +Patchwork-id: 55270 +O-Subject: [PATCH 7.0 qemu-kvm 2/2] rhel: Make "isa-cirrus-vga" device unavailable +Bugzilla: 1001088 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Alex Williamson + +From: Markus Armbruster + +We can't drop it, because the ISA device is entangled with the PCI +device, which we want to keep. Disentangling it upstream would be +nice, but we're out of time. + +Instead, make it unavailable with -device / device_add. Suffices, +because the only other way to get it is via pc_vga_init() calling +isa_vga_init(), which it never does in RHEL, because it never gets a +null pci_bus argument. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index c8f0afb..417fe55 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -2943,6 +2943,8 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) + dc->realize = isa_cirrus_vga_realizefn; + dc->props = isa_cirrus_vga_properties; + set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo isa_cirrus_vga_info = { diff --git a/SOURCES/kvm-rhel-Make-pci-serial-2x-and-pci-serial-4x-device-unavailable.patch b/SOURCES/kvm-rhel-Make-pci-serial-2x-and-pci-serial-4x-device-unavailable.patch new file mode 100644 index 0000000..68d1b91 --- /dev/null +++ b/SOURCES/kvm-rhel-Make-pci-serial-2x-and-pci-serial-4x-device-unavailable.patch @@ -0,0 +1,46 @@ +From e8ec88c08440a9e933ae391092672697b6804054 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 15:39:00 +0100 +Subject: rhel: Make "pci-serial-2x" and "pci-serial-4x" device unavailable + +RH-Author: Markus Armbruster +Message-id: <1383406740-6461-2-git-send-email-armbru@redhat.com> +Patchwork-id: 55276 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] rhel: Make "pci-serial-2x" and "pci-serial-4x" device unavailable +Bugzilla: 1001180 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +From: Markus Armbruster + +We can't just drop CONFIG_SERIAL_PCI, because we still want +"pci-serial". Instead, make them unavailable with -device / +device_add. Suffices, because there's no other way to get it: the +device model defines no external symbols, and the driver name doesn't +occur in code outside the device model. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c +index c133c33..ad19bd3 100644 +--- a/hw/char/serial-pci.c ++++ b/hw/char/serial-pci.c +@@ -230,6 +230,8 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_pci_multi_serial; + dc->props = multi_2x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) +@@ -245,6 +247,8 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_pci_multi_serial; + dc->props = multi_4x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo serial_pci_info = { diff --git a/SOURCES/kvm-rhel-Revert-downstream-changes-to-unused-default-configs-mak.patch b/SOURCES/kvm-rhel-Revert-downstream-changes-to-unused-default-configs-mak.patch new file mode 100644 index 0000000..9bea103 --- /dev/null +++ b/SOURCES/kvm-rhel-Revert-downstream-changes-to-unused-default-configs-mak.patch @@ -0,0 +1,223 @@ +From 46cda1f9e443d492efaec421fd4b2f5e8a9cbeb4 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Sat, 2 Nov 2013 14:10:17 +0100 +Subject: rhel: Revert downstream changes to unused default-configs/*.mak + +RH-Author: Markus Armbruster +Message-id: <1383401418-4444-2-git-send-email-armbru@redhat.com> +Patchwork-id: 55268 +O-Subject: [PATCH 7.0 qemu-kvm 1/2] rhel: Revert downstream changes to unused default-configs/*.mak +Bugzilla: 1001076 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Alex Williamson + +From: Markus Armbruster + +Pointless conflict magnets. "Unused" means they don't affect the RHEL +build in any way. + +Signed-off-by: Markus Armbruster + +diff --git a/default-configs/alpha-softmmu.mak b/default-configs/alpha-softmmu.mak +index 05c2f6e..bc07600 100644 +--- a/default-configs/alpha-softmmu.mak ++++ b/default-configs/alpha-softmmu.mak +@@ -10,6 +10,7 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_CIRRUS=y + CONFIG_IDE_CORE=y + CONFIG_IDE_QDEV=y ++CONFIG_VMWARE_VGA=y + CONFIG_IDE_CMD646=y + CONFIG_I8259=y + CONFIG_MC146818RTC=y +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index cbd40ea..8e08841 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -8,8 +8,10 @@ CONFIG_QXL=$(CONFIG_SPICE) + CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_CIRRUS=y ++CONFIG_VMWARE_VGA=y + CONFIG_VMMOUSE=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -19,7 +21,10 @@ CONFIG_APM=y + CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y ++CONFIG_NE2000_ISA=y + CONFIG_PIIX_PCI=y ++CONFIG_HPET=y ++CONFIG_APPLESMC=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) +diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak +index 5b4816a..71177ef 100644 +--- a/default-configs/mips-softmmu.mak ++++ b/default-configs/mips-softmmu.mak +@@ -9,7 +9,9 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y ++CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -20,6 +22,7 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y ++CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak +index 8b02d98..617301b 100644 +--- a/default-configs/mips64-softmmu.mak ++++ b/default-configs/mips64-softmmu.mak +@@ -9,7 +9,9 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y ++CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -20,6 +22,7 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y ++CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak +index 961fa04..317b151 100644 +--- a/default-configs/mips64el-softmmu.mak ++++ b/default-configs/mips64el-softmmu.mak +@@ -9,7 +9,9 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y ++CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -21,6 +23,7 @@ CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y + CONFIG_IDE_VIA=y ++CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak +index 8715e5c..532a9ae 100644 +--- a/default-configs/mipsel-softmmu.mak ++++ b/default-configs/mipsel-softmmu.mak +@@ -9,7 +9,9 @@ CONFIG_VGA_PCI=y + CONFIG_VGA_ISA=y + CONFIG_VGA_ISA_MM=y + CONFIG_VGA_CIRRUS=y ++CONFIG_VMWARE_VGA=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -20,6 +22,7 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y ++CONFIG_NE2000_ISA=y + CONFIG_RC4030=y + CONFIG_DP8393X=y + CONFIG_DS1225Y=y +diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak +index 50fded0..33f8d84 100644 +--- a/default-configs/ppc-softmmu.mak ++++ b/default-configs/ppc-softmmu.mak +@@ -9,6 +9,7 @@ CONFIG_M48T59=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCKBD=y + CONFIG_FDC=y +@@ -32,6 +33,7 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y ++CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index 758e52b..37a15b7 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -9,6 +9,7 @@ CONFIG_M48T59=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCKBD=y + CONFIG_FDC=y +@@ -32,6 +33,7 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y ++CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak +index aa2bdb1..fb482d2 100644 +--- a/default-configs/ppcemb-softmmu.mak ++++ b/default-configs/ppcemb-softmmu.mak +@@ -22,6 +22,7 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y ++CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/sparc-softmmu.mak b/default-configs/sparc-softmmu.mak +index 775e16a..ab796b3 100644 +--- a/default-configs/sparc-softmmu.mak ++++ b/default-configs/sparc-softmmu.mak +@@ -7,6 +7,7 @@ CONFIG_M48T59=y + CONFIG_PTIMER=y + CONFIG_FDC=y + CONFIG_EMPTY_SLOT=y ++CONFIG_PCNET_COMMON=y + CONFIG_LANCE=y + CONFIG_TCX=y + CONFIG_CG3=y +diff --git a/default-configs/sparc64-softmmu.mak b/default-configs/sparc64-softmmu.mak +index 34c13a4..299c97b 100644 +--- a/default-configs/sparc64-softmmu.mak ++++ b/default-configs/sparc64-softmmu.mak +@@ -8,6 +8,7 @@ CONFIG_PTIMER=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_SERIAL=y ++CONFIG_PARALLEL=y + CONFIG_PCKBD=y + CONFIG_FDC=y + CONFIG_IDE_ISA=y diff --git a/SOURCES/kvm-rhel-SMBIOS-type-1-branding.patch b/SOURCES/kvm-rhel-SMBIOS-type-1-branding.patch new file mode 100644 index 0000000..0854132 --- /dev/null +++ b/SOURCES/kvm-rhel-SMBIOS-type-1-branding.patch @@ -0,0 +1,66 @@ +From 41121ae1f9c3dab44a71d2390e1ec61ecf099531 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Wed, 9 Jul 2014 15:37:24 +0200 +Subject: rhel: SMBIOS type 1 branding + +RH-Author: Markus Armbruster +Message-id: <1383386488-29789-12-git-send-email-armbru@redhat.com> +Patchwork-id: 55242 +O-Subject: [PATCH 7.0 qemu-kvm 11/11] rhel: SMBIOS type 1 branding +Bugzilla: 994490 +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Miroslav Rezanina + +From: Markus Armbruster + +The previous two commits got us the upstreamable parts of RHEL-6 +commit 68c63bd "per-machine-type smbios Type 1 smbios values". This +is the RHEL-only part. + +Note: RHEL-6 also has commit 8e0d71e "Set SMBIOS vendor to QEMU for +RHEL5 machine types.", which RHEL-7 doesn't need, because it doesn't +have RHEL-5 machine types. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 6f8420d..3d0e764 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -173,8 +173,7 @@ static void pc_init1(MachineState *machine, + if (smbios_defaults) { + MachineClass *mc = MACHINE_GET_CLASS(machine); + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", +- mc->name, smbios_legacy_mode); ++ smbios_set_defaults("Red Hat", "KVM", mc->desc, smbios_legacy_mode); + } + + /* allocate ram and load rom/bios */ +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index dbf9983..a72654d 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -163,8 +163,7 @@ static void pc_q35_init(MachineState *machine) + if (smbios_defaults) { + MachineClass *mc = MACHINE_GET_CLASS(machine); + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", +- mc->name, smbios_legacy_mode); ++ smbios_set_defaults("Red Hat", "KVM", mc->desc, smbios_legacy_mode); + } + + /* allocate ram and load rom/bios */ +diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c +index e3fa1b2..5bf97a1 100644 +--- a/hw/i386/smbios.c ++++ b/hw/i386/smbios.c +@@ -768,6 +768,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product, + SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type1.product, product); + SMBIOS_SET_DEFAULT(type1.version, version); ++ SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux"); + SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type2.product, product); + SMBIOS_SET_DEFAULT(type2.version, version); diff --git a/SOURCES/kvm-scripts-qapi-event-py-support-vendor-extension.patch b/SOURCES/kvm-scripts-qapi-event-py-support-vendor-extension.patch new file mode 100644 index 0000000..7df59eb --- /dev/null +++ b/SOURCES/kvm-scripts-qapi-event-py-support-vendor-extension.patch @@ -0,0 +1,74 @@ +From 89f7ec0b3b8e59cf2e168d49b95698ae93a1fce4 Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Wed, 9 Jul 2014 14:31:50 +0200 +Subject: scripts: qapi-event.py: support vendor extension + +Message-id: <1404916312-27953-2-git-send-email-lcapitulino@redhat.com> +Patchwork-id: 59727 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH 1/3] scripts: qapi-event.py: support vendor extension +Bugzilla: 1116772 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Eric Blake +RH-Acked-by: Laszlo Ersek + +The event code generator barfs when it sees a dot in an event +argument, this makes it impossible to support vendor extensions +in event arguments as they always contain dots. Fix this by +replacing dots by hyphens in the generated code. + +PS: Event names and QMP command arguments may suffer from the +same issue, but I'm not checking/fixing them today. + +Signed-off-by: Luiz Capitulino + +diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py +index 601e307..485694b 100644 +--- a/scripts/qapi-event.py ++++ b/scripts/qapi-event.py +@@ -23,11 +23,11 @@ def _generate_event_api_name(event_name, params): + if params: + for argname, argentry, optional, structured in parse_args(params): + if optional: +- api_name += "bool has_%s,\n" % c_var(argname) ++ api_name += "bool has_%s,\n" % c_arg(argname) + api_name += "".ljust(l) + + api_name += "%s %s,\n" % (c_type(argentry, is_param=True), +- c_var(argname)) ++ c_arg(argname)) + api_name += "".ljust(l) + + api_name += "Error **errp)" +@@ -98,7 +98,7 @@ def generate_event_implement(api_name, event_name, params): + ret += mcgen(""" + if (has_%(var)s) { + """, +- var = c_var(argname)) ++ var = c_arg(argname)) + push_indent() + + if argentry == "str": +@@ -113,7 +113,7 @@ def generate_event_implement(api_name, event_name, params): + } + """, + var_type = var_type, +- var = c_var(argname), ++ var = c_arg(argname), + type = type_name(argentry), + name = argname) + +diff --git a/scripts/qapi.py b/scripts/qapi.py +index f2c6d1f..ddab14d 100644 +--- a/scripts/qapi.py ++++ b/scripts/qapi.py +@@ -434,6 +434,10 @@ def c_var(name, protect=True): + def c_fun(name, protect=True): + return c_var(name, protect).replace('.', '_') + ++# Should be used where vendor extensions are supported ++def c_arg(name): ++ return c_var(name).replace('.', '_') ++ + def c_list_type(name): + return '%sList' % name + diff --git a/SOURCES/kvm-scsi-block-extract-scsi_block_is_passthrough.patch b/SOURCES/kvm-scsi-block-extract-scsi_block_is_passthrough.patch new file mode 100644 index 0000000..65f010a --- /dev/null +++ b/SOURCES/kvm-scsi-block-extract-scsi_block_is_passthrough.patch @@ -0,0 +1,95 @@ +From 238c308594fdefda33657a5d1ae505450e9fcb8d Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 12 Sep 2014 12:08:55 +0200 +Subject: [PATCH 25/32] scsi-block: extract scsi_block_is_passthrough + +Message-id: <1410523737-12968-4-git-send-email-pbonzini@redhat.com> +Patchwork-id: 61023 +O-Subject: [RHEL 7.1 qemu-kvm-rhev PATCH 3/5] scsi-block: extract scsi_block_is_passthrough +Bugzilla: 1123349 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laszlo Ersek + +This will be used for both scsi_block_new_request and the scsi-block +implementation of parse_cdb. + +Reviewed-by: Fam Zheng +Signed-off-by: Paolo Bonzini +(cherry-picked from commit 592c3b289f77ee77d5bff25cb19326cc7f22a532) + +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/scsi-disk.c | 38 ++++++++++++++++++++++++++------------ + 1 file changed, 26 insertions(+), 12 deletions(-) + +diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c +index d47ecd6..81b7276 100644 +--- a/hw/scsi/scsi-disk.c ++++ b/hw/scsi/scsi-disk.c +@@ -2501,12 +2501,8 @@ static int scsi_block_initfn(SCSIDevice *dev) + return scsi_initfn(&s->qdev); + } + +-static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag, +- uint32_t lun, uint8_t *buf, +- void *hba_private) ++static bool scsi_block_is_passthrough(SCSIDiskState *s, uint8_t *buf) + { +- SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d); +- + switch (buf[0]) { + case READ_6: + case READ_10: +@@ -2523,9 +2519,9 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag, + case WRITE_VERIFY_12: + case WRITE_VERIFY_16: + /* If we are not using O_DIRECT, we might read stale data from the +- * host cache if writes were made using other commands than these +- * ones (such as WRITE SAME or EXTENDED COPY, etc.). So, without +- * O_DIRECT everything must go through SG_IO. ++ * host cache if writes were made using other commands than these ++ * ones (such as WRITE SAME or EXTENDED COPY, etc.). So, without ++ * O_DIRECT everything must go through SG_IO. + */ + if (!(bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE)) { + break; +@@ -2542,13 +2538,31 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag, + * just make scsi-block operate the same as scsi-generic for them. + */ + if (s->qdev.type != TYPE_ROM) { +- return scsi_req_alloc(&scsi_disk_dma_reqops, &s->qdev, tag, lun, +- hba_private); ++ return false; + } ++ break; ++ ++ default: ++ break; + } + +- return scsi_req_alloc(&scsi_generic_req_ops, &s->qdev, tag, lun, +- hba_private); ++ return true; ++} ++ ++ ++static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag, ++ uint32_t lun, uint8_t *buf, ++ void *hba_private) ++{ ++ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d); ++ ++ if (scsi_block_is_passthrough(s, buf)) { ++ return scsi_req_alloc(&scsi_generic_req_ops, &s->qdev, tag, lun, ++ hba_private); ++ } else { ++ return scsi_req_alloc(&scsi_disk_dma_reqops, &s->qdev, tag, lun, ++ hba_private); ++ } + } + #endif + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-scsi-block-scsi-generic-implement-parse_cdb.patch b/SOURCES/kvm-scsi-block-scsi-generic-implement-parse_cdb.patch new file mode 100644 index 0000000..ea2d566 --- /dev/null +++ b/SOURCES/kvm-scsi-block-scsi-generic-implement-parse_cdb.patch @@ -0,0 +1,122 @@ +From 3f60d6df4a9d23cba0261bca0d05281e67228a87 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 12 Sep 2014 12:08:56 +0200 +Subject: [PATCH 26/32] scsi-block, scsi-generic: implement parse_cdb + +Message-id: <1410523737-12968-5-git-send-email-pbonzini@redhat.com> +Patchwork-id: 61027 +O-Subject: [RHEL 7.1 qemu-kvm-rhev PATCH 4/5] scsi-block, scsi-generic: implement parse_cdb +Bugzilla: 1123349 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laszlo Ersek + +The callback lets the bus provide the direction and transfer count +for passthrough commands, enabling passthrough of vendor-specific +commands. + +Reviewed-by: Fam Zheng +Signed-off-by: Paolo Bonzini +(cherry-picked from commit 3e7e180ab3f970a4e5b64b5fafd57c48c98ee560) + +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/scsi-bus.c | 3 +-- + hw/scsi/scsi-disk.c | 14 ++++++++++++++ + hw/scsi/scsi-generic.c | 7 +++++++ + include/hw/scsi/scsi.h | 1 + + 4 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index d97d18a..6f4462b 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -9,7 +9,6 @@ + + static char *scsibus_get_dev_path(DeviceState *dev); + static char *scsibus_get_fw_dev_path(DeviceState *dev); +-static int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf); + static void scsi_req_dequeue(SCSIRequest *req); + static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len); + static void scsi_target_free_buf(SCSIRequest *req); +@@ -1210,7 +1209,7 @@ static uint64_t scsi_cmd_lba(SCSICommand *cmd) + return lba; + } + +-static int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf) ++int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf) + { + int rc; + +diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c +index 81b7276..d55521d 100644 +--- a/hw/scsi/scsi-disk.c ++++ b/hw/scsi/scsi-disk.c +@@ -2564,6 +2564,19 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag, + hba_private); + } + } ++ ++static int scsi_block_parse_cdb(SCSIDevice *d, SCSICommand *cmd, ++ uint8_t *buf, void *hba_private) ++{ ++ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d); ++ ++ if (scsi_block_is_passthrough(s, buf)) { ++ return scsi_bus_parse_cdb(&s->qdev, cmd, buf, hba_private); ++ } else { ++ return scsi_req_parse_cdb(&s->qdev, cmd, buf); ++ } ++} ++ + #endif + + #define DEFINE_SCSI_DISK_PROPERTIES() \ +@@ -2672,6 +2685,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data) + sc->init = scsi_block_initfn; + sc->destroy = scsi_destroy; + sc->alloc_req = scsi_block_new_request; ++ sc->parse_cdb = scsi_block_parse_cdb; + dc->fw_name = "disk"; + dc->desc = "SCSI block device passthrough"; + dc->reset = scsi_disk_reset; +diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c +index 3733d2c..0b2ff90 100644 +--- a/hw/scsi/scsi-generic.c ++++ b/hw/scsi/scsi-generic.c +@@ -490,6 +490,12 @@ static Property scsi_generic_properties[] = { + DEFINE_PROP_END_OF_LIST(), + }; + ++static int scsi_generic_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, ++ uint8_t *buf, void *hba_private) ++{ ++ return scsi_bus_parse_cdb(dev, cmd, buf, hba_private); ++} ++ + static void scsi_generic_class_initfn(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); +@@ -498,6 +504,7 @@ static void scsi_generic_class_initfn(ObjectClass *klass, void *data) + sc->init = scsi_generic_initfn; + sc->destroy = scsi_destroy; + sc->alloc_req = scsi_new_request; ++ sc->parse_cdb = scsi_generic_parse_cdb; + dc->fw_name = "disk"; + dc->desc = "pass through generic scsi device (/dev/sg*)"; + dc->reset = scsi_generic_reset; +diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h +index 4a0b860..a7a28e6 100644 +--- a/include/hw/scsi/scsi.h ++++ b/include/hw/scsi/scsi.h +@@ -250,6 +250,7 @@ void scsi_req_unref(SCSIRequest *req); + + int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, + void *hba_private); ++int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf); + void scsi_req_build_sense(SCSIRequest *req, SCSISense sense); + void scsi_req_print(SCSIRequest *req); + void scsi_req_continue(SCSIRequest *req); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-scsi-bus-introduce-parse_cdb-in-SCSIDeviceClass-and-.patch b/SOURCES/kvm-scsi-bus-introduce-parse_cdb-in-SCSIDeviceClass-and-.patch new file mode 100644 index 0000000..ba6817d --- /dev/null +++ b/SOURCES/kvm-scsi-bus-introduce-parse_cdb-in-SCSIDeviceClass-and-.patch @@ -0,0 +1,134 @@ +From cebf5833746dc1cf7f3d3c778999c5aafe146629 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 12 Sep 2014 12:08:54 +0200 +Subject: [PATCH 24/32] scsi-bus: introduce parse_cdb in SCSIDeviceClass and + SCSIBusInfo + +Message-id: <1410523737-12968-3-git-send-email-pbonzini@redhat.com> +Patchwork-id: 61024 +O-Subject: [RHEL 7.1 qemu-kvm-rhev PATCH 2/5] scsi-bus: introduce parse_cdb in SCSIDeviceClass and SCSIBusInfo +Bugzilla: 1123349 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laszlo Ersek + +These callbacks will let devices do their own request parsing, or +defer it to the bus. If the bus does not provide an implementation, +in turn, fall back to the default parsing routine. + +Swap the first two arguments to scsi_req_parse, and rename it to +scsi_req_parse_cdb, for consistency. + +Reviewed-by: Fam Zheng +Signed-off-by: Paolo Bonzini +(cherry-picked from commit ff34c32ccc29fc23c11f0ef6c86257e23f9e3266) + +Conflicts: + hw/scsi/scsi-bus.c + [missing commit 6a0a70b, hw: Add missing 'static' attributes, 2014-05-02] + +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/scsi-bus.c | 26 +++++++++++++++++++++++--- + include/hw/scsi/scsi.h | 6 ++++++ + 2 files changed, 29 insertions(+), 3 deletions(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index ca4e9f3..d97d18a 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -9,7 +9,7 @@ + + static char *scsibus_get_dev_path(DeviceState *dev); + static char *scsibus_get_fw_dev_path(DeviceState *dev); +-static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf); ++static int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf); + static void scsi_req_dequeue(SCSIRequest *req); + static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len); + static void scsi_target_free_buf(SCSIRequest *req); +@@ -54,6 +54,20 @@ static void scsi_device_destroy(SCSIDevice *s) + } + } + ++int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, ++ void *hba_private) ++{ ++ SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); ++ int rc; ++ ++ assert(cmd->len == 0); ++ rc = scsi_req_parse_cdb(dev, cmd, buf); ++ if (bus->info->parse_cdb) { ++ rc = bus->info->parse_cdb(dev, cmd, buf, hba_private); ++ } ++ return rc; ++} ++ + static SCSIRequest *scsi_device_alloc_req(SCSIDevice *s, uint32_t tag, uint32_t lun, + uint8_t *buf, void *hba_private) + { +@@ -562,6 +576,7 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, + { + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); + const SCSIReqOps *ops; ++ SCSIDeviceClass *sc = SCSI_DEVICE_GET_CLASS(d); + SCSIRequest *req; + SCSICommand cmd = { .len = 0 }; + int ret; +@@ -587,7 +602,12 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, + ops = NULL; + } + +- ret = scsi_req_parse(&cmd, d, buf); ++ if (ops != NULL || !sc->parse_cdb) { ++ ret = scsi_req_parse_cdb(d, &cmd, buf); ++ } else { ++ ret = sc->parse_cdb(d, &cmd, buf, hba_private); ++ } ++ + if (ret != 0) { + trace_scsi_req_parse_bad(d->id, lun, tag, buf[0]); + req = scsi_req_alloc(&reqops_invalid_opcode, d, tag, lun, hba_private); +@@ -1190,7 +1210,7 @@ static uint64_t scsi_cmd_lba(SCSICommand *cmd) + return lba; + } + +-static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf) ++static int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf) + { + int rc; + +diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h +index 1adb549..4a0b860 100644 +--- a/include/hw/scsi/scsi.h ++++ b/include/hw/scsi/scsi.h +@@ -76,6 +76,8 @@ typedef struct SCSIDeviceClass { + DeviceClass parent_class; + int (*init)(SCSIDevice *dev); + void (*destroy)(SCSIDevice *s); ++ int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, ++ void *hba_private); + SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun, + uint8_t *buf, void *hba_private); + void (*unit_attention_reported)(SCSIDevice *s); +@@ -131,6 +133,8 @@ struct SCSIReqOps { + struct SCSIBusInfo { + int tcq; + int max_channel, max_target, max_lun; ++ int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, ++ void *hba_private); + void (*transfer_data)(SCSIRequest *req, uint32_t arg); + void (*complete)(SCSIRequest *req, uint32_t arg, size_t resid); + void (*cancel)(SCSIRequest *req); +@@ -244,6 +248,8 @@ void scsi_req_free(SCSIRequest *req); + SCSIRequest *scsi_req_ref(SCSIRequest *req); + void scsi_req_unref(SCSIRequest *req); + ++int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, ++ void *hba_private); + void scsi_req_build_sense(SCSIRequest *req, SCSISense sense); + void scsi_req_print(SCSIRequest *req); + void scsi_req_continue(SCSIRequest *req); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-scsi-bus-prepare-scsi_req_new-for-introduction-of-pa.patch b/SOURCES/kvm-scsi-bus-prepare-scsi_req_new-for-introduction-of-pa.patch new file mode 100644 index 0000000..43fba45 --- /dev/null +++ b/SOURCES/kvm-scsi-bus-prepare-scsi_req_new-for-introduction-of-pa.patch @@ -0,0 +1,111 @@ +From 8f74698bb15f5081bb3c5a4b277d0ee7537b1518 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 12 Sep 2014 12:08:53 +0200 +Subject: [PATCH 23/32] scsi-bus: prepare scsi_req_new for introduction of + parse_cdb + +Message-id: <1410523737-12968-2-git-send-email-pbonzini@redhat.com> +Patchwork-id: 61026 +O-Subject: [RHEL 7.1 qemu-kvm-rhev PATCH 1/5] scsi-bus: prepare scsi_req_new for introduction of parse_cdb +Bugzilla: 1123349 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laszlo Ersek + +The per-SCSIDevice parse_cdb callback must not be called if the +request will go through special SCSIReqOps, so detect the special +cases early enough. + +Reviewed-by: Fam Zheng +Signed-off-by: Paolo Bonzini +(cherry-picked from commit 769998a1dbf338a0cdeab2acf8ef605bcf635e01) + +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/scsi-bus.c | 51 ++++++++++++++++++++++++++++++--------------------- + 1 file changed, 30 insertions(+), 21 deletions(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index 4341754..ca4e9f3 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -561,13 +561,38 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, + uint8_t *buf, void *hba_private) + { + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); ++ const SCSIReqOps *ops; + SCSIRequest *req; +- SCSICommand cmd; ++ SCSICommand cmd = { .len = 0 }; ++ int ret; ++ ++ if ((d->unit_attention.key == UNIT_ATTENTION || ++ bus->unit_attention.key == UNIT_ATTENTION) && ++ (buf[0] != INQUIRY && ++ buf[0] != REPORT_LUNS && ++ buf[0] != GET_CONFIGURATION && ++ buf[0] != GET_EVENT_STATUS_NOTIFICATION && ++ ++ /* ++ * If we already have a pending unit attention condition, ++ * report this one before triggering another one. ++ */ ++ !(buf[0] == REQUEST_SENSE && d->sense_is_ua))) { ++ ops = &reqops_unit_attention; ++ } else if (lun != d->lun || ++ buf[0] == REPORT_LUNS || ++ (buf[0] == REQUEST_SENSE && d->sense_len)) { ++ ops = &reqops_target_command; ++ } else { ++ ops = NULL; ++ } + +- if (scsi_req_parse(&cmd, d, buf) != 0) { ++ ret = scsi_req_parse(&cmd, d, buf); ++ if (ret != 0) { + trace_scsi_req_parse_bad(d->id, lun, tag, buf[0]); + req = scsi_req_alloc(&reqops_invalid_opcode, d, tag, lun, hba_private); + } else { ++ assert(cmd.len != 0); + trace_scsi_req_parsed(d->id, lun, tag, buf[0], + cmd.mode, cmd.xfer); + if (cmd.lba != -1) { +@@ -577,25 +602,8 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, + + if (cmd.xfer > INT32_MAX) { + req = scsi_req_alloc(&reqops_invalid_field, d, tag, lun, hba_private); +- } else if ((d->unit_attention.key == UNIT_ATTENTION || +- bus->unit_attention.key == UNIT_ATTENTION) && +- (buf[0] != INQUIRY && +- buf[0] != REPORT_LUNS && +- buf[0] != GET_CONFIGURATION && +- buf[0] != GET_EVENT_STATUS_NOTIFICATION && +- +- /* +- * If we already have a pending unit attention condition, +- * report this one before triggering another one. +- */ +- !(buf[0] == REQUEST_SENSE && d->sense_is_ua))) { +- req = scsi_req_alloc(&reqops_unit_attention, d, tag, lun, +- hba_private); +- } else if (lun != d->lun || +- buf[0] == REPORT_LUNS || +- (buf[0] == REQUEST_SENSE && d->sense_len)) { +- req = scsi_req_alloc(&reqops_target_command, d, tag, lun, +- hba_private); ++ } else if (ops) { ++ req = scsi_req_alloc(ops, d, tag, lun, hba_private); + } else { + req = scsi_device_alloc_req(d, tag, lun, buf, hba_private); + } +@@ -1186,6 +1194,7 @@ static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf) + { + int rc; + ++ cmd->lba = -1; + switch (buf[0] >> 5) { + case 0: + cmd->len = 6; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-i386-Copy-cpu64-rhel6-definition-into-qemu64.patch b/SOURCES/kvm-target-i386-Copy-cpu64-rhel6-definition-into-qemu64.patch new file mode 100644 index 0000000..e7e9149 --- /dev/null +++ b/SOURCES/kvm-target-i386-Copy-cpu64-rhel6-definition-into-qemu64.patch @@ -0,0 +1,72 @@ +From 71d117b41ffde98023c0d8b11ccc683b874e539b Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 25 Mar 2014 16:03:47 +0100 +Subject: target-i386: Copy cpu64-rhel6 definition into qemu64 + +RH-Author: Eduardo Habkost +Message-id: <1395763427-31684-3-git-send-email-ehabkost@redhat.com> +Patchwork-id: 58248 +O-Subject: [RHEL7 qemu-kvm PATCH 2/2] target-i386: Copy cpu64-rhel6 definition into qemu64 +Bugzilla: 1080170 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Alex Williamson +RH-Acked-by: Bandan Das + +Bugzilla: 1078607 +Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7250917 +Upstream status: not applicable + +The CPUID data from cpu64-rhel6 is a better default than qemu64. Among +other things, this fixes MSI problems on 32-bit Windows guests. + +Signed-off-by: Eduardo Habkost + +diff --git a/target-i386/cpu.c b/target-i386/cpu.c +index 65ebbaf..f5d8d9a 100644 +--- a/target-i386/cpu.c ++++ b/target-i386/cpu.c +@@ -653,24 +653,31 @@ struct X86CPUDefinition { + + static X86CPUDefinition builtin_x86_defs[] = { + { ++ /* qemu64 is the default CPU model for all *-rhel7.* machine-types. ++ * The default on RHEL-6 was cpu64-rhel6. ++ * libvirt assumes that qemu64 is the default for _all_ machine-types, ++ * so we should try to keep qemu64 and cpu64-rhel6 as similar as ++ * possible. ++ */ + .name = "qemu64", + .level = 4, + .vendor = CPUID_VENDOR_AMD, + .family = 6, +- .model = 6, ++ .model = 13, + .stepping = 3, +- .features[FEAT_1_EDX] = +- PPRO_FEATURES | +- CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | +- CPUID_PSE36, +- .features[FEAT_1_ECX] = +- CPUID_EXT_SSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT, +- .features[FEAT_8000_0001_EDX] = +- (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) | +- CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, +- .features[FEAT_8000_0001_ECX] = +- CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | +- CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, ++ .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | ++ CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | ++ CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | ++ CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | ++ CPUID_PSE | CPUID_DE | CPUID_FP87, ++ .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | ++ CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | ++ CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | ++ CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | ++ CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ .features[FEAT_8000_0001_ECX] = CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | ++ CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, + .xlevel = 0x8000000A, + }, + { diff --git a/SOURCES/kvm-target-i386-Reject-invalid-CPU-feature-names-on-the-.patch b/SOURCES/kvm-target-i386-Reject-invalid-CPU-feature-names-on-the-.patch new file mode 100644 index 0000000..06f805b --- /dev/null +++ b/SOURCES/kvm-target-i386-Reject-invalid-CPU-feature-names-on-the-.patch @@ -0,0 +1,69 @@ +From c1045c270d3ec70048d6e4e213bfd7635df821b9 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Fri, 5 Sep 2014 19:51:40 +0200 +Subject: [PATCH 17/32] target-i386: Reject invalid CPU feature names on the + command-line +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Message-id: <1409946700-18370-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 60884 +O-Subject: [RHEV7.1 qemu-kvm-rhev PATCH] target-i386: Reject invalid CPU feature names on the command-line +Bugzilla: 1055532 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Igor Mammedov +RH-Acked-by: Amos Kong + +Instead of simply printing a warning, report an error when invalid CPU +options are provided on the CPU model string. + +Signed-off-by: Eduardo Habkost +Reviewed-by: Igor Mammedov +Signed-off-by: Andreas Färber +(cherry picked from commit c00c94abbdb82c39c22b6dd72875aa1ae0f4b2c0) +Signed-off-by: Eduardo Habkost + +Signed-off-by: Miroslav Rezanina +--- + target-i386/cpu.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/target-i386/cpu.c b/target-i386/cpu.c +index f5d8d9a..1139ed7 100644 +--- a/target-i386/cpu.c ++++ b/target-i386/cpu.c +@@ -593,7 +593,8 @@ static bool lookup_feature(uint32_t *pval, const char *s, const char *e, + } + + static void add_flagname_to_bitmaps(const char *flagname, +- FeatureWordArray words) ++ FeatureWordArray words, ++ Error **errp) + { + FeatureWord w; + for (w = 0; w < FEATURE_WORDS; w++) { +@@ -604,7 +605,7 @@ static void add_flagname_to_bitmaps(const char *flagname, + } + } + if (w == FEATURE_WORDS) { +- fprintf(stderr, "CPU feature %s not found\n", flagname); ++ error_setg(errp, "CPU feature %s not found", flagname); + } + } + +@@ -1792,9 +1793,9 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features, + while (featurestr) { + char *val; + if (featurestr[0] == '+') { +- add_flagname_to_bitmaps(featurestr + 1, plus_features); ++ add_flagname_to_bitmaps(featurestr + 1, plus_features, &local_err); + } else if (featurestr[0] == '-') { +- add_flagname_to_bitmaps(featurestr + 1, minus_features); ++ add_flagname_to_bitmaps(featurestr + 1, minus_features, &local_err); + } else if ((val = strchr(featurestr, '='))) { + *val = 0; val++; + feat2prop(featurestr); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-i386-add-cpu64-rhel6-CPU-model.patch b/SOURCES/kvm-target-i386-add-cpu64-rhel6-CPU-model.patch new file mode 100644 index 0000000..ceb6b0f --- /dev/null +++ b/SOURCES/kvm-target-i386-add-cpu64-rhel6-CPU-model.patch @@ -0,0 +1,58 @@ +From c2751d71086c64605ecf4b48d87c5780afca9aad Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 18 Sep 2013 20:49:59 +0200 +Subject: target-i386: add cpu64-rhel6 CPU model + +RH-Author: Eduardo Habkost +Message-id: <1379537399-7308-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54451 +O-Subject: [RHEL-7 qemu-kvm PATCH] target-i386: add cpu64-rhel6 CPU model +Bugzilla: 918907 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das + +Bugzilla: 918907 +Upstream status: not applicable +Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6300787 + +RHEL-6 has a cpu64-rhel6 CPU model, and it is even the default CPU +model. We need to allow migration from RHEL-6, so we need to have a +compatible cpu64-rhel6 CPU model to be present. + +Signed-off-by: Eduardo Habkost + +diff --git a/target-i386/cpu.c b/target-i386/cpu.c +index 6d008ab..cc3ca85 100644 +--- a/target-i386/cpu.c ++++ b/target-i386/cpu.c +@@ -890,6 +890,29 @@ static X86CPUDefinition builtin_x86_defs[] = { + .model_id = "Intel(R) Atom(TM) CPU N270 @ 1.60GHz", + }, + { ++ .name = "cpu64-rhel6", ++ .level = 4, ++ .vendor = CPUID_VENDOR_AMD, ++ .family = 6, ++ .model = 13, ++ .stepping = 3, ++ .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | ++ CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | ++ CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | ++ CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | ++ CPUID_PSE | CPUID_DE | CPUID_FP87, ++ .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | ++ CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | ++ CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | ++ CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | ++ CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ .features[FEAT_8000_0001_ECX] = CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | ++ CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, ++ .xlevel = 0x8000000A, ++ .model_id = "QEMU Virtual CPU version (cpu64-rhel6)", ++ }, ++ { + .name = "Conroe", + .level = 4, + .vendor = CPUID_VENDOR_INTEL, diff --git a/SOURCES/kvm-target-i386-support-loading-of-cpu-xsave-subsection.patch b/SOURCES/kvm-target-i386-support-loading-of-cpu-xsave-subsection.patch new file mode 100644 index 0000000..95e26d3 --- /dev/null +++ b/SOURCES/kvm-target-i386-support-loading-of-cpu-xsave-subsection.patch @@ -0,0 +1,71 @@ +From 5263dd78b20ab64194b0a47b934b8086b1f23f4f Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 16 Oct 2013 20:00:44 +0200 +Subject: target-i386: support loading of "cpu/xsave" subsection + +RH-Author: Eduardo Habkost +Message-id: <1381953644-6411-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 54966 +O-Subject: [qemu-kvm RHEL7 PATCH] target-i386: support loading of "cpu/xsave" subsection +Bugzilla: 1004743 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Juan Quintela +RH-Acked-by: Orit Wasserman + +Bugzilla: 1004743 +Scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6429524 +Upstream status: not applicable + (We could try to make upstream accept the subsection, but I don't + think it will be accepted because there's no real benefit) + +This is a kind of forward-port of RHEL-6 commits ceee3a15c8 and 7f468b80fd, so +the "cpu/xsave" subsection can be loaded when migrating from RHEL-6. + +The differences between the RHEL-6 patches and this one are: + * The xsave state is not being removed from the main "cpu" section, + so we keep using the same format/version used upstream + * The subsection is always reported as optional, because the xsave + state is kept in the main "cpu" section + +Signed-off-by: Eduardo Habkost + +diff --git a/target-i386/machine.c b/target-i386/machine.c +index 16d2f6a..ac45d81 100644 +--- a/target-i386/machine.c ++++ b/target-i386/machine.c +@@ -603,6 +603,25 @@ static const VMStateDescription vmstate_msr_hyperv_time = { + } + }; + ++static bool vmstate_xsave_needed(void *opaque) ++{ ++ /* The xsave state is already on the main "cpu" section */ ++ return false; ++} ++ ++static const VMStateDescription vmstate_xsave ={ ++ .name = "cpu/xsave", ++ .version_id = 1, ++ .minimum_version_id = 1, ++ .minimum_version_id_old = 1, ++ .fields = (VMStateField []) { ++ VMSTATE_UINT64_V(env.xcr0, X86CPU, 1), ++ VMSTATE_UINT64_V(env.xstate_bv, X86CPU, 1), ++ VMSTATE_YMMH_REGS_VARS(env.ymmh_regs, X86CPU, CPU_NB_REGS, 1), ++ VMSTATE_END_OF_LIST() ++ } ++}; ++ + VMStateDescription vmstate_x86_cpu = { + .name = "cpu", + .version_id = 12, +@@ -746,6 +765,9 @@ VMStateDescription vmstate_x86_cpu = { + .vmsd = &vmstate_msr_hyperv_time, + .needed = hyperv_time_enable_needed, + } , { ++ .vmsd = &vmstate_xsave, ++ .needed = vmstate_xsave_needed, ++ }, { + /* empty */ + } + } diff --git a/SOURCES/kvm-target-ppc-virtex-ml507-machine-type-should-depend-o.patch b/SOURCES/kvm-target-ppc-virtex-ml507-machine-type-should-depend-o.patch new file mode 100644 index 0000000..2f1e42d --- /dev/null +++ b/SOURCES/kvm-target-ppc-virtex-ml507-machine-type-should-depend-o.patch @@ -0,0 +1,52 @@ +From e9ace5995100fb31b5b1990d40af7fe5d2d0e3b2 Mon Sep 17 00:00:00 2001 +From: dgibson +Date: Mon, 8 Sep 2014 03:41:41 +0200 +Subject: [PATCH 18/32] target-ppc: virtex-ml507 machine type should depend on + CONFIG_XILINX + +Message-id: <1410147705-12993-2-git-send-email-dgibson@redhat.com> +Patchwork-id: 60891 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 1/5] target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINX +Bugzilla: 1113998 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +Backporting this upstream patch of mine, since it makes disabling the +boards and devices we don't need in RHEL easier. + +Signed-off-by: David Gibson + +commit dd626989d0af7732007389160f49b428898a1389 +Author: David Gibson +Date: Fri Aug 15 14:58:38 2014 +1000 + + target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINX + + The virtex-ml507 is a Xilinx CPU based system, and requires several sub + devices which are only included with CONFIG_XILINX. Therefore, it should + only be compiled if CONFIG_XILINX is set. + + Signed-off-by: David Gibson +--- + hw/ppc/Makefile.objs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/Makefile.objs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs +index edd44d0..19d9920 100644 +--- a/hw/ppc/Makefile.objs ++++ b/hw/ppc/Makefile.objs +@@ -20,4 +20,4 @@ obj-$(CONFIG_MAC) += mac_newworld.o + obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o + obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o + # PowerPC 440 Xilinx ML507 reference board. +-obj-y += virtex_ml507.o ++obj-$(CONFIG_XILINX) += virtex_ml507.o +-- +1.8.3.1 + diff --git a/SOURCES/kvm-uhci-UNfix-irq-routing-for-RHEL-6-machtypes-RHEL-only.patch b/SOURCES/kvm-uhci-UNfix-irq-routing-for-RHEL-6-machtypes-RHEL-only.patch new file mode 100644 index 0000000..25082be --- /dev/null +++ b/SOURCES/kvm-uhci-UNfix-irq-routing-for-RHEL-6-machtypes-RHEL-only.patch @@ -0,0 +1,177 @@ +From 639e4c3be0cc6d92b75d9267fe40645d5f515b47 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 10 Jul 2014 13:54:30 +0200 +Subject: uhci: UNfix irq routing for RHEL-6 machtypes (RHEL only) + +Message-id: <1405000470-9229-2-git-send-email-lersek@redhat.com> +Patchwork-id: 59740 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 1/1] uhci: UNfix irq routing for RHEL-6 machtypes (RHEL only) +Bugzilla: 1103581 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Paolo Bonzini + +RH-Author: Laszlo Ersek +Message-id: <1398337043-4967-1-git-send-email-lersek@redhat.com> +Patchwork-id: 58540 +O-Subject: [RHEL-7.0 0day qemu-kvm PATCH] uhci: UNfix irq routing for RHEL-6 machtypes (RHEL only) +Bugzilla: 1085701 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Paolo Bonzini + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1085701 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=7368968 + +Tested by myself and QE. + +(Note that the bulk of the work related to this issue happened in bug +1027565 comments 64 to 74, because QE was experiencing it with the other +(original) issue reported in bug 1027565. Only later did I realize that +bug 1085701 already existed for this specific problem.) + +Refer to the following upstream commit, present in v1.2.0 and RHEL-7: + + commit 973002c11460efd3c17fe61a76711a103e30e1f9 + Author: Gerd Hoffmann + Date: Fri May 25 12:53:47 2012 +0200 + + uhci: fix irq routing + + The multifunction ich9 ehci controller with uhci companions uses a + different interrupt pin for each function. The three uhci devices + get pins A, B and C, whereas ehci uses pin D. This way the guest + can assign different IRQ lines to each controller. + + Signed-off-by: Gerd Hoffmann + +This is a performance optimization so that IRQ sharing can be avoided in +the guest. + +Contrarily, the RHEL-6 emulator exclusively assigns pin D to each of the +three devices (see "hw/usb-uhci.c" there): +- usb_uhci_ich9_1_initfn() +- usb_uhci_ich9_2_initfn() +- usb_uhci_ich9_3_initfn() + +These init functions call usb_uhci_common_initfn(), which in turn assigns: + + pci_conf[0x3d] = 4; // interrupt pin 3 + +This mismatch breaks migration for rhel6.x.0 machine types from the +RHEL-6.5 emulator to the RHEL-7.0 one. + +For example, considering the uhci1 controller, the guest kernel, started +on the RHEL-6.5 source host, will see pin D advertised, and (according to +the PCI interrupt routing table provided by SeaBIOS) will route it to IRQ +11: + + dmesg: + + uhci_hcd 0000:00:11.0: PCI INT D -> Link[LNKD] -> GSI 11 (level, high) + -> IRQ 11 + + /proc/interrupts: + + 10: ... IO-APIC-fasteoi virtio0 + 11: ... IO-APIC-fasteoi uhci_hcd:usb1 + +When the same guest kernel, using the same rhel6.5.0 machine type, is +started fresh on the RHEL-7.0 target host, pin A is advertised instead +(and routed to a different IRQ, based on the same table from SeaBIOS): + + dmesg: + + uhci_hcd 0000:00:11.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, high) + -> IRQ 10 + + /proc/interrupts: + + 10: ... IO-APIC-fasteoi uhci_hcd:usb1, virtio0 + +This is no problem as long as we don't migrate. + +When we migrate the rhel6.x.0 machtype guest from the RHEL-6.5 host to the +RHEL-7.0 host, the guest kernel (having booted on the source host) will +expect the interrupts for the UHCI device on pin D / IRQ 11. However, the +target host will inject the interrupts on pin A / IRQ 10. No handler in +the guest kernel will claim such IRQ 10 instances (examples are: HDA or +virtio-balloon), hence IRQ 10 will be disabled. + +We can fix this in at least two ways: +(1) Drop the persistent "UHCIState.irq_pin" field, and simply use the pin + identifier that is stored in (already migrated) PCI config space (at + offset 0x3d). +(2) Introduce yet another RHEL-6 compatibility knob that selects pin D for + all three ICH9-UHCI controllers. + +Since PCI config space could be write-accessible to the guest, plus it +could originate from an untrusted migration source as well, and we'd use +the setting as a subscript into the s->dev.irq[] array in +uhci_update_irq(), it seems safer to go with (2). + +Signed-off-by: Laszlo Ersek + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 021cf22..1393ca1 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1157,6 +1157,7 @@ static void pc_compat_rhel650(MachineState *machine) + has_acpi_build = false; + gigabyte_align = false; + shadow_bios_after_incoming = true; ++ ich9_uhci123_irqpin_override = true; + } + + static void pc_init_rhel650(MachineState *machine) +diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c +index c3bf72c..61f3578 100644 +--- a/hw/usb/hcd-uhci.c ++++ b/hw/usb/hcd-uhci.c +@@ -153,6 +153,8 @@ typedef struct UHCI_QH { + uint32_t el_link; + } UHCI_QH; + ++bool ich9_uhci123_irqpin_override; ++ + static void uhci_async_cancel(UHCIAsync *async); + static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td); + static void uhci_resume(void *opaque); +@@ -1200,12 +1202,23 @@ static int usb_uhci_common_initfn(PCIDevice *dev) + UHCIState *s = DO_UPCAST(UHCIState, dev, dev); + uint8_t *pci_conf = s->dev.config; + int i; ++ int irq_pin; + + pci_conf[PCI_CLASS_PROG] = 0x00; + /* TODO: reset value should be 0. */ + pci_conf[USB_SBRN] = USB_RELEASE_1; // release number + +- pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1); ++ if (ich9_uhci123_irqpin_override && ++ u->info.vendor_id == PCI_VENDOR_ID_INTEL && ++ (u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI1 || ++ u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI2 || ++ u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI3)) { ++ fprintf(stderr, "RHEL-6 compat: %s: irq_pin = 3\n", u->info.name); ++ irq_pin = 3; ++ } else { ++ irq_pin = u->info.irq_pin; ++ } ++ pci_config_set_interrupt_pin(pci_conf, irq_pin + 1); + + if (s->masterbus) { + USBPort *ports[NB_PORTS]; +diff --git a/include/hw/usb.h b/include/hw/usb.h +index 8bcab48..fad90bf 100644 +--- a/include/hw/usb.h ++++ b/include/hw/usb.h +@@ -600,4 +600,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id, + uint8_t interface_class, uint8_t interface_subclass, + uint8_t interface_protocol); + ++ ++/* hcd-uhci.c -- RHEL-6 machine type compatibility */ ++extern bool ich9_uhci123_irqpin_override; ++ + #endif diff --git a/SOURCES/kvm-usb-add-microsoft-os-descriptors-compat-property.patch b/SOURCES/kvm-usb-add-microsoft-os-descriptors-compat-property.patch new file mode 100644 index 0000000..0ca21aa --- /dev/null +++ b/SOURCES/kvm-usb-add-microsoft-os-descriptors-compat-property.patch @@ -0,0 +1,33 @@ +From 01fe3b241b00cde8c5e249928ae990491ad74fa9 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 3 Feb 2014 16:30:31 +0100 +Subject: usb: add microsoft os descriptors compat property + +RH-Author: Gerd Hoffmann +Message-id: <1391445032-5540-5-git-send-email-kraxel@redhat.com> +Patchwork-id: 57074 +O-Subject: [RHEL-7 qemu-kvm PATCH 4/5] usb: add microsoft os descriptors compat property +Bugzilla: 1039530 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Juan Quintela +RH-Acked-by: Miroslav Rezanina + +Turn off for rhel6 machine types. RHEL only patch. + +Signed-off-by: Gerd Hoffmann + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 2a6ac6d..db5f2e0 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1074,6 +1074,10 @@ static QEMUMachine pc_machine_rhel700 = { + .driver = "virtio-net-pci",\ + .property = "romfile",\ + .value = "rhel6-virtio.rom",\ ++ },{\ ++ .driver = TYPE_USB_DEVICE,\ ++ .property = "msos-desc",\ ++ .value = "no",\ + } + + static void pc_compat_rhel650(MachineState *machine) diff --git a/SOURCES/kvm-vfio-cap-number-of-devices-that-can-be-assigned.patch b/SOURCES/kvm-vfio-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..1a77485 --- /dev/null +++ b/SOURCES/kvm-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,59 @@ +From 133c1cc45c7289d0a9d777503294feec907ac54e Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Tue, 3 Dec 2013 20:05:13 +0100 +Subject: vfio: cap number of devices that can be assigned + +RH-Author: Bandan Das +Message-id: <1386101113-31560-3-git-send-email-bsd@redhat.com> +Patchwork-id: 55984 +O-Subject: [PATCH RHEL7 qemu-kvm v2 2/2] vfio: cap number of devices that can be assigned +Bugzilla: 678368 +RH-Acked-by: Alex Williamson +RH-Acked-by: Marcelo Tosatti +RH-Acked-by: Michael S. Tsirkin + +Go through all groups to get count of total number of devices +active to enforce limit + +Reasoning from Alex for the limit(32) - Assuming 3 slots per +device, with 125 slots (number of memory slots for RHEL 7), +we can support almost 40 devices and still have few slots left +for other uses. Stepping down a bit, the number 32 arbitrarily +matches the number of slots on a PCI bus and is also a nice power +of two. + +Signed-off-by: Bandan Das + +diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c +index 0b9eba0..7beee5e 100644 +--- a/hw/misc/vfio.c ++++ b/hw/misc/vfio.c +@@ -253,6 +253,7 @@ static const VFIORomBlacklistEntry romblacklist[] = { + }; + + #define MSIX_CAP_LENGTH 12 ++#define MAX_DEV_ASSIGN_CMDLINE 32 + + static QLIST_HEAD(, VFIOGroup) + group_list = QLIST_HEAD_INITIALIZER(group_list); +@@ -4153,7 +4154,19 @@ static int vfio_initfn(PCIDevice *pdev) + ssize_t len; + struct stat st; + int groupid; +- int ret; ++ int ret, i = 0; ++ ++ QLIST_FOREACH(group, &group_list, next) { ++ QLIST_FOREACH(pvdev, &group->device_list, next) { ++ i++; ++ } ++ } ++ ++ if (i >= MAX_DEV_ASSIGN_CMDLINE) { ++ error_report("vfio: Maximum supported vfio devices (%d) " ++ "already attached\n", MAX_DEV_ASSIGN_CMDLINE); ++ return -1; ++ } + + /* Check that the host device exists */ + snprintf(path, sizeof(path), diff --git a/SOURCES/kvm-vga-Default-vram_size_mb-to-16-like-prior-versions-of-RHEL.patch b/SOURCES/kvm-vga-Default-vram_size_mb-to-16-like-prior-versions-of-RHEL.patch new file mode 100644 index 0000000..ef12814 --- /dev/null +++ b/SOURCES/kvm-vga-Default-vram_size_mb-to-16-like-prior-versions-of-RHEL.patch @@ -0,0 +1,103 @@ +From 8ba94e79e74e73030ba97079157442ab85710024 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 31 Jul 2013 08:02:53 +0200 +Subject: vga: Default .vram_size_mb to 16, like prior versions of RHEL + +Message-id: <1375201922-6794-5-git-send-email-armbru@redhat.com> +Patchwork-id: 52811 +O-Subject: [RHEL-7 PATCH v3 04/15] vga: Default .vram_size_mb to 16, like prior versions of RHEL +Bugzilla: 983991 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Bandan Das +RH-Acked-by: Miroslav Rezanina + +A brief history of VGA video RAM sizes: + +* Initially, all VGA devices got 8 MiB of video RAM. + +* Upstream qemu-kvm kvm-62 (2008) doubled it to 16 MiB (commit + a7fe029). + +* RHEL-5 and RHEL-6 based on upstream qemu-kvm. + +* Upstream qemu v1.2.0 made the size configurable for "isa-vga", + "VGA", "vmware_vga" (commit 4a1e244), and "qxl-vga", "qxl" (commit + 13d1fd4), then doubled the default to 16 MiB (commit 9e56edc) for + the new machine type. Except "isa-vga" stayed at 8 MiB. + +* Upstream qemu-kvm merged this in qemu-kvm-1.2.0. Incompatible + change of default VGA video RAM back to 8 MiB for "isa-vga", + "isa-cirrus-vga", "cirrus-vga"[*]. + +* Upstream qemu v1.3.0 made the size configurable for + "isa-cirrus-vga", "cirrus-vga" (commit 19403a6). + +RHEL-7 bases on upstream qemu. To avoid qemu-kvm-1.2.0's incompatible +change, default video RAM size to 16 MiB for all VGA devices[**] and +RHEL machine types. + +[*] And the non-qdevified, memory-mapped VGA used by MIPS magnum and +pica61 machines, but these don't matter in qemu-kvm. + +[**] Except for the non-qdevified, memory-mapped VGA. + +Signed-off-by: Markus Armbruster + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index db330e9..c8f0afb 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -2931,7 +2931,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp) + + static Property isa_cirrus_vga_properties[] = { + DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState, +- cirrus_vga.vga.vram_size_mb, 8), ++ cirrus_vga.vga.vram_size_mb, 16), + DEFINE_PROP_END_OF_LIST(), + }; + +@@ -3001,7 +3001,7 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev) + + static Property pci_vga_cirrus_properties[] = { + DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, +- cirrus_vga.vga.vram_size_mb, 8), ++ cirrus_vga.vga.vram_size_mb, 16), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c +index 2b480bd..4ea5767 100644 +--- a/hw/display/vga-isa.c ++++ b/hw/display/vga-isa.c +@@ -75,7 +75,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp) + } + + static Property vga_isa_properties[] = { +- DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8), ++ DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 851d7bd..776689c 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1052,18 +1052,6 @@ static QEMUMachine pc_machine_rhel700 = { + .property = "param_change",\ + .value = "off",\ + },{\ +- .driver = "VGA",\ +- .property = "vgamem_mb",\ +- .value = stringify(8),\ +- },{\ +- .driver = "qxl-vga",\ +- .property = "vgamem_mb",\ +- .value = stringify(8),\ +- },{\ +- .driver = "qxl",\ +- .property = "vgamem_mb",\ +- .value = stringify(8),\ +- },{\ + .driver = "virtio-blk-pci",\ + .property = "config-wce",\ + .value = "off",\ diff --git a/SOURCES/kvm-virtio-blk-allow-block_resize-with-dataplane.patch b/SOURCES/kvm-virtio-blk-allow-block_resize-with-dataplane.patch new file mode 100644 index 0000000..cbd5358 --- /dev/null +++ b/SOURCES/kvm-virtio-blk-allow-block_resize-with-dataplane.patch @@ -0,0 +1,46 @@ +From 9465d74ecaf7975ec9c8d0bf7fb2cce50c8edec7 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 3 Sep 2014 09:17:59 +0200 +Subject: [PATCH 06/32] virtio-blk: allow block_resize with dataplane + +Message-id: <1409735881-28863-3-git-send-email-stefanha@redhat.com> +Patchwork-id: 60823 +O-Subject: [RHEL7.1 qemu-kvm-rhev PATCH 2/4] virtio-blk: allow block_resize with dataplane +Bugzilla: 1136752 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Fam Zheng + +Now that block_resize acquires the AioContext we can safely allow +resizing the disk. + +Reported-by: Andrey Korolyov +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Max Reitz +Signed-off-by: Kevin Wolf +(cherry picked from commit 466560b9fcada2656b276eb30e25da15a6e706df) +Signed-off-by: Stefan Hajnoczi +--- + hw/block/dataplane/virtio-blk.c | 1 + + 1 file changed, 1 insertion(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/block/dataplane/virtio-blk.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c +index d6ba65c..b042caf 100644 +--- a/hw/block/dataplane/virtio-blk.c ++++ b/hw/block/dataplane/virtio-blk.c +@@ -192,6 +192,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk, + + error_setg(&s->blocker, "block device is in use by data plane"); + bdrv_op_block_all(blk->conf.bs, s->blocker); ++ bdrv_op_unblock(blk->conf.bs, BLOCK_OP_TYPE_RESIZE, s->blocker); + + *dataplane = s; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-blk-allow-drive_del-with-dataplane.patch b/SOURCES/kvm-virtio-blk-allow-drive_del-with-dataplane.patch new file mode 100644 index 0000000..d062ac5 --- /dev/null +++ b/SOURCES/kvm-virtio-blk-allow-drive_del-with-dataplane.patch @@ -0,0 +1,47 @@ +From aa223e04be24a163211415533e61bd2f135ec1e9 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 3 Sep 2014 09:18:01 +0200 +Subject: [PATCH 08/32] virtio-blk: allow drive_del with dataplane + +Message-id: <1409735881-28863-5-git-send-email-stefanha@redhat.com> +Patchwork-id: 60825 +O-Subject: [RHEL7.1 qemu-kvm-rhev PATCH 4/4] virtio-blk: allow drive_del with dataplane +Bugzilla: 1136752 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Fam Zheng + +Now that drive_del acquires the AioContext we can safely allow deleting +the drive. As with non-dataplane mode, all I/Os submitted by the guest +after drive_del will return EIO. + +This patch makes hot unplug work with virtio-blk dataplane. Previously +drive_del reported an error because the device was busy. + +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 3255d1c21f364774390061fbc3b8e25c027cc862) +Signed-off-by: Stefan Hajnoczi +--- + hw/block/dataplane/virtio-blk.c | 1 + + 1 file changed, 1 insertion(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/block/dataplane/virtio-blk.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c +index b042caf..f1c53ec 100644 +--- a/hw/block/dataplane/virtio-blk.c ++++ b/hw/block/dataplane/virtio-blk.c +@@ -193,6 +193,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk, + error_setg(&s->blocker, "block device is in use by data plane"); + bdrv_op_block_all(blk->conf.bs, s->blocker); + bdrv_op_unblock(blk->conf.bs, BLOCK_OP_TYPE_RESIZE, s->blocker); ++ bdrv_op_unblock(blk->conf.bs, BLOCK_OP_TYPE_DRIVE_DEL, s->blocker); + + *dataplane = s; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-rng-add-some-trace-events.patch b/SOURCES/kvm-virtio-rng-add-some-trace-events.patch new file mode 100644 index 0000000..980fba8 --- /dev/null +++ b/SOURCES/kvm-virtio-rng-add-some-trace-events.patch @@ -0,0 +1,89 @@ +From 8973a1594718b11f51dea629adf5555d9845ae8e Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Mon, 18 Aug 2014 07:01:09 +0200 +Subject: [PATCH 01/32] virtio-rng: add some trace events + +Message-id: <41efb1e271d977e7f4c06d722886af188d8b0f12.1408343063.git.amit.shah@redhat.com> +Patchwork-id: 60608 +O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 1/1] virtio-rng: add some trace events +Bugzilla: 1129259 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Amos Kong + +Add some trace events to virtio-rng for easier debugging + +Signed-off-by: Amit Shah + +Reviewed-by: Amos Kong +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 4ac4458076e1aaf3b01a6361154117df20e22215) +Signed-off-by: Amit Shah +--- + hw/virtio/virtio-rng.c | 6 ++++++ + trace-events | 5 +++++ + 2 files changed, 11 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/virtio-rng.c | 6 ++++++ + trace-events | 5 +++++ + 2 files changed, 11 insertions(+) + +diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c +index 7c5a675..572c4ba 100644 +--- a/hw/virtio/virtio-rng.c ++++ b/hw/virtio/virtio-rng.c +@@ -16,6 +16,7 @@ + #include "hw/virtio/virtio-rng.h" + #include "sysemu/rng.h" + #include "qom/object_interfaces.h" ++#include "trace.h" + + static bool is_guest_ready(VirtIORNG *vrng) + { +@@ -24,6 +25,7 @@ static bool is_guest_ready(VirtIORNG *vrng) + && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) { + return true; + } ++ trace_virtio_rng_guest_not_ready(vrng); + return false; + } + +@@ -62,6 +64,7 @@ static void chr_read(void *opaque, const void *buf, size_t size) + offset += len; + + virtqueue_push(vrng->vq, &elem, len); ++ trace_virtio_rng_pushed(vrng, len); + } + virtio_notify(vdev, vrng->vq); + } +@@ -81,6 +84,9 @@ static void virtio_rng_process(VirtIORNG *vrng) + quota = MIN((uint64_t)vrng->quota_remaining, (uint64_t)UINT32_MAX); + } + size = get_request_size(vrng->vq, quota); ++ ++ trace_virtio_rng_request(vrng, size, quota); ++ + size = MIN(vrng->quota_remaining, size); + if (size) { + rng_backend_request_entropy(vrng->rng, size, chr_read, vrng); +diff --git a/trace-events b/trace-events +index 11a17a8..99f39ac 100644 +--- a/trace-events ++++ b/trace-events +@@ -41,6 +41,11 @@ virtio_irq(void *vq) "vq %p" + virtio_notify(void *vdev, void *vq) "vdev %p vq %p" + virtio_set_status(void *vdev, uint8_t val) "vdev %p val %u" + ++# hw/virtio/virtio-rng.c ++virtio_rng_guest_not_ready(void *rng) "rng %p: guest not ready" ++virtio_rng_pushed(void *rng, size_t len) "rng %p: %zd bytes pushed" ++virtio_rng_request(void *rng, size_t size, unsigned quota) "rng %p: %zd bytes requested, %u bytes quota left" ++ + # hw/char/virtio-serial-bus.c + virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u" + virtio_serial_throttle_port(unsigned int port, bool throttle) "port %u, throttle %d" +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-scsi-implement-parse_cdb.patch b/SOURCES/kvm-virtio-scsi-implement-parse_cdb.patch new file mode 100644 index 0000000..4f41e78 --- /dev/null +++ b/SOURCES/kvm-virtio-scsi-implement-parse_cdb.patch @@ -0,0 +1,70 @@ +From 47dabe6140bf244cef7e4718e80ff90f2690ec9f Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 12 Sep 2014 12:08:57 +0200 +Subject: [PATCH 27/32] virtio-scsi: implement parse_cdb + +Message-id: <1410523737-12968-6-git-send-email-pbonzini@redhat.com> +Patchwork-id: 61028 +O-Subject: [RHEL 7.1 qemu-kvm-rhev PATCH 5/5] virtio-scsi: implement parse_cdb +Bugzilla: 1123349 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi + +Enable passthrough of vendor-specific commands. + +Reviewed-by: Fam Zheng +Signed-off-by: Paolo Bonzini +(cherry-picked from commit 33cbb2c546594685131e771e2e0972418b9d0301) + +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/virtio-scsi.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c +index 0eb069a..2dd9255 100644 +--- a/hw/scsi/virtio-scsi.c ++++ b/hw/scsi/virtio-scsi.c +@@ -406,6 +406,30 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status, + virtio_scsi_complete_cmd_req(req); + } + ++static int virtio_scsi_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, ++ uint8_t *buf, void *hba_private) ++{ ++ VirtIOSCSIReq *req = hba_private; ++ ++ if (cmd->len == 0) { ++ cmd->len = MIN(VIRTIO_SCSI_CDB_SIZE, SCSI_CMD_BUF_SIZE); ++ memcpy(cmd->buf, buf, cmd->len); ++ } ++ ++ /* Extract the direction and mode directly from the request, for ++ * host device passthrough. ++ */ ++ cmd->xfer = req->qsgl.size; ++ if (cmd->xfer == 0) { ++ cmd->mode = SCSI_XFER_NONE; ++ } else if (iov_size(req->elem.in_sg, req->elem.in_num) > req->resp_size) { ++ cmd->mode = SCSI_XFER_FROM_DEV; ++ } else { ++ cmd->mode = SCSI_XFER_TO_DEV; ++ } ++ return 0; ++} ++ + static QEMUSGList *virtio_scsi_get_sg_list(SCSIRequest *r) + { + VirtIOSCSIReq *req = r->hba_private; +@@ -658,6 +682,7 @@ static struct SCSIBusInfo virtio_scsi_scsi_info = { + .change = virtio_scsi_change, + .hotplug = virtio_scsi_hotplug, + .hot_unplug = virtio_scsi_hot_unplug, ++ .parse_cdb = virtio_scsi_parse_cdb, + .get_sg_list = virtio_scsi_get_sg_list, + .save_request = virtio_scsi_save_request, + .load_request = virtio_scsi_load_request, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch b/SOURCES/kvm-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch new file mode 100644 index 0000000..4f7871b --- /dev/null +++ b/SOURCES/kvm-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch @@ -0,0 +1,39 @@ +From 529f533c61f49bdbdb72faf836cf94b717555c45 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 7 Jul 2014 10:28:38 +0200 +Subject: vl: Round memory sizes below 2MiB up to 2MiB + +RH-Author: Markus Armbruster +Message-id: <1387459965-19517-2-git-send-email-armbru@redhat.com> +Patchwork-id: 56389 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] vl: Round memory sizes below 2MiB up to 2MiB +Bugzilla: 999836 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Luiz Capitulino +RH-Acked-by: Igor Mammedov + +From: Markus Armbruster + +SeaBIOS requires at least 1MiB of RAM, but doesn't doesn't check for +it. It simply assumes it's there, and crashes when it isn't, often +without any indication what's wrong. No upstream SeaBIOS fix +expected. + +In RHEL-6, we round memory sizes below 2MiB up to 2MiB to protect +SeaBIOS (commit 551c098 and commit b9d6c40). Do the same for RHEL-7. +Not wanted upstream. + +Signed-off-by: Markus Armbruster + +diff --git a/vl.c b/vl.c +index ab69cdc..d225b8f 100644 +--- a/vl.c ++++ b/vl.c +@@ -3330,6 +3330,7 @@ int main(int argc, char **argv, char **envp) + } + + sz = QEMU_ALIGN_UP(sz, 8192); ++ sz = MAX(sz, 2 * 1024 * 1024); + ram_size = sz; + if (ram_size != sz) { + error_report("ram size too large"); diff --git a/SOURCES/kvm-vmstate_xhci_event-bug-compat-for-rhel7.0.0-machine-.patch b/SOURCES/kvm-vmstate_xhci_event-bug-compat-for-rhel7.0.0-machine-.patch new file mode 100644 index 0000000..725dbbc --- /dev/null +++ b/SOURCES/kvm-vmstate_xhci_event-bug-compat-for-rhel7.0.0-machine-.patch @@ -0,0 +1,198 @@ +From f5177ea13d47aaaf98af341605bb83a4b432f2e2 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 8 Sep 2014 09:23:14 +0200 +Subject: [PATCH 10/32] vmstate_xhci_event: bug compat for rhel7.0.0 machine + types (RHEV only) + +Message-id: <1410168194-26833-3-git-send-email-armbru@redhat.com> +Patchwork-id: 60897 +O-Subject: [PATCH v3 RHEV-7.1 qemu-kvm-rhev 2/2] vmstate_xhci_event: bug compat for rhel7.0.0 machine types (RHEV only) +Bugzilla: 1136512 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Dr. David Alan Gilbert (git) +RH-Acked-by: Paolo Bonzini + +From: Laszlo Ersek + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1136512 + +The "vmstate_xhci_event.fields" member is a pointer to an array of +VMStateField elements. The unnamed array (of static storage duration) +comes from a compound literal. Commit 3afca1d6d fixed the undefined +behavior (CVE-2014-5263) by adding a terminator element to this array, but +between RHEL and RHEV we also need to look into the practical details of +that undefined behavior. + +In debug builds (./configure --enable-debug), the compiler places the +"vmstate_xhci_intr.fields" member's unnamed initializer array right after +the "vmstate_xhci_event.fields" member's. This leads to infinite recursion +(see the previous patch for details), but we don't ship debug builds for +RHEL/RHEV. + +In a normal (optimized, official) build, the layout changes. The +"vmstate_xhci_event.fields" member's unterminated initializer array is +followed by the one of the "vmstate_xhci_slot.fields" member: + + (gdb) print (intptr_t)&vmstate_xhci_event.fields[7] - \ + (intptr_t)&vmstate_xhci_slot.fields[0] + $3 = 0 + +where "vmstate_xhci_slot.fields" is initialized from + + .fields = (VMStateField[]) { + VMSTATE_BOOL(enabled, XHCISlot), + VMSTATE_BOOL(addressed, XHCISlot), + VMSTATE_END_OF_LIST() + } + +The elements of this array are (only relevant members quoted): + + (gdb) print vmstate_xhci_slot.fields[0].offset + $16 = 0 + (gdb) print vmstate_xhci_slot.fields[0].size + $17 = 1 + (gdb) print vmstate_xhci_slot.fields[1].offset + $18 = 1 + (gdb) print vmstate_xhci_slot.fields[1].size + $19 = 1 + +This means that the wire format for "vmstate_xhci_event" will include the +byte at offset 0 and the byte at offset 1 from XHCIEvent, corresponding to +part of the "XHCIEvent.type" member: + + (gdb) print vmstate_xhci_event.fields[0].name + $23 = 0x5555558b12e7 "type" + (gdb) print vmstate_xhci_event.fields[0].offset + $24 = 0 + (gdb) print vmstate_xhci_event.fields[0].size + $25 = 4 + +In order to accommodate these bogus bytes, coming from an unpatched source +side, we introduce two dummy XHCIEvent fields; otherwise the patched +destination would reject the migration stream. + +For the reverse direction, we explicitly set the dummy bytes to the values +that they used to take in an unpatched source, so that when the unpatched +destination deserializes them into part of "XHCIEvent.type", said victim +member still receives a correct value. + +The dummy fields have type uint8_t, not bool. The reason is that +assignment to bool (in xhci_event_pre_save()) would entail conversion to +bool, hence result in values 0 or 1. (See _Bool conversion rules and +.) + +Migration of the dummy fields is gated with a compatibility flag. + +Downstream only because we control the compiler version and the build +flags only in downstream. + +Suggested-by: Amit Shah +Suggested-by: Dr. David Alan Gilbert +Suggested-by: Markus Armbruster +Suggested-by: Gerd Hoffmann +Suggested-by: Paolo Bonzini +Signed-off-by: Laszlo Ersek +Signed-off-by: Markus Armbruster +--- + hw/i386/pc_piix.c | 1 + + hw/i386/pc_q35.c | 1 + + hw/usb/hcd-xhci.c | 20 ++++++++++++++++++++ + include/hw/usb.h | 3 +++ + 4 files changed, 25 insertions(+) + +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 1 + + hw/i386/pc_q35.c | 1 + + hw/usb/hcd-xhci.c | 20 ++++++++++++++++++++ + include/hw/usb.h | 3 +++ + 4 files changed, 25 insertions(+) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 855c951..7f92f19 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -981,6 +981,7 @@ static void pc_compat_rhel700(MachineState *machine) + legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ + smbios_legacy_mode = true; + has_reserved_memory = false; ++ migrate_cve_2014_5263_xhci_fields = true; + } + + static void pc_init_rhel700(MachineState *machine) +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 098151e..36e4e77 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -490,6 +490,7 @@ static void pc_q35_compat_rhel700(MachineState *machine) + + smbios_legacy_mode = true; + has_reserved_memory = false; ++ migrate_cve_2014_5263_xhci_fields = true; + } + + static void pc_q35_init_rhel700(MachineState *machine) +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 58c4b11..051f574 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -418,6 +418,8 @@ typedef struct XHCIEvent { + uint32_t flags; + uint8_t slotid; + uint8_t epid; ++ uint8_t cve_2014_5263_a; ++ uint8_t cve_2014_5263_b; + } XHCIEvent; + + typedef struct XHCIInterrupter { +@@ -3726,9 +3728,25 @@ static const VMStateDescription vmstate_xhci_slot = { + } + }; + ++static void xhci_event_pre_save(void *opaque) ++{ ++ XHCIEvent *s = opaque; ++ ++ s->cve_2014_5263_a = ((uint8_t *)&s->type)[0]; ++ s->cve_2014_5263_b = ((uint8_t *)&s->type)[1]; ++} ++ ++bool migrate_cve_2014_5263_xhci_fields; ++ ++static bool xhci_event_cve_2014_5263(void *opaque, int version_id) ++{ ++ return migrate_cve_2014_5263_xhci_fields; ++} ++ + static const VMStateDescription vmstate_xhci_event = { + .name = "xhci-event", + .version_id = 1, ++ .pre_save = xhci_event_pre_save, + .fields = (VMStateField[]) { + VMSTATE_UINT32(type, XHCIEvent), + VMSTATE_UINT32(ccode, XHCIEvent), +@@ -3737,6 +3755,8 @@ static const VMStateDescription vmstate_xhci_event = { + VMSTATE_UINT32(flags, XHCIEvent), + VMSTATE_UINT8(slotid, XHCIEvent), + VMSTATE_UINT8(epid, XHCIEvent), ++ VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263), ++ VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263), + VMSTATE_END_OF_LIST() + } + }; +diff --git a/include/hw/usb.h b/include/hw/usb.h +index fad90bf..3222329 100644 +--- a/include/hw/usb.h ++++ b/include/hw/usb.h +@@ -604,4 +604,7 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id, + /* hcd-uhci.c -- RHEL-6 machine type compatibility */ + extern bool ich9_uhci123_irqpin_override; + ++/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */ ++extern bool migrate_cve_2014_5263_xhci_fields; ++ + #endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-xhci-PCIe-endpoint-migration-compatibility-fix.patch b/SOURCES/kvm-xhci-PCIe-endpoint-migration-compatibility-fix.patch new file mode 100644 index 0000000..97811c3 --- /dev/null +++ b/SOURCES/kvm-xhci-PCIe-endpoint-migration-compatibility-fix.patch @@ -0,0 +1,101 @@ +From 8d6999516c9f053ee6f9113e83453a6587576729 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert (git)" +Date: Thu, 11 Sep 2014 12:25:44 +0200 +Subject: [PATCH 14/32] xhci PCIe endpoint migration compatibility fix + +Message-id: <1410438345-22590-2-git-send-email-dgilbert@redhat.com> +Patchwork-id: 61008 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 1/2] xhci PCIe endpoint migration compatibility fix +Bugzilla: 1138579 +RH-Acked-by: Alex Williamson +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Michael S. Tsirkin + +From: "Dr. David Alan Gilbert" + +Add back the PCIe config capabilities on XHCI cards in non-PCIe slots, +but only for machine types before 2.1. + +This fixes a migration incompatibility in the XHCI PCI devices +caused by: + 058fdcf52cdbf57b67e7 - xhci: add endpoint cap on express bus only + +Note that in fixing it for compatibility with older QEMUs, it breaks +compatibility with existing QEMU 2.1's on older machine types. + +The status before this patch was (if it used an XHCI adapter): + machine type | source qemu + any pre-2.1 - FAIL + any 2.1... - PASS + +With this patch: + machine type | source qemu + any pre-2.1 - PASS + pre-2.1 2.1... - FAIL + 2.1 2.1... - PASS + +A test to trigger it is to add '-device nec-usb-xhci,id=xhci,addr=0x12' +to the command line. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Dr. David Alan Gilbert +Acked-by: Michael S. Tsirkin +Signed-off-by: Gerd Hoffmann +(cherry picked from commit e6043e92c2812a56b8f6cf35d5512067c746ce21) + +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-xhci.c | 6 +++++- + include/hw/i386/pc.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 051f574..ea7edbd 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -501,6 +501,7 @@ enum xhci_flags { + XHCI_FLAG_USE_MSI = 1, + XHCI_FLAG_USE_MSI_X, + XHCI_FLAG_SS_FIRST, ++ XHCI_FLAG_FORCE_PCIE_ENDCAP, + }; + + static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, +@@ -3628,7 +3629,8 @@ static int usb_xhci_initfn(struct PCIDevice *dev) + PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64, + &xhci->mem); + +- if (pci_bus_is_express(dev->bus)) { ++ if (pci_bus_is_express(dev->bus) || ++ xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) { + ret = pcie_endpoint_cap_init(dev, 0xa0); + assert(ret >= 0); + } +@@ -3838,6 +3840,8 @@ static Property xhci_properties[] = { + DEFINE_PROP_BIT("msix", XHCIState, flags, XHCI_FLAG_USE_MSI_X, true), + DEFINE_PROP_BIT("superspeed-ports-first", + XHCIState, flags, XHCI_FLAG_SS_FIRST, true), ++ DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags, ++ XHCI_FLAG_FORCE_PCIE_ENDCAP, false), + DEFINE_PROP_UINT32("intrs", XHCIState, numintrs, MAXINTRS), + DEFINE_PROP_UINT32("slots", XHCIState, numslots, MAXSLOTS), + DEFINE_PROP_UINT32("p2", XHCIState, numports_2, 4), +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 9e15ff1..aa6ddc4 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -316,6 +316,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + .value = "off",\ + },\ + {\ ++ .driver = "nec-usb-xhci",\ ++ .property = "force-pcie-endcap",\ ++ .value = "on",\ ++ },\ ++ {\ + .driver = "pci-serial",\ + .property = "prog_if",\ + .value = stringify(0),\ +-- +1.8.3.1 + diff --git a/SOURCES/qemu-ga.sysconfig b/SOURCES/qemu-ga.sysconfig new file mode 100644 index 0000000..f54018e --- /dev/null +++ b/SOURCES/qemu-ga.sysconfig @@ -0,0 +1,19 @@ +# This is a systemd environment file, not a shell script. +# It provides settings for "/lib/systemd/system/qemu-guest-agent.service". + +# Comma-separated blacklist of RPCs to disable, or empty list to enable all. +# +# You can get the list of RPC commands using "qemu-ga --blacklist='?'". +# There should be no spaces between commas and commands in the blacklist. +BLACKLIST_RPC=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush + +# Fsfreeze hook script specification. +# +# FSFREEZE_HOOK_PATHNAME=/dev/null : disables the feature. +# +# FSFREEZE_HOOK_PATHNAME=/path/to/executable : enables the feature with the +# specified binary or shell script. +# +# FSFREEZE_HOOK_PATHNAME= : enables the feature with the +# default value (invoke "qemu-ga --help" to interrogate). +FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook diff --git a/SOURCES/qemu-guest-agent.service b/SOURCES/qemu-guest-agent.service new file mode 100644 index 0000000..44b11cd --- /dev/null +++ b/SOURCES/qemu-guest-agent.service @@ -0,0 +1,18 @@ +[Unit] +Description=QEMU Guest Agent +BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device +After=dev-virtio\x2dports-org.qemu.guest_agent.0.device + +[Service] +UMask=0077 +EnvironmentFile=/etc/sysconfig/qemu-ga +ExecStart=/usr/bin/qemu-ga \ + --method=virtio-serial \ + --path=/dev/virtio-ports/org.qemu.guest_agent.0 \ + --blacklist=${BLACKLIST_RPC} \ + -F${FSFREEZE_HOOK_PATHNAME} +StandardError=syslog +Restart=always +RestartSec=0 + +[Install] diff --git a/SPECS/qemu-guest-agent.spec b/SPECS/qemu-guest-agent.spec new file mode 100644 index 0000000..a4a5833 --- /dev/null +++ b/SPECS/qemu-guest-agent.spec @@ -0,0 +1,753 @@ +# Build time setting +%global SLOF_gittagdate 20140630 + +%global have_usbredir 1 +%global have_spice 1 +%global have_fdt 0 +%global have_gluster 1 + +%ifarch %{ix86} x86_64 + %global have_seccomp 1 +%else + %global have_usbredir 0 + %global have_seccomp 0 +%endif + +%ifnarch s390 s390x + %global have_librdma 1 +%endif + +%ifarch %{ix86} + %global kvm_target i386 +%endif +%ifarch x86_64 + %global kvm_target x86_64 +%else + %global have_spice 0 + %global have_gluster 0 +%endif +%ifarch %{power64} + %global kvm_target ppc64 + %global have_fdt 1 +%endif +%ifarch s390 + %global kvm_target s390 +%endif +%ifarch s390x + %global kvm_target s390x +%endif +%ifarch ppc + %global kvm_target ppc + %global have_fdt 1 +%endif +%ifarch aarch64 + %global kvm_target aarch64 + %global have_fdt 1 +%endif + +#Versions of various parts: + +%define pkgname qemu-kvm + +Summary: QEMU guest agent +Name: qemu-guest-agent +Version: 2.1.0 +Release: 4%{?dist} +# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped +Epoch: 10 +License: GPLv2+ and LGPLv2+ and BSD +Group: System Environment/Daemons +URL: http://www.qemu.org/ +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + +# OOM killer breaks builds with parallel make on s390(x) +%ifarch s390 s390x + %define _smp_mflags %{nil} +%endif + +Source0: http://wiki.qemu.org/download/qemu-%{version}.tar.bz2 + +Source1: qemu-guest-agent.service +Source2: 99-qemu-guest-agent.rules +Source3: qemu-ga.sysconfig + + +Patch1005: kvm-misc-Disable-unsupported-usb-devices.patch +Patch1006: kvm-misc-Disable-unsupported-emulated-SCSI-devices.patch +Patch1008: kvm-misc-Disable-various-unsupported-devices.patch +Patch1009: kvm-misc-Disable-unsupported-audio-devices.patch +Patch1010: kvm-misc-Disable-unsupported-emulated-network-devices.patch +Patch1011: kvm-misc-Use-kvm-by-default.patch +Patch1014: kvm-misc-Disable-HPET-device.patch +Patch1016: kvm-misc-Rename-man-page-qemu-1-to-qemu-kvm-1.patch +Patch1017: kvm-misc-Change-qemu-to-qemu-kvm.patch +Patch1032: kvm-pc-Replace-upstream-machine-types-by-RHEL-7-types.patch +Patch1036: kvm-qemu-kvm-Fix-migration-from-older-version-due-to-i8254-changes.patch +Patch1037: kvm-pc-Add-machine-type-rhel6-0-0.patch +Patch1038: kvm-pc-Drop-superfluous-RHEL-6-compat_props.patch +Patch1039: kvm-vga-Default-vram_size_mb-to-16-like-prior-versions-of-RHEL.patch +Patch1040: kvm-pc-Drop-RHEL-6-USB-device-compat_prop-full-path.patch +Patch1041: kvm-pc-Drop-RHEL-6-compat_props-virtio-serial-pci-max_ports-vectors.patch +Patch1042: kvm-pc-Drop-RHEL-6-compat_props-apic-kvm-apic-vapic.patch +Patch1043: kvm-qxl-set-revision-to-1-for-rhel6-0-0.patch +Patch1044: kvm-pc-Give-rhel6-0-0-a-kvmclock.patch +Patch1045: kvm-pc-Add-machine-type-rhel6-1-0.patch +Patch1046: kvm-pc-Add-machine-type-rhel6-2-0.patch +Patch1047: kvm-pc-Add-machine-type-rhel6-3-0.patch +Patch1048: kvm-pc-Add-machine-type-rhel6-4-0.patch +Patch1049: kvm-pc-Add-machine-type-rhel6-5-0.patch +Patch1050: kvm-e1000-Keep-capabilities-list-bit-on-for-older-RHEL-machine-types.patch +Patch1051: kvm-misc-disable-s3-s4-by-default.patch +Patch1052: kvm-pc-rhel6-compat-enable-S3-S4-for-6-1-and-lower-machine-types.patch +Patch1058: kvm-misc-Disable-EFI-enabled-roms.patch +Patch1059: kvm-pc-set-compat-pmu-property-for-rhel6-x-machine-types.patch +Patch1063: kvm-misc-qga-fsfreeze-main-hook-adapt-to-RHEL-7-RH-only.patch +Patch1065: kvm-misc-add-qxl_screendump-monitor-command.patch +Patch1066: kvm-pc_piix-disable-CPUID_SEP-for-6-4-0-machine-types-and-below.patch +Patch1067: kvm-pc-set-level-xlevel-correctly-on-486-qemu32-CPU-models-for-rhel6-x.patch +Patch1068: kvm-pc-Remove-incorrect-rhel6-x-compat-model-value-for.patch +Patch1069: kvm-pc-rhel6-x-has-x2apic-present-on-Conroe-Penryn-Nehalem-CPU-models.patch +Patch1070: kvm-pc-set-compat-CPUID-0x80000001-EDX-bits-on-Westmere-for-rhel6-x.patch +Patch1071: kvm-pc-Remove-PCLMULQDQ-from-Westmere-on-rhel6-x-machine-types.patch +Patch1072: kvm-pc-SandyBridge-rhel6-x-compat-fixes.patch +Patch1073: kvm-pc-Haswell-doesn-t-have-rdtscp-on-rhel6-x.patch +Patch1076: kvm-qemu-iotests-Remove-lsi53c895a-tests-from-051.patch +Patch1077: kvm-misc-Remove-i82550-network-card-emulation.patch +Patch1078: kvm-misc-Remove-usb-wacom-tablet.patch +Patch1079: kvm-misc-Disable-usb-uas.patch +Patch1081: kvm-misc-Remove-no-hpet-option.patch +Patch1082: kvm-misc-Disable-isa-parallel.patch +Patch1083: kvm-misc-rhel6-compat-usb-serial-numbers.patch +Patch1084: kvm-qga-move-logfiles-to-new-directory-for-easier-SELinux-labeling-RHEL.patch +Patch1085: kvm-target-i386-add-cpu64-rhel6-CPU-model.patch +Patch1090: kvm-pc-rhel6-doesn-t-have-APIC-on-pentium-CPU-models.patch +Patch1091: kvm-pc-RHEL-6-had-x2apic-set-on-Opteron_G-123.patch +Patch1092: kvm-pc-RHEL-6-don-t-have-RDTSCP.patch +Patch1093: kvm-pc_piix-disable-mixer-for-6-4-0-machine-types-and-below.patch +Patch1098: kvm-acpi-piix4-Enable-qemu-kvm-compatibility-mode.patch +Patch1099: kvm-target-i386-support-loading-of-cpu-xsave-subsection.patch +Patch1101: kvm-rbd-link-and-load-librbd-dynamically.patch +Patch1102: kvm-rbd-Only-look-for-qemu-specific-copy-of-librbd-so-1.patch +Patch1104: kvm-misc-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch +Patch1106: kvm-rhel-Drop-ivshmem-device.patch +Patch1109: kvm-misc-Fix-migration-from-rhel6-5-to-rhel7-with-ipxe.patch +Patch1110: kvm-rhel-Revert-downstream-changes-to-unused-default-configs-mak.patch +Patch1111: kvm-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch +Patch1112: kvm-rhel-Drop-isa-vga-device.patch +Patch1113: kvm-rhel-Make-isa-cirrus-vga-device-unavailable.patch +Patch1114: kvm-rhel-Make-ccid-card-emulated-device-unavailable.patch +Patch1115: kvm-misc-Partially-revert-rhel-Drop-cfi-pflash01-and-isa-ide-device.patch +Patch1116: kvm-misc-Partial-commit-of-87123eabfa1ee7cef51066fd7fd8e7d5ecd0419f-block.patch +Patch1118: kvm-migration-disable-live-block-migration-b-i-for-rhel-and-rhev.patch +Patch1119: kvm-misc-Build-ceph-rbd-only-for-rhev.patch +Patch1121: kvm-rhel-Make-pci-serial-2x-and-pci-serial-4x-device-unavailable.patch +Patch1122: kvm-monitor-Remove-pci_add-command-for-Red-Hat-Enterprise-Linux.patch +Patch1123: kvm-monitor-Remove-pci_del-command-for-Red-Hat-Enterprise-Linux.patch +Patch1124: kvm-monitor-Remove-usb_add-del-commands-for-Red-Hat-Enterprise-Linux.patch +Patch1125: kvm-monitor-Remove-host_net_add-remove-for-Red-Hat-Enterprise-Linux.patch +Patch1131: kvm-misc-don-t-disable-ctrl_mac_addr-feature-for-6-5-machine-RHEL-only.patch +Patch1136: kvm-pc-drop-virtio-balloon-pci-event_idx-compat-property.patch +Patch1137: kvm-misc-introduce-RFQDN_REDHAT-RHEL-6-7-fwd.patch +Patch1142: kvm-misc-fix-intel-hda-live-migration.patch +Patch1145: kvm-pci-assign-cap-number-of-devices-that-can-be-assigned.patch +Patch1146: kvm-vfio-cap-number-of-devices-that-can-be-assigned.patch +Patch1148: kvm-QMP-Forward-port-__com-redhat_drive_del-from-RHEL-6.patch +Patch1149: kvm-QMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch +Patch1150: kvm-HMP-Forward-port-__com-redhat_drive_add-from-RHEL-6.patch +Patch1151: kvm-QMP-Document-throttling-parameters-of-__com-redhat_drive_add.patch +Patch1152: kvm-misc-Add-support-statement-to-help-output.patch +Patch1153: kvm-__com-redhat_qxl_screendump-add-docs.patch +Patch1154: kvm-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch +Patch1158: kvm-misc-enable-pvticketlocks-by-default.patch +Patch1159: kvm-pc-Fix-rhel6-3dnow-3dnowext-compat-bits.patch +Patch1160: kvm-misc-switch-rhel7-machine-types-to-big-bios.patch +Patch1162: kvm-misc-Add-back-no-hpet-but-ignore-it.patch +Patch1163: kvm-misc-use-recommended-max-vcpu-count.patch +Patch1164: kvm-pc-Create-pc_compat_rhel-functions.patch +Patch1165: kvm-pc-Enable-x2apic-by-default-on-more-recent-CPU-models-v2.patch +Patch1169: kvm-pc-Disable-RDTSCP-unconditionally-on-rhel6-machine-types.patch +Patch1170: kvm-pc-Disable-RDTSCP-on-AMD-CPU-models.patch +Patch1171: kvm-usb-add-microsoft-os-descriptors-compat-property.patch +Patch1172: kvm-configure-add-option-to-disable-fstack-protect.patch +Patch1175: kvm-misc-fix-guest-physical-bits-to-match-host-to-go-beyond-1TB-guests.patch +Patch1176: kvm-QMP-Relax-__com-redhat_drive_add-parameter-checking.patch +Patch1178: kvm-pc-Add-RHEL6-e1000-gPXE-image.patch +Patch1180: kvm-configure-Fix-bugs-preventing-Ceph-inclusion.patch +Patch1181: kvm-pc-Use-cpu64-rhel6-CPU-model-by-default-on-rhel6-machine-types.patch +Patch1182: kvm-target-i386-Copy-cpu64-rhel6-definition-into-qemu64.patch +Patch1186: kvm-pc-add-hot_add_cpu-callback-to-all-machine-types.patch +Patch1188: kvm-misc-Remove-CONFIG_NE2000_ISA-from-all-config-files.patch +Patch1191: kvm-misc-RHEL7-RHEV7-1-2-0-migration-compatibility.patch +Patch1192: kvm-misc-remove-superfluous-hot_add_cpu-and-max_cpus-initializers-RHEV-7-1.patch +Patch1193: kvm-misc-set-model-in-PC_RHEL6_5_COMPAT-for-qemu32-VCPU-RHEV-7-1-only.patch +Patch1194: kvm-misc-Undo-Enable-x2apic-by-default-for-compatibility.patch +Patch1195: kvm-qemu_loadvm_state-shadow-SeaBIOS-for-VM-incoming-from-RHEL-6-host.patch +Patch1198: kvm-rhel-SMBIOS-type-1-branding.patch +Patch1199: kvm-misc-Use-legacy-SMBIOS-for-rhel-machine-types.patch +Patch1201: kvm-misc-Disable-new-devices-in-qemu-2-1.patch +Patch1202: kvm-scripts-qapi-event-py-support-vendor-extension.patch +Patch1203: kvm-qmp-add-error-reason-to-the-BLOCK_IO_ERROR-event.patch +Patch1204: kvm-qmp-improve-debuggability-of-BLOCK_IO_ERROR-event.patch +Patch1205: kvm-uhci-UNfix-irq-routing-for-RHEL-6-machtypes-RHEL-only.patch +Patch1208: kvm-misc-Include-OHCI-device-for-ppc64.patch +Patch1211: kvm-arm64-64K-pages-and-1024MB-guest.patch +# For bz#1076326 - qemu-kvm does not quit when booting guest w/ 161 vcpus and "-no-kvm" +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1212: ga-exit-when-no-kvm-and-vcpu-count-160.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1213: ga-Revert-Use-legacy-SMBIOS-for-rhel-machine-types.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1214: ga-rhel-Use-SMBIOS-legacy-mode-for-machine-types-7.0.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1215: ga-rhel-Suppress-hotplug-memory-address-space-for-machi.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1216: ga-rhel-Fix-ACPI-table-size-for-machine-types-7.0.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1217: ga-rhel-Fix-missing-pc-q35-rhel7.0.0-compatibility-prop.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1218: ga-rhel-virtio-scsi-pci.any_layout-off-for-machine-type.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1219: ga-rhel-PIIX4_PM.memory-hotplug-support-off-for-machine.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1220: ga-rhel-apic.version-0x11-for-machine-types-7.0.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1221: ga-rhel-nec-usb-xhci.superspeed-ports-first-off-for-mac.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1222: ga-rhel-pci-serial.prog_if-0-for-machine-types-7.0.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1223: ga-rhel-virtio-net-pci.guest_announce-off-for-machine-t.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1224: ga-rhel-ICH9-LPC.memory-hotplug-support-off-for-machine.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1225: ga-rhel-.power_controller_present-off-for-machine-types.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1226: ga-rhel-virtio-net-pci.ctrl_guest_offloads-off-for-mach.patch +# For bz#1118665 - Migration: rhel7.0->rhev7.1 +Patch1227: ga-pc-q35-rhel7.0.0-Disable-x2apic-default.patch +# For bz#1003432 - qemu-kvm should not allow different virtio serial port use the same name +Patch1228: ga-virtio-serial-create-a-linked-list-of-all-active-dev.patch +# For bz#1003432 - qemu-kvm should not allow different virtio serial port use the same name +Patch1229: ga-virtio-serial-search-for-duplicate-port-names-before.patch +# For bz#1111351 - RHEL-6.6 migration compatibility: CPU models +Patch1230: ga-pc-RHEL-6-CPUID-compat-code-for-Broadwell-CPU-model.patch +# For bz#1129259 - Add traces to virtio-rng device +Patch1231: kvm-virtio-rng-add-some-trace-events.patch +# For bz#1126976 - VHDX image format does not work on PPC64 (Endian issues) +Patch1232: kvm-block-vhdx-add-error-check.patch +# For bz#1126976 - VHDX image format does not work on PPC64 (Endian issues) +Patch1233: kvm-block-VHDX-endian-fixes.patch +# For bz#1133736 - qemu should provide iothread and x-data-plane properties for /usr/libexec/qemu-kvm -device virtio-blk-pci,? +Patch1234: kvm-qdev-monitor-include-QOM-properties-in-device-FOO-he.patch +# For bz#1136752 - virtio-blk dataplane support for block_resize and hot unplug +Patch1235: kvm-block-acquire-AioContext-in-qmp_block_resize.patch +# For bz#1136752 - virtio-blk dataplane support for block_resize and hot unplug +Patch1236: kvm-virtio-blk-allow-block_resize-with-dataplane.patch +# For bz#1136752 - virtio-blk dataplane support for block_resize and hot unplug +Patch1237: kvm-block-acquire-AioContext-in-do_drive_del.patch +# For bz#1136752 - virtio-blk dataplane support for block_resize and hot unplug +Patch1238: kvm-virtio-blk-allow-drive_del-with-dataplane.patch +# For bz#1093023 - provide RHEL-specific machine types in QEMU +Patch1239: kvm-rhel-Add-rhel7.1.0-machine-types.patch +# For bz#1136512 - rhel7.0.0 machtype compat after CVE-2014-5263 vmstate_xhci_event: fix unterminated field list +Patch1240: kvm-vmstate_xhci_event-bug-compat-for-rhel7.0.0-machine-.patch +# For bz#1139706 - pflash (UEFI varstore) migration shortcut for libvirt [RHEV] +Patch1241: kvm-pflash_cfi01-fixup-stale-DPRINTF-calls.patch +# For bz#1139706 - pflash (UEFI varstore) migration shortcut for libvirt [RHEV] +Patch1242: kvm-pflash_cfi01-write-flash-contents-to-bdrv-on-incomin.patch +# For bz#1140145 - qemu-kvm crashed when doing iofuzz testing +Patch1243: kvm-ide-Fix-segfault-when-flushing-a-device-that-doesn-t.patch +# For bz#1138579 - Migration failed with nec-usb-xhci from RHEL7. 0 to RHEL7.1 +Patch1244: kvm-xhci-PCIe-endpoint-migration-compatibility-fix.patch +# For bz#1138579 - Migration failed with nec-usb-xhci from RHEL7. 0 to RHEL7.1 +Patch1245: kvm-rh-machine-types-xhci-PCIe-endpoint-migration-compat.patch +# For bz#1055532 - QEMU should abort when invalid CPU flag name is used +Patch1246: kvm-target-i386-Reject-invalid-CPU-feature-names-on-the-.patch +# For bz#1113998 - RHEL Power/KVM (qemu-kvm-rhev) +Patch1247: kvm-target-ppc-virtex-ml507-machine-type-should-depend-o.patch +# For bz#1113998 - RHEL Power/KVM (qemu-kvm-rhev) +Patch1248: kvm-RHEL-only-Disable-tests-that-don-t-work-with-RHEL-bu.patch +# For bz#1113998 - RHEL Power/KVM (qemu-kvm-rhev) +Patch1249: kvm-RHEL-onlyy-Disable-unused-ppc-machine-types.patch +Patch1250: kvm-RHEL-only-Remove-unneeded-devices-from-ppc64-qemu-kv.patch +Patch1251: kvm-RHEL-only-Replace-upstream-pseries-machine-types-wit.patch +# For bz#1123349 - [FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device +Patch1252: kvm-scsi-bus-prepare-scsi_req_new-for-introduction-of-pa.patch +# For bz#1123349 - [FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device +Patch1253: kvm-scsi-bus-introduce-parse_cdb-in-SCSIDeviceClass-and-.patch +# For bz#1123349 - [FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device +Patch1254: kvm-scsi-block-extract-scsi_block_is_passthrough.patch +# For bz#1123349 - [FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device +Patch1255: kvm-scsi-block-scsi-generic-implement-parse_cdb.patch +# For bz#1123349 - [FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device +Patch1256: kvm-virtio-scsi-implement-parse_cdb.patch +# For bz#1135893 - qemu-kvm should report an error message when host's freehugepage memory < domain's memory +Patch1257: kvm-exec-file_ram_alloc-print-error-when-prealloc-fails.patch +# For bz#1144089 - [HP 7.1 FEAT] Increase qemu-kvm-rhev's VCPU limit to 240 +Patch1258: kvm-pc-increase-maximal-VCPU-count-to-240.patch + +BuildRequires: zlib-devel +BuildRequires: SDL-devel +BuildRequires: which +BuildRequires: texi2html +BuildRequires: gnutls-devel +BuildRequires: cyrus-sasl-devel +BuildRequires: libtool +BuildRequires: libaio-devel +BuildRequires: rsync +BuildRequires: python +BuildRequires: pciutils-devel +BuildRequires: pulseaudio-libs-devel +BuildRequires: libiscsi-devel +BuildRequires: ncurses-devel +BuildRequires: libattr-devel +BuildRequires: libusbx-devel +%if 0%{have_usbredir} +BuildRequires: usbredir-devel >= 0.6 +%endif +BuildRequires: texinfo +%if 0%{have_spice} +BuildRequires: spice-protocol >= 0.12.2 +BuildRequires: spice-server-devel >= 0.12.0 +%endif +%if 0%{have_seccomp} +BuildRequires: libseccomp-devel >= 1.0.0 +%endif +# For network block driver +BuildRequires: libcurl-devel +BuildRequires: libssh2-devel +%if 0%{have_gluster} +# For gluster block driver +BuildRequires: glusterfs-api-devel +BuildRequires: glusterfs-devel +%endif +# We need both because the 'stap' binary is probed for by configure +BuildRequires: systemtap +BuildRequires: systemtap-sdt-devel +# For smartcard NSS support +BuildRequires: nss-devel +# For XFS discard support in raw-posix.c +# For VNC JPEG support +BuildRequires: libjpeg-devel +# For VNC PNG support +BuildRequires: libpng-devel +# For uuid generation +BuildRequires: libuuid-devel +# For BlueZ device support +BuildRequires: bluez-libs-devel +# For Braille device support +BuildRequires: brlapi-devel +# For test suite +BuildRequires: check-devel +# For virtfs +BuildRequires: libcap-devel +# Hard requirement for version >= 1.3 +BuildRequires: pixman-devel +# Documentation requirement +BuildRequires: perl-podlators +BuildRequires: texinfo +# For rdma +%if 0%{?have_librdma:1} +BuildRequires: librdmacm-devel +%endif +# iasl and cpp for acpi generation (not a hard requirement as we can use +# pre-compiled files, but it's better to use this) +%ifarch %{ix86} x86_64 +BuildRequires: iasl +BuildRequires: cpp +%endif + + +%define qemudocdir %{_docdir}/%{pkgname} + +%description +qemu-kvm is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides an agent to run inside guests, which communicates +with the host over a virtio-serial channel named "org.qemu.guest_agent.0" + +This package does not need to be installed on the host OS. + +%post +%systemd_post qemu-guest-agent.service + +%preun +%systemd_preun qemu-guest-agent.service + +%postun +%systemd_postun_with_restart qemu-guest-agent.service + +%prep +%setup -q -n qemu-%{version} + +# if patch fuzzy patch applying will be forbidden +%define with_fuzzy_patches 0 +%if %{with_fuzzy_patches} + patch_command='patch -p1 -s' +%else + patch_command='patch -p1 -F1 -s' +%endif + +ApplyPatch() +{ + local patch=$1 + shift + if [ ! -f $RPM_SOURCE_DIR/$patch ]; then + exit 1 + fi + case "$patch" in + *.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; + *.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; + *) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;; + esac +} + +# don't apply patch if it's empty or does not exist +ApplyOptionalPatch() +{ + local patch=$1 + shift + if [ ! -f $RPM_SOURCE_DIR/$patch ]; then + return 0 + fi + local C=$(wc -l $RPM_SOURCE_DIR/$patch | awk '{print $1}') + if [ "$C" -gt 9 ]; then + ApplyPatch $patch ${1+"$@"} + fi +} + + +%patch1005 -p1 +%patch1006 -p1 +%patch1008 -p1 +%patch1009 -p1 +%patch1010 -p1 +%patch1011 -p1 +%patch1014 -p1 +%patch1016 -p1 +%patch1017 -p1 +%patch1032 -p1 +%patch1036 -p1 +%patch1037 -p1 +%patch1038 -p1 +%patch1039 -p1 +%patch1040 -p1 +%patch1041 -p1 +%patch1042 -p1 +%patch1043 -p1 +%patch1044 -p1 +%patch1045 -p1 +%patch1046 -p1 +%patch1047 -p1 +%patch1048 -p1 +%patch1049 -p1 +%patch1050 -p1 +%patch1051 -p1 +%patch1052 -p1 +%patch1058 -p1 +%patch1059 -p1 +%patch1063 -p1 +%patch1065 -p1 +%patch1066 -p1 +%patch1067 -p1 +%patch1068 -p1 +%patch1069 -p1 +%patch1070 -p1 +%patch1071 -p1 +%patch1072 -p1 +%patch1073 -p1 +%patch1076 -p1 +%patch1077 -p1 +%patch1078 -p1 +%patch1079 -p1 +%patch1081 -p1 +%patch1082 -p1 +%patch1083 -p1 +%patch1084 -p1 +%patch1085 -p1 +%patch1090 -p1 +%patch1091 -p1 +%patch1092 -p1 +%patch1093 -p1 +%patch1098 -p1 +%patch1099 -p1 +%patch1101 -p1 +%patch1102 -p1 +%patch1104 -p1 +%patch1106 -p1 +%patch1109 -p1 +%patch1110 -p1 +%patch1111 -p1 +%patch1112 -p1 +%patch1113 -p1 +%patch1114 -p1 +%patch1115 -p1 +%patch1116 -p1 +%patch1118 -p1 +%patch1119 -p1 +%patch1121 -p1 +%patch1122 -p1 +%patch1123 -p1 +%patch1124 -p1 +%patch1125 -p1 +%patch1131 -p1 +%patch1136 -p1 +%patch1137 -p1 +%patch1142 -p1 +%patch1145 -p1 +%patch1146 -p1 +%patch1148 -p1 +%patch1149 -p1 +%patch1150 -p1 +%patch1151 -p1 +%patch1152 -p1 +%patch1153 -p1 +%patch1154 -p1 +%patch1158 -p1 +%patch1159 -p1 +%patch1160 -p1 +%patch1162 -p1 +%patch1163 -p1 +%patch1164 -p1 +%patch1165 -p1 +%patch1169 -p1 +%patch1170 -p1 +%patch1171 -p1 +%patch1172 -p1 +%patch1175 -p1 +%patch1176 -p1 +%patch1178 -p1 +%patch1180 -p1 +%patch1181 -p1 +%patch1182 -p1 +%patch1186 -p1 +%patch1188 -p1 +%patch1191 -p1 +%patch1192 -p1 +%patch1193 -p1 +%patch1194 -p1 +%patch1195 -p1 +%patch1198 -p1 +%patch1199 -p1 +%patch1201 -p1 +%patch1202 -p1 +%patch1203 -p1 +%patch1204 -p1 +%patch1205 -p1 +%patch1208 -p1 +%patch1211 -p1 +%patch1212 -p1 +%patch1213 -p1 +%patch1214 -p1 +%patch1215 -p1 +%patch1216 -p1 +%patch1217 -p1 +%patch1218 -p1 +%patch1219 -p1 +%patch1220 -p1 +%patch1221 -p1 +%patch1222 -p1 +%patch1223 -p1 +%patch1224 -p1 +%patch1225 -p1 +%patch1226 -p1 +%patch1227 -p1 +%patch1228 -p1 +%patch1229 -p1 +%patch1230 -p1 +%patch1231 -p1 +%patch1232 -p1 +%patch1233 -p1 +%patch1234 -p1 +%patch1235 -p1 +%patch1236 -p1 +%patch1237 -p1 +%patch1238 -p1 +%patch1239 -p1 +%patch1240 -p1 +%patch1241 -p1 +%patch1242 -p1 +%patch1243 -p1 +%patch1244 -p1 +%patch1245 -p1 +%patch1246 -p1 +%patch1247 -p1 +%patch1248 -p1 +%patch1249 -p1 +%patch1250 -p1 +%patch1251 -p1 +%patch1252 -p1 +%patch1253 -p1 +%patch1254 -p1 +%patch1255 -p1 +%patch1256 -p1 +%patch1257 -p1 +%patch1258 -p1 + +ApplyOptionalPatch qemu-kvm-test.patch + +%build +buildarch="%{kvm_target}-softmmu" + +# --build-id option is used for giving info to the debug packages. +extraldflags="-Wl,--build-id"; +buildldflags="VL_LDFLAGS=-Wl,--build-id" + +%ifarch s390 + # drop -g flag to prevent memory exhaustion by linker + %global optflags %(echo %{optflags} | sed 's/-g//') + sed -i.debug 's/"-g $CFLAGS"/"$CFLAGS"/g' configure +%endif + +./configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --sysconfdir=%{_sysconfdir} \ + --interp-prefix=%{_prefix}/qemu-%%M \ + --audio-drv-list=pa,alsa \ + --with-confsuffix=/%{pkgname} \ + --localstatedir=%{_localstatedir} \ + --libexecdir=%{_libexecdir} \ + --with-pkgversion=%{pkgname}-%{version}-%{release} \ + --disable-strip \ + --disable-qom-cast-debug \ + --extra-ldflags="$extraldflags -pie -Wl,-z,relro -Wl,-z,now" \ + --extra-cflags="%{optflags} -fPIE -DPIE" \ + --enable-trace-backend=dtrace \ + --enable-werror \ + --disable-xen \ + --disable-virtfs \ + --enable-kvm \ + --enable-libusb \ +%if 0%{have_spice} + --enable-spice \ +%else + --disable-spice \ +%endif +%if 0%{have_seccomp} + --enable-seccomp \ +%else + --disable-seccomp \ +%endif +%if 0%{have_fdt} + --enable-fdt \ +%else + --disable-fdt \ +%endif + --enable-docs \ + --disable-sdl \ + --disable-debug-tcg \ + --disable-sparse \ + --disable-brlapi \ + --disable-bluez \ + --disable-vde \ + --disable-curses \ + --disable-curl \ + --enable-vnc-tls \ + --enable-vnc-sasl \ + --enable-linux-aio \ + --enable-smartcard-nss \ +%if 0%{have_usbredir} + --enable-usb-redir \ +%else + --disable-usb-redir \ +%endif + --enable-vnc-png \ + --disable-vnc-jpeg \ + --enable-vnc-ws \ + --enable-uuid \ + --disable-vhost-scsi \ + --enable-guest-agent \ + --disable-tpm \ + --enable-live-block-ops \ + --enable-ceph-support \ + --disable-live-block-migration \ +%if 0%{have_gluster} + --enable-glusterfs \ + --block-drv-rw-whitelist=qcow2,raw,file,host_device,nbd,iscsi,gluster,rbd \ +%else + --disable-glusterfs \ + --block-drv-rw-whitelist=qcow2,raw,file,host_device,nbd,iscsi,rbd \ +%endif + --block-drv-ro-whitelist=vmdk,vhdx,vpc,ssh \ + --target-list= \ + --cpu=%{kvm_target} \ + "$@" + +echo "config-host.mak contents:" +echo "===" +cat config-host.mak +echo "===" + +make qemu-ga %{?_smp_mflags} $buildldflags + +%install +%define _udevdir %(pkg-config --variable=udevdir udev)/rules.d + + +# For the qemu-guest-agent subpackage, install: +# - the systemd service file and the udev rules: +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_udevdir} +install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir} +install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_udevdir} + +# - the environment file for the systemd service: +install -D -p -m 0644 %{SOURCE3} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/qemu-ga + +# - the fsfreeze hook script: +install -D --preserve-timestamps \ + scripts/qemu-guest-agent/fsfreeze-hook \ + $RPM_BUILD_ROOT%{_sysconfdir}/qemu-ga/fsfreeze-hook + +# - the directory for user scripts: +mkdir $RPM_BUILD_ROOT%{_sysconfdir}/qemu-ga/fsfreeze-hook.d + +# - and the fsfreeze script samples: +mkdir --parents $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/qemu-ga/fsfreeze-hook.d/ +install --preserve-timestamps --mode=0644 \ + scripts/qemu-guest-agent/fsfreeze-hook.d/*.sample \ + $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/qemu-ga/fsfreeze-hook.d/ + +# - Install dedicated log directory: +mkdir -p -v $RPM_BUILD_ROOT%{_localstatedir}/log/qemu-ga/ + +mkdir -p $RPM_BUILD_ROOT%{_bindir} +install -c -m 0755 qemu-ga ${RPM_BUILD_ROOT}%{_bindir}/qemu-ga + +%files + %defattr(-,root,root,-) + %doc COPYING README + %{_bindir}/qemu-ga + %{_unitdir}/qemu-guest-agent.service + %{_udevdir}/99-qemu-guest-agent.rules + %config(noreplace) %{_sysconfdir}/sysconfig/qemu-ga + %{_sysconfdir}/qemu-ga + %{_datadir}/%{pkgname}/qemu-ga + %dir %{_localstatedir}/log/qemu-ga + + +%changelog +* Tue Oct 21 2014 Miroslav Rezanina - 2.1.0-4.el7 +- kvm-Mark-etc-sysconfig-qemu-ga-as-config-noreplace.patch [bz#1150924] +- Resolves: bz#1150924 + (/etc/sysconfig/qemu-ga is replaced when updated) + +* Thu Aug 28 2014 Miroslav Rezanina - 2.1.0-3.el7 +- Allow building qemu-guest-agent on ppc64le +- Synchronize with qemu-kvm-rhev-2.1.0-3.el7 +- Resolves: bz#1132718 + (qemu-guest-agent fails to build for ppc64le) + +* Sat Aug 02 2014 Miroslav Rezanina - 2.1.0-2.el7 +- Create separate qemu-guest-agent package based on qemu-kvm-rhev-2.1.0-1.el7 [bz#1117096] +- Resolves: #bz1117096 + +* Sat Aug 02 2014 Miroslav Rezanina - 2.1.0-1.el7 +- Rebase to 2.1.0 [bz#1121609] +- Resolves: bz#1121609 + (Rebase qemu-kvm-rhev to qemu 2.1) +