Compare commits

..

6 Commits

Author SHA1 Message Date
Cole Robinson 0831c388ec Add patches 2015-06-06 11:17:48 -04:00
Cole Robinson b59373e03c polkit: Allow password-less access for 'libvirt' group (bz #957300) 2015-06-06 11:12:12 -04:00
Cole Robinson d617f580c5 Rebased to version 1.2.9.3
Fix getVersion() after installing qemu (bz #1000116)
Fix autosocket setup with qemu:///session (bz #1044561, bz #1105274)
Ignore storage volumes with non-ascii in names (bz #1066564)
Don't generate invalid system nodedev XML (bz #1184131)
Fix vhost-user XML (bz #1190842)
Fix crash via race when unrefing rpc identity object (bz #1203030)
Fix domcapabilities failure with ppc64le (bz #1209948)
Fix snapshot-revert with cpu host-passthrough (bz #1030793)
Fix starting VM with emulator pinning (bz #1214434)
Fix virDomainBlockCopyRebase selinux failure (bz #1214846)
Add {Haswell,Broadwell}-noTSX CPU models (bz #1182650)
Report original error when QMP probing fails (bz #1178054)
Don't lose VMs on libvirtd restart if qemu is uninstalled (bz #1099847)
Ignore storage volumes that libvirt can't open (bz #1103308)
2015-04-28 11:58:34 -04:00
Cole Robinson 7415198273 Rebased to version 1.2.9.2
CVE-2014-8131: deadlock and segfault in qemuConnectGetAllDomainStats (bz #1172571)
CVE-2015-0236: missing ACL check for the VIR_DOMAIN_XML_SECURE flag in save images and snapshots objects (bz #1185769)
CVE-2014-8136: local denial of service in qemu/qemu_driver.c (bz #1176179)
Fix crash parsing nbd URIs (bz #1188644)
Fix domain startup failing with 'strict' mode in numatune (bz #1168672)
2015-02-07 22:00:40 -05:00
Cole Robinson 0ceadbef50 Don't reject aarch64 + uefi 2014-12-02 15:21:18 -05:00
Cole Robinson 82f2674fae Rebased to version 1.2.9.1
ppc64le fixes (bz #1163439)
Fix caps probing when KVM is disabled (bz #1160318)
2014-11-15 19:42:16 -05:00
12 changed files with 3100 additions and 1465 deletions
-31
View File
@@ -1,31 +0,0 @@
[suppress_function]
symbol_version_regexp = LIBVIRT_PRIVATE.*
soname_regexp = libvirt\\.so.*
[suppress_function]
symbol_version_regexp = LIBVIRT_ADMIN_PRIVATE.*
soname_regexp = libvirt-admin\\.so.*
[suppress_variable]
symbol_version_regexp = LIBVIRT_PRIVATE.*
soname_regexp = libvirt\\.so.*
[suppress_variable]
symbol_version_regexp = LIBVIRT_ADMIN_PRIVATE.*
soname_regexp = libvirt-admin\\.so.*
[suppress_function]
symbol_version_regexp = .*
soname_regexp = libvirt_storage_.*\\.so.*
[suppress_variable]
symbol_version_regexp = .*
soname_regexp = libvirt_storage_.*\\.so.*
[suppress_function]
symbol_version_regexp = .*
soname_regexp = libvirt_driver_.*\\.so.*
[suppress_variable]
symbol_version_regexp = .*
soname_regexp = libvirt_driver_.*\\.so.*
+1 -1
View File
@@ -2,4 +2,4 @@
*.rpm
i686
x86_64
libvirt-*.tar.xz
libvirt-*.tar.gz
@@ -0,0 +1,206 @@
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 22:51:26 +0530
Subject: [PATCH] Cpu: Add support for Power LE Architecture.
This adds support for PowerPC Little Endian architecture.,
and allows libvirt to spawn VMs based on 'ppc64le' architecture.
Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit da636d83dc6b1d070a705786b4daef8644eaca13)
---
src/conf/domain_conf.c | 2 +-
src/cpu/cpu_powerpc.c | 2 +-
src/qemu/qemu_capabilities.c | 6 +++---
src/qemu/qemu_command.c | 22 +++++++++++-----------
src/qemu/qemu_domain.c | 1 +
src/util/virarch.h | 3 +++
6 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cfdf66c..8aca289 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9867,7 +9867,7 @@ virDomainVideoDefaultType(const virDomainDef *def)
(STREQ(def->os.type, "xen") ||
STREQ(def->os.type, "linux")))
return VIR_DOMAIN_VIDEO_TYPE_XEN;
- else if (def->os.arch == VIR_ARCH_PPC64)
+ else if ARCH_IS_PPC64(def->os.arch)
return VIR_DOMAIN_VIDEO_TYPE_VGA;
else
return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 67cb9ff..d591c18 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -38,7 +38,7 @@
VIR_LOG_INIT("cpu.cpu_powerpc");
-static const virArch archs[] = { VIR_ARCH_PPC64 };
+static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE };
struct ppc_vendor {
char *name;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index be4d01f..34d753c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -632,7 +632,7 @@ virQEMUCapsProbeCPUModels(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid)
if (qemuCaps->arch == VIR_ARCH_I686 ||
qemuCaps->arch == VIR_ARCH_X86_64) {
parse = virQEMUCapsParseX86Models;
- } else if (qemuCaps->arch == VIR_ARCH_PPC64) {
+ } else if ARCH_IS_PPC64(qemuCaps->arch) {
parse = virQEMUCapsParsePPCModels;
} else {
VIR_DEBUG("don't know how to parse %s CPU models",
@@ -2018,7 +2018,7 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
return true;
if (def->os.arch == VIR_ARCH_PPC ||
- def->os.arch == VIR_ARCH_PPC64) {
+ ARCH_IS_PPC64(def->os.arch)) {
/*
* Usage of pci.0 naming:
*
@@ -3600,7 +3600,7 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
return false;
- if ((def->os.arch == VIR_ARCH_PPC) || (def->os.arch == VIR_ARCH_PPC64)) {
+ if ((def->os.arch == VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch)) {
/* only pseries need -device spapr-vty with -chardev */
return (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO);
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index aeb4eec..c5c48bf 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -713,7 +713,7 @@ qemuSetSCSIControllerModel(virDomainDefPtr def,
return -1;
}
} else {
- if ((def->os.arch == VIR_ARCH_PPC64) &&
+ if (ARCH_IS_PPC64(def->os.arch) &&
STRPREFIX(def->os.machine, "pseries")) {
*model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) {
@@ -1260,7 +1260,7 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
for (i = 0; i < def->nserials; i++) {
if (def->serials[i]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
- (def->os.arch == VIR_ARCH_PPC64) &&
+ ARCH_IS_PPC64(def->os.arch) &&
STRPREFIX(def->os.machine, "pseries"))
def->serials[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
if (qemuAssignSpaprVIOAddress(def, &def->serials[i]->info,
@@ -1269,7 +1269,7 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
}
if (def->nvram) {
- if (def->os.arch == VIR_ARCH_PPC64 &&
+ if (ARCH_IS_PPC64(def->os.arch) &&
STRPREFIX(def->os.machine, "pseries"))
def->nvram->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
if (qemuAssignSpaprVIOAddress(def, &def->nvram->info,
@@ -4191,7 +4191,7 @@ qemuBuildUSBControllerDevStr(virDomainDefPtr domainDef,
model = def->model;
if (model == -1) {
- if (domainDef->os.arch == VIR_ARCH_PPC64)
+ if ARCH_IS_PPC64(domainDef->os.arch)
model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
else
model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI;
@@ -8445,7 +8445,7 @@ qemuBuildCommandLine(virConnectPtr conn,
!qemuDomainMachineIsQ35(def) &&
(!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI) ||
(!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI) &&
- def->os.arch == VIR_ARCH_PPC64))) {
+ ARCH_IS_PPC64(def->os.arch)))) {
if (usblegacy) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Multiple legacy USB controllers are "
@@ -9643,7 +9643,7 @@ qemuBuildCommandLine(virConnectPtr conn,
}
if (def->nvram) {
- if (def->os.arch == VIR_ARCH_PPC64 &&
+ if (ARCH_IS_PPC64(def->os.arch) &&
STRPREFIX(def->os.machine, "pseries")) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVRAM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -9761,7 +9761,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
{
virBuffer cmd = VIR_BUFFER_INITIALIZER;
- if ((arch == VIR_ARCH_PPC64) && STRPREFIX(machine, "pseries")) {
+ if (ARCH_IS_PPC64(arch) && STRPREFIX(machine, "pseries")) {
if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) {
virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s",
@@ -10183,7 +10183,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
if (VIR_ALLOC(def->src) < 0)
goto error;
- if (((dom->os.arch == VIR_ARCH_PPC64) &&
+ if ((ARCH_IS_PPC64(dom->os.arch) &&
dom->os.machine && STRPREFIX(dom->os.machine, "pseries")))
def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
else
@@ -10276,7 +10276,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
} else if (STREQ(keywords[i], "if")) {
if (STREQ(values[i], "ide")) {
def->bus = VIR_DOMAIN_DISK_BUS_IDE;
- if (((dom->os.arch == VIR_ARCH_PPC64) &&
+ if ((ARCH_IS_PPC64(dom->os.arch) &&
dom->os.machine && STRPREFIX(dom->os.machine, "pseries"))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("pseries systems do not support ide devices '%s'"), val);
@@ -11521,7 +11521,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
}
if (STREQ(arg, "-cdrom")) {
disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM;
- if (((def->os.arch == VIR_ARCH_PPC64) &&
+ if ((ARCH_IS_PPC64(def->os.arch) &&
def->os.machine && STRPREFIX(def->os.machine, "pseries")))
disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
if (VIR_STRDUP(disk->dst, "hdc") < 0)
@@ -11537,7 +11537,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
disk->bus = VIR_DOMAIN_DISK_BUS_IDE;
else
disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
- if (((def->os.arch == VIR_ARCH_PPC64) &&
+ if ((ARCH_IS_PPC64(def->os.arch) &&
def->os.machine && STRPREFIX(def->os.machine, "pseries")))
disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bec7cf2..48e8acf 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -980,6 +980,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
break;
case VIR_ARCH_PPC64:
+ case VIR_ARCH_PPC64LE:
addPCIRoot = true;
addDefaultUSBKBD = true;
addDefaultUSBMouse = true;
diff --git a/src/util/virarch.h b/src/util/virarch.h
index d395e58..3206ce2 100644
--- a/src/util/virarch.h
+++ b/src/util/virarch.h
@@ -79,6 +79,9 @@ typedef enum {
(arch) == VIR_ARCH_PPC64LE ||\
(arch) == VIR_ARCH_PPCEMB)
+# define ARCH_IS_PPC64(arch) ((arch) == VIR_ARCH_PPC64 ||\
+ (arch) == VIR_ARCH_PPC64LE)
+
# define ARCH_IS_ARM(arch) ((arch) == VIR_ARCH_ARMV6L ||\
(arch) == VIR_ARCH_ARMV7L ||\
(arch) == VIR_ARCH_ARMV7B ||\
@@ -1,48 +0,0 @@
From 823a62ec8aac4fb75e6e281164f3eb56ae47597c Mon Sep 17 00:00:00 2001
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Tue, 1 Mar 2022 18:47:59 +0100
Subject: [PATCH] qemu: segmentation fault in virtqemud executing
qemuDomainUndefineFlags
Commit 5adfb3472342741c443ac91dee0abb18b5a3d038 causes a segmentation fault.
Stack trace of thread 664419:
#0 0x000003ff62ec553c in qemuDomainUndefineFlags (dom=0x3ff6c002810, flags=<optimized out>) at ../src/qemu/qemu_driver.c:6618
#1 0x000003ff876a7e5c in virDomainUndefineFlags (domain=domain@entry=0x3ff6c002810, flags=<optimized out>) at ../src/libvirt-domain.c:6519
#2 0x000002aa2b64a808 in remoteDispatchDomainUndefineFlags (server=0x2aa2c3d7880, msg=0x2aa2c3d2770, args=<optimized out>, rerr=0x3ff8287b950, client=<optimized out>)
at src/remote/remote_daemon_dispatch_stubs.h:13080
#3 remoteDispatchDomainUndefineFlagsHelper (server=0x2aa2c3d7880, client=<optimized out>, msg=0x2aa2c3d2770, rerr=0x3ff8287b950, args=<optimized out>, ret=0x0)
at src/remote/remote_daemon_dispatch_stubs.h:13059
#4 0x000003ff8758bbf4 in virNetServerProgramDispatchCall (msg=0x2aa2c3d2770, client=0x2aa2c3e3050, server=0x2aa2c3d7880, prog=0x2aa2c3d8010)
at ../src/rpc/virnetserverprogram.c:428
#5 virNetServerProgramDispatch (prog=0x2aa2c3d8010, server=server@entry=0x2aa2c3d7880, client=0x2aa2c3e3050, msg=0x2aa2c3d2770) at ../src/rpc/virnetserverprogram.c:302
#6 0x000003ff8758c260 in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:140
#7 virNetServerHandleJob (jobOpaque=0x2aa2c3e2d30, opaque=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:160
#8 0x000003ff874c49aa in virThreadPoolWorker (opaque=<optimized out>) at ../src/util/virthreadpool.c:164
#9 0x000003ff874c3f62 in virThreadHelper (data=<optimized out>) at ../src/util/virthread.c:256
#10 0x000003ff86c1cf8c in start_thread () from /lib64/libc.so.6
#11 0x000003ff86c9650e in thread_start () from /lib64/libc.so.6
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bcd9bdb436..8337eed510 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6615,7 +6615,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
}
}
- if (vm->def->os.loader->nvram) {
+ if (vm->def->os.loader && vm->def->os.loader->nvram) {
nvram_path = g_strdup(vm->def->os.loader->nvram);
} else if (vm->def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) {
qemuDomainNVRAMPathFormat(cfg, vm->def, &nvram_path);
--
2.34.1
@@ -0,0 +1,99 @@
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 22:52:44 +0530
Subject: [PATCH] PowerPC : Add support for launching VM in 'compat' mode.
PowerISA allows processors to run VMs in binary compatibility ("compat")
mode supporting an older version of ISA. QEMU has recently added support to
explicitly denote a VM running in compatibility mode through commit 6d9412ea
& 8dfa3a5e85. Now, a "compat" mode VM can be run by invoking this qemu
commandline on a POWER8 host: -cpu host,compat=power7.
This patch allows libvirt to exploit cpu mode 'host-model' to describe this
new mode for PowerKVM guests. For example, when a user wants to request a
power7 vm to run in compatibility mode on a Power8 host, this can be
described in XML as follows :
<cpu mode='host-model'>
<model>power7</model>
</cpu>
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit addce06c9221f948072cd222b56ea9c3f70ec066)
---
src/conf/cpu_conf.c | 1 +
src/cpu/cpu_powerpc.c | 11 ++---------
src/qemu/qemu_command.c | 10 +++++++++-
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index c09c352..74f0b16 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -624,6 +624,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
return 0;
formatModel = (def->mode == VIR_CPU_MODE_CUSTOM ||
+ def->mode == VIR_CPU_MODE_HOST_MODEL ||
(flags & VIR_DOMAIN_XML_UPDATE_CPU));
formatFallback = (def->type == VIR_CPU_TYPE_GUEST &&
(def->mode == VIR_CPU_MODE_HOST_MODEL ||
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index d591c18..4ea1835 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -562,8 +562,8 @@ ppcUpdate(virCPUDefPtr guest,
static virCPUDefPtr
ppcBaseline(virCPUDefPtr *cpus,
unsigned int ncpus,
- const char **models,
- unsigned int nmodels,
+ const char **models ATTRIBUTE_UNUSED,
+ unsigned int nmodels ATTRIBUTE_UNUSED,
unsigned int flags)
{
struct ppc_map *map = NULL;
@@ -583,13 +583,6 @@ ppcBaseline(virCPUDefPtr *cpus,
goto error;
}
- if (!cpuModelIsAllowed(model->name, models, nmodels)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("CPU model %s is not supported by hypervisor"),
- model->name);
- goto error;
- }
-
for (i = 0; i < ncpus; i++) {
const struct ppc_vendor *vnd;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c5c48bf..423692e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6217,7 +6217,9 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
*hasHwVirt = hasSVM > 0 ? true : false;
}
- if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
+ if ((cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) ||
+ ((cpu->mode == VIR_CPU_MODE_HOST_MODEL) &&
+ ARCH_IS_PPC64(def->os.arch))) {
const char *mode = virCPUModeTypeToString(cpu->mode);
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_HOST)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -6232,6 +6234,12 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
goto cleanup;
}
virBufferAddLit(buf, "host");
+
+ if (ARCH_IS_PPC64(def->os.arch) &&
+ cpu->mode == VIR_CPU_MODE_HOST_MODEL) {
+ virBufferAsprintf(buf, ",compat=%s", def->cpu->model);
+ }
+
} else {
if (VIR_ALLOC(guest) < 0)
goto cleanup;
@@ -0,0 +1,92 @@
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 22:58:33 +0530
Subject: [PATCH] PowerPC:Improve PVR handling to fall back to cpu generation.
IBM Power processors differ uniquely across generations (such as power6,
power7, power8). Each generation signifies a new PowerISA version
that exhibits features unique to that generation.
The higher 16 bits of PVR for IBM Power processors encode the CPU
generation, while the CPU chip (sub)version is encoded in lower 16 bits.
For all practical purposes of launching a VM, we care about the
generation which the vCPU will belong to, and not specifically the chip
version. This patch updates the libvirt PVR check to reflect this
relationship. It allows libvirt to select the right CPU generation
in case the exact match for a a specific CPU is not found.
Hence, there will no longer be a need to add each PowerPC CPU model to
cpu_map.xml; just adding entry for the matching ISA generation will
suffice.
It also contains changes to cpu_map.xml since processor generations
as understood by QEMU compat mode go as "power6", "power7" or "power8"
[Reference : QEMU commit 8dfa3a5e85 ]
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 1e911742287d964055f33ab76d53e673a9b4477f)
---
src/cpu/cpu_map.xml | 30 ++++++++++++++++++++++++++++++
src/cpu/cpu_powerpc.c | 8 ++++++++
2 files changed, 38 insertions(+)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index d181cd5..4ec49ca 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -637,5 +637,35 @@
<pvr value='0x004b0100'/>
</model>
+ <model name='power6'>
+ <vendor name='IBM'/>
+ <compat isa='2.05'/>
+ <pvr value='0x003e0000'/>
+ </model>
+
+ <model name='power7'>
+ <vendor name='IBM'/>
+ <compat isa='2.06'/>
+ <pvr value='0x003f0000'/>
+ </model>
+
+ <model name='power7+'>
+ <vendor name='IBM'/>
+ <compat isa='2.06B'/>
+ <pvr value='0x004a0000'/>
+ </model>
+
+ <model name='power8e'>
+ <vendor name='IBM'/>
+ <compat isa='2.07'/>
+ <pvr value='0x004b0000'/>
+ </model>
+
+ <model name='power8'>
+ <vendor name='IBM'/>
+ <compat isa='2.07'/>
+ <pvr value='0x004d0000'/>
+ </model>
+
</arch>
</cpus>
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 4ea1835..531868c 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -99,6 +99,14 @@ ppcModelFindPVR(const struct ppc_map *map,
model = model->next;
}
+ /* PowerPC Processor Version Register is interpreted as follows :
+ * Higher order 16 bits : Power ISA generation.
+ * Lower order 16 bits : CPU chip version number.
+ * If the exact CPU isnt found, return the nearest matching CPU generation
+ */
+ if (pvr & 0x0000FFFFul)
+ return ppcModelFindPVR(map, (pvr & 0xFFFF0000ul));
+
return NULL;
}
@@ -0,0 +1,41 @@
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 23:00:36 +0530
Subject: [PATCH] docs: Add documentation for compat mode.
Add documentation to explain how compat-mode can be invoked with libvirt
running on PowerPC architecture.
It also mentions that this change is available libvirt 1.2.11 onwards.
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 9265fd19b68d787e478f5e490524da794965a5f1)
---
docs/formatdomain.html.in | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 12172a4..6c64230 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1047,7 +1047,20 @@
(such as CPUID level) that don't work. Until these issues are fixed,
it's a good idea to avoid using <code>host-model</code> and use
<code>custom</code> mode with just the CPU model from host
- capabilities XML.</dd>
+ capabilities XML.
+ <span class="since">(Since 1.2.11)</span>. PowerISA allows
+ processors to run VMs in binary compatibility mode supporting an
+ older version of ISA. Libvirt on PowerPC architecture uses the
+ <code>host-model</code> to signify a guest mode CPU running in
+ binary compatibility mode. Example:
+ When a user needs a power7 VM to run in compatibility mode
+ on a Power8 host, this can be described in XML as follows :
+<pre>
+ &lt;cpu mode='host-model'&gt;
+ &lt;model&gt;power7&lt;/model&gt;
+ &lt;/cpu&gt;
+ ...</pre>
+ </dd>
<dt><code>host-passthrough</code></dt>
<dd>With this mode, the CPU visible to the guest should be exactly
the same as the host CPU even in the aspects that libvirt does not
@@ -0,0 +1,71 @@
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 23:02:15 +0530
Subject: [PATCH] Test: Add a testcase for PowerPC compat mode cpu
specification.
This introduces a testcase for PowerPC compat mode cpu specification.
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 12c381114ce362e49cadb730b5faabbc150a8878)
---
.../qemuxml2argv-pseries-cpu-compat.args | 8 ++++++++
.../qemuxml2argv-pseries-cpu-compat.xml | 20 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
3 files changed, 30 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
new file mode 100644
index 0000000..64df406
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
@@ -0,0 +1,8 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
+QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \
+-cpu host,compat=power7 \
+-m 214 -smp 4 -nographic -nodefconfig -nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
+-chardev pty,id=charserial0 \
+-device spapr-vty,chardev=charserial0,reg=0x30000000
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
new file mode 100644
index 0000000..e34a8ad
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
@@ -0,0 +1,20 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <cpu mode='host-model'>
+ <model>power7</model>
+ </cpu>
+ <clock offset='utc'/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <console type='pty'>
+ <address type="spapr-vio"/>
+ </console>
+ <memballoon model="none"/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5539a84..e24d17f 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1314,6 +1314,8 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-ide-drive-split",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_IDE_CD);
@@ -0,0 +1,126 @@
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 28 Apr 2015 17:38:00 -0400
Subject: [PATCH] polkit: Allow password-less access for 'libvirt' group
Many users, who admin their own machines, want to be able to access
system libvirtd via tools like virt-manager without having to enter
a root password. Just google 'virt-manager without password' and
you'll find many hits. I've read at least 5 blog posts over the years
describing slightly different ways of achieving this goal.
Let's finally add official support for this.
Install a polkit-1 rules file granting password-less auth for any user
in the new 'libvirt' group. Create the group on RPM install
https://bugzilla.redhat.com/show_bug.cgi?id=957300
(cherry picked from commit e94979e901517af9fdde358d7b7c92cc055dd50c)
---
daemon/Makefile.am | 13 +++++++++++++
daemon/libvirt.rules | 9 +++++++++
libvirt.spec.in | 15 +++++++++++++--
3 files changed, 35 insertions(+), 2 deletions(-)
create mode 100644 daemon/libvirt.rules
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index b95a79d..9c5ea37 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -53,6 +53,7 @@ EXTRA_DIST = \
libvirtd.init.in \
libvirtd.upstart \
libvirtd.policy.in \
+ libvirt.rules \
libvirtd.sasl \
libvirtd.service.in \
libvirtd.socket.in \
@@ -233,6 +234,8 @@ policyauth = auth_admin_keep_session
else ! WITH_POLKIT0
policydir = $(datadir)/polkit-1/actions
policyauth = auth_admin_keep
+rulesdir = $(datadir)/polkit-1/rules.d
+rulesfile = libvirt.rules
endif ! WITH_POLKIT0
endif WITH_POLKIT
@@ -263,9 +266,19 @@ if WITH_POLKIT
install-data-polkit::
$(MKDIR_P) $(DESTDIR)$(policydir)
$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
+if ! WITH_POLKIT0
+ $(MKDIR_P) $(DESTDIR)$(rulesdir)
+ $(INSTALL_DATA) $(srcdir)/$(rulesfile) $(DESTDIR)$(rulesdir)/50-libvirt.rules
+endif ! WITH_POLKIT0
+
uninstall-data-polkit::
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
rmdir $(DESTDIR)$(policydir) || :
+if ! WITH_POLKIT0
+ rm -f $(DESTDIR)$(rulesdir)/50-libvirt.rules
+ rmdir $(DESTDIR)$(rulesdir) || :
+endif ! WITH_POLKIT0
+
else ! WITH_POLKIT
install-data-polkit::
uninstall-data-polkit::
diff --git a/daemon/libvirt.rules b/daemon/libvirt.rules
new file mode 100644
index 0000000..01a15fa
--- /dev/null
+++ b/daemon/libvirt.rules
@@ -0,0 +1,9 @@
+// Allow any user in the 'libvirt' group to connect to system libvirtd
+// without entering a password.
+
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.libvirt.unix.manage" &&
+ subject.isInGroup("libvirt")) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/libvirt.spec.in b/libvirt.spec.in
index a84b19d..5de085b 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1583,9 +1583,9 @@ then
fi
%if %{with_libvirtd}
+%pre daemon
%if ! %{with_driver_modules}
%if %{with_qemu}
-%pre daemon
%if 0%{?fedora} || 0%{?rhel} >= 6
# We want soft static allocation of well-known ids, as disk images
# are commonly shared across NFS mounts by id rather than name; see
@@ -1599,11 +1599,21 @@ if ! getent passwd qemu >/dev/null; then
useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
fi
fi
-exit 0
%endif
%endif
%endif
+ %if %{with_polkit}
+ %if 0%{?fedora} || 0%{?rhel} >= 6
+# 'libvirt' group is just to allow password-less polkit access to
+# libvirtd. The uid number is irrelevant, so we use dynamic allocation
+# described at the above link.
+getent group libvirt >/dev/null || groupadd -r libvirt
+ %endif
+ %endif
+
+exit 0
+
%post daemon
%if %{with_network}
@@ -1919,6 +1929,7 @@ exit 0
%if 0%{?fedora} || 0%{?rhel} >= 6
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
+%{_datadir}/polkit-1/rules.d/50-libvirt.rules
%else
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
%endif
+21
View File
@@ -0,0 +1,21 @@
# Makefile for source rpm: libvirt
# $Id$
NAME := libvirt
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)
+2442 -1384
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
SHA512 (libvirt-8.1.0.tar.xz) = 5db227b78f48e35f917030eeb45ce9d0f7e868c5ce75da496ca06fad175ad6b026173b2fb78415c0103a61af24aec78d89bcebdf60b817d8ff6e84dc926faa97
b3ffa5e11880acca7fa19a3cca2d6280 libvirt-1.2.9.3.tar.gz