summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/libsystemd.sym2
-rw-r--r--src/libsystemd/sd-bus/bus-dump.c5
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c1
-rw-r--r--src/libsystemd/sd-bus/bus-message.c16
-rw-r--r--src/libsystemd/sd-bus/bus-message.h1
5 files changed, 23 insertions, 2 deletions
diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
index 0337e4eb0c..fc9c4f830c 100644
--- a/src/libsystemd/libsystemd.sym
+++ b/src/libsystemd/libsystemd.sym
@@ -86,6 +86,7 @@ global:
sd_bus_message_get_reply_cookie;
sd_bus_message_get_no_reply;
sd_bus_message_get_no_auto_start;
+ sd_bus_message_get_priority;
sd_bus_message_get_signature;
sd_bus_message_get_path;
sd_bus_message_get_interface;
@@ -104,6 +105,7 @@ global:
sd_bus_message_set_no_reply;
sd_bus_message_set_no_auto_start;
sd_bus_message_set_destination;
+ sd_bus_message_set_priority;
sd_bus_message_append;
sd_bus_message_append_basic;
sd_bus_message_append_array;
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c
index a2b6358215..0e41549737 100644
--- a/src/libsystemd/sd-bus/bus-dump.c
+++ b/src/libsystemd/sd-bus/bus-dump.c
@@ -54,14 +54,15 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) {
if (with_header) {
fprintf(f,
- "%s%s%sType=%s%s%s Endian=%c Flags=%u Version=%u",
+ "%s%s%sType=%s%s%s Endian=%c Flags=%u Version=%u Priority=%lli",
m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() :
m->header->type == SD_BUS_MESSAGE_METHOD_RETURN ? ansi_highlight_green() :
m->header->type != SD_BUS_MESSAGE_SIGNAL ? ansi_highlight() : "", draw_special_char(DRAW_TRIANGULAR_BULLET), ansi_highlight_off(),
ansi_highlight(), bus_message_type_to_string(m->header->type), ansi_highlight_off(),
m->header->endian,
m->header->flags,
- m->header->version);
+ m->header->version,
+ (long long) m->priority);
/* Display synthetic message serial number in a more readable
* format than (uint32_t) -1 */
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index f547ebf134..77ad5ca506 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -260,6 +260,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) {
m->destination ? unique : KDBUS_DST_ID_BROADCAST;
m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS;
m->kdbus->cookie = m->header->serial;
+ m->kdbus->priority = m->priority;
if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
m->kdbus->cookie_reply = m->reply_cookie;
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 2c25b3f5f1..b42c4915ea 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -5548,3 +5548,19 @@ int bus_message_append_sender(sd_bus_message *m, const char *sender) {
return message_append_field_string(m, BUS_MESSAGE_HEADER_SENDER, SD_BUS_TYPE_STRING, sender, &m->sender);
}
+
+_public_ int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) {
+ assert_return(m, -EINVAL);
+ assert_return(priority, -EINVAL);
+
+ *priority = m->priority;
+ return 0;
+}
+
+_public_ int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) {
+ assert_return(m, -EINVAL);
+ assert_return(!m->sealed, -EPERM);
+
+ m->priority = priority;
+ return 0;
+}
diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h
index 0c90e726de..5fbe3e6030 100644
--- a/src/libsystemd/sd-bus/bus-message.h
+++ b/src/libsystemd/sd-bus/bus-message.h
@@ -99,6 +99,7 @@ struct sd_bus_message {
usec_t monotonic;
usec_t realtime;
uint64_t seqnum;
+ int64_t priority;
bool sealed:1;
bool dont_send:1;