[libvirt] [PATCH] conf: Ignore device address for model=none usb controller and memballon

It make no sense at all to have it there. Signed-off-by: Luyao Huang <lhuang@redhat.com> --- src/conf/domain_conf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ec45b8c..2965d8d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6683,8 +6683,12 @@ virDomainControllerDefParseXML(xmlNodePtr node, _("Malformed 'max_sectors' value %s'"), max_sectors); } - if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && + def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { + VIR_DEBUG("Ignoring device address for none model usb controller"); + } else if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) { goto error; + } switch (def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: { @@ -9989,7 +9993,9 @@ virDomainMemballoonDefParseXML(xmlNodePtr node, goto error; } - if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) + if (def->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE) + VIR_DEBUG("Ignoring device address for none model Memballoon"); + else if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) goto error; cleanup: -- 1.8.3.1

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@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

On Fri, Dec 12, 2014 at 10:32:54AM +0800, Luyao Huang wrote:
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@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
ACK and safe for freeze since this makes the controller disappear. Will push in a while. Martin
participants (2)
-
Luyao Huang
-
Martin Kletzander