[libvirt] [PATCH] conf: goto error when value max_sectors too large

Luyao Huang lhuang at redhat.com
Fri Dec 12 02:32:54 UTC 2014


Output error when we try to set a too large max_sectors.
Just like queues and cmd_per_lun here.

Signed-off-by: Luyao Huang <lhuang at redhat.com>
---
 src/conf/domain_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2965d8d..d4ac301 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6681,6 +6681,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
     if (max_sectors && virStrToLong_ui(max_sectors, NULL, 10, &def->max_sectors) < 0) {
         virReportError(VIR_ERR_XML_ERROR,
                        _("Malformed 'max_sectors' value %s'"), max_sectors);
+        goto error;
     }
 
     if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
-- 
1.8.3.1




More information about the libvir-list mailing list