]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 18 Dec 2011 16:05:08 +0000 (17:05 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 19 Dec 2011 16:27:34 +0000 (10:27 -0600)
This will be used when reject invalid values for integer fields that
are less than 64-bits wide.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qerror.c
qerror.h

index adde8a5859a3a429a07d84a731c9362cc7a1c75c..9a75d063012a050d3570249e839cdf08d5d7484e 100644 (file)
--- a/qerror.c
+++ b/qerror.c
@@ -205,6 +205,11 @@ static const QErrorStringTable qerror_table[] = {
         .error_fmt = QERR_PROPERTY_VALUE_NOT_FOUND,
         .desc      = "Property '%(device).%(property)' can't find value '%(value)'",
     },
+    {
+        .error_fmt = QERR_PROPERTY_VALUE_OUT_OF_RANGE,
+        .desc      = "Property '%(device).%(property)' doesn't take "
+                     "value %(value) (minimum: %(min), maximum: %(max)'",
+    },
     {
         .error_fmt = QERR_QMP_BAD_INPUT_OBJECT,
         .desc      = "Expected '%(expected)' in QMP input",
index 9190b0215ba80e40693539ba95df091782f526cc..efda232db389f0265787123619543425d1b127a6 100644 (file)
--- a/qerror.h
+++ b/qerror.h
@@ -171,6 +171,9 @@ QError *qobject_to_qerror(const QObject *obj);
 #define QERR_PROPERTY_VALUE_NOT_FOUND \
     "{ 'class': 'PropertyValueNotFound', 'data': { 'device': %s, 'property': %s, 'value': %s } }"
 
+#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
+    "{ 'class': 'PropertyValueOutOfRange', 'data': { 'device': %s, 'property': %s, 'value': %"PRId64", 'min': %"PRId64", 'max': %"PRId64" } }"
+
 #define QERR_QMP_BAD_INPUT_OBJECT \
     "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }"