On Mon, Aug 31, 2015 at 01:00:25PM -0400, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1258361
When attaching a disk or rng when providing an address type ccw, we need
to ensure the machine.os is valid for the target guest. Checks are made
when the address type is not provided, but if provided the os.machine
check is bypassed.
Incomplete, attaching a scsi controller with a ccw address on an x86_64
still crashes the daemon after this patch.
For an inactive guest, an addition followed by a start would cause the
startup to fail after qemu_command builds the command line and attempts
to start the guest. For an active guest, libvirtd would crash.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
NOTE:
For 'rng' in qemu_command - rather than change each of the if..else if..
conditions to have the {}, I just made the check up front.
Also while I could separate these into disk and rng - since it's the same
fix for the same problem it just seem "proper" to include both in same patch
src/qemu/qemu_command.c | 15 +++++++++++++++
src/qemu/qemu_hotplug.c | 21 ++++++++++++++++++---
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index abc57d7..ecdec2c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4296,6 +4296,13 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
case VIR_DOMAIN_DISK_BUS_VIRTIO:
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ if (!STREQLEN(def->os.machine, "s390-ccw", 8)) {
Maybe we need a 'qemuDomainMachineIsS390CCW' helper?
Jan