|
|
9c6c51 |
From 6402d8133b33af901247afccdc78b332b453ff11 Mon Sep 17 00:00:00 2001
|
|
|
9c6c51 |
Message-Id: <6402d8133b33af901247afccdc78b332b453ff11@dist-git>
|
|
|
9c6c51 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
9c6c51 |
Date: Thu, 18 Apr 2019 19:36:33 +0200
|
|
|
9c6c51 |
Subject: [PATCH] qemu_hotplug: Check for duplicate drive addresses
|
|
|
9c6c51 |
|
|
|
9c6c51 |
RHEL-7.7: https://bugzilla.redhat.com/show_bug.cgi?id=1692296
|
|
|
9c6c51 |
RHEL-8.1.0: https://bugzilla.redhat.com/show_bug.cgi?id=1692354
|
|
|
9c6c51 |
|
|
|
9c6c51 |
This tries to fix the same problem as f1d65853000 but it's doing
|
|
|
9c6c51 |
so in a less invasive way.
|
|
|
9c6c51 |
|
|
|
9c6c51 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
9c6c51 |
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
|
|
|
9c6c51 |
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
|
|
|
9c6c51 |
(cherry picked from commit ddc72f99027b063feaf34e5fda89916b6b2c8943)
|
|
|
9c6c51 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
9c6c51 |
Message-Id: <a40b26d1696401699fae7aeea2714f8b51935766.1555608962.git.mprivozn@redhat.com>
|
|
|
9c6c51 |
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9c6c51 |
---
|
|
|
9c6c51 |
src/qemu/qemu_hotplug.c | 6 ++++++
|
|
|
9c6c51 |
1 file changed, 6 insertions(+)
|
|
|
9c6c51 |
|
|
|
9c6c51 |
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
|
9c6c51 |
index 397a2bdde2..776cd75474 100644
|
|
|
9c6c51 |
--- a/src/qemu/qemu_hotplug.c
|
|
|
9c6c51 |
+++ b/src/qemu/qemu_hotplug.c
|
|
|
9c6c51 |
@@ -612,6 +612,12 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver,
|
|
|
9c6c51 |
return -1;
|
|
|
9c6c51 |
}
|
|
|
9c6c51 |
|
|
|
9c6c51 |
+ if (virDomainSCSIDriveAddressIsUsed(vm->def, &disk->info.addr.drive)) {
|
|
|
9c6c51 |
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
|
9c6c51 |
+ _("Domain already contains a disk with that address"));
|
|
|
9c6c51 |
+ return -1;
|
|
|
9c6c51 |
+ }
|
|
|
9c6c51 |
+
|
|
|
9c6c51 |
/* Let's make sure the disk has a controller defined and loaded before
|
|
|
9c6c51 |
* trying to add it. The controller used by the disk must exist before a
|
|
|
9c6c51 |
* qemu command line string is generated.
|
|
|
9c6c51 |
--
|
|
|
9c6c51 |
2.21.0
|
|
|
9c6c51 |
|