aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/cryptodev-vhost-user.c2
-rw-r--r--backends/rng-egd.c2
-rw-r--r--backends/rng-random.c2
-rw-r--r--backends/vhost-user.c2
-rw-r--r--include/qapi/qmp/qerror.h3
-rw-r--r--qom/object.c6
-rw-r--r--softmmu/qtest.c4
7 files changed, 10 insertions, 11 deletions
diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c
index 5443a59153..f9c5867e38 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -339,7 +339,7 @@ static void cryptodev_vhost_user_set_chardev(Object *obj,
CRYPTODEV_BACKEND_VHOST_USER(obj);
if (s->opened) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'chardev' can no longer be set");
} else {
g_free(s->chr_name);
s->chr_name = g_strdup(value);
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index 4de142b9dc..684c3cf3d6 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -116,7 +116,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)
RngEgd *s = RNG_EGD(b);
if (b->opened) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'chardev' can no longer be set");
} else {
g_free(s->chr_name);
s->chr_name = g_strdup(value);
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 7add272edd..80eb5be138 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -96,7 +96,7 @@ static void rng_random_set_filename(Object *obj, const char *filename,
RngRandom *s = RNG_RANDOM(obj);
if (b->opened) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'filename' can no longer be set");
return;
}
diff --git a/backends/vhost-user.c b/backends/vhost-user.c
index 10b39992d2..5dedb2d987 100644
--- a/backends/vhost-user.c
+++ b/backends/vhost-user.c
@@ -141,7 +141,7 @@ static void set_chardev(Object *obj, const char *value, Error **errp)
Chardev *chr;
if (b->completed) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'chardev' can no longer be set");
return;
}
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 596fce0c54..87ca83b155 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -50,9 +50,6 @@
#define QERR_MISSING_PARAMETER \
"Parameter '%s' is missing"
-#define QERR_PERMISSION_DENIED \
- "Insufficient permission to perform this operation"
-
#define QERR_PROPERTY_VALUE_BAD \
"Property '%s.%s' doesn't take value '%s'"
diff --git a/qom/object.c b/qom/object.c
index d34608558e..e5cef30f6d 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1383,7 +1383,8 @@ bool object_property_get(Object *obj, const char *name, Visitor *v,
}
if (!prop->get) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property '%s.%s' is not readable",
+ object_get_typename(obj), name);
return false;
}
prop->get(obj, v, name, prop->opaque, &err);
@@ -1402,7 +1403,8 @@ bool object_property_set(Object *obj, const char *name, Visitor *v,
}
if (!prop->set) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property '%s.%s' is not writable",
+ object_get_typename(obj), name);
return false;
}
prop->set(obj, v, name, prop->opaque, errp);
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index f8acef2628..afea7693d0 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -977,7 +977,7 @@ static void qtest_set_log(Object *obj, const char *value, Error **errp)
QTest *q = QTEST(obj);
if (qtest == q) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'log' can not be set now");
} else {
g_free(q->log);
q->log = g_strdup(value);
@@ -997,7 +997,7 @@ static void qtest_set_chardev(Object *obj, const char *value, Error **errp)
Chardev *chr;
if (qtest == q) {
- error_setg(errp, QERR_PERMISSION_DENIED);
+ error_setg(errp, "Property 'chardev' can not be set now");
return;
}