|
|
7a3408 |
From 17254fa42facf18071c99604472aa0b878ac904a Mon Sep 17 00:00:00 2001
|
|
|
7a3408 |
Message-Id: <17254fa42facf18071c99604472aa0b878ac904a@dist-git>
|
|
|
7a3408 |
From: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Date: Thu, 20 Aug 2015 12:23:49 -0400
|
|
|
7a3408 |
Subject: [PATCH] conf: Check for attach disk usage of iothread=0
|
|
|
7a3408 |
|
|
|
7a3408 |
https://bugzilla.redhat.com/show_bug.cgi?id=1253108
|
|
|
7a3408 |
|
|
|
7a3408 |
Since iothreadid = 0 is invalid, we need to check for it when attempting
|
|
|
7a3408 |
to add a disk; otherwise, someone would think/believe their attempt to
|
|
|
7a3408 |
add an IOThread to the disk would succeed. Luckily other code ignored
|
|
|
7a3408 |
things when ->iothread == 0...
|
|
|
7a3408 |
|
|
|
7a3408 |
(cherry picked from commit cb5d0193aa13bf922136bb0fc7520f97b0af52f9)
|
|
|
7a3408 |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7a3408 |
---
|
|
|
7a3408 |
src/conf/domain_conf.c | 3 ++-
|
|
|
7a3408 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
7a3408 |
index 9aee04f..b4503c3 100644
|
|
|
7a3408 |
--- a/src/conf/domain_conf.c
|
|
|
7a3408 |
+++ b/src/conf/domain_conf.c
|
|
|
7a3408 |
@@ -7321,7 +7321,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
if (driverIOThread) {
|
|
|
7a3408 |
- if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0) {
|
|
|
7a3408 |
+ if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0 ||
|
|
|
7a3408 |
+ def->iothread == 0) {
|
|
|
7a3408 |
virReportError(VIR_ERR_XML_ERROR,
|
|
|
7a3408 |
_("Invalid iothread attribute in disk driver "
|
|
|
7a3408 |
"element: %s"), driverIOThread);
|
|
|
7a3408 |
--
|
|
|
7a3408 |
2.5.0
|
|
|
7a3408 |
|