1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00

sd-device-monitor: rename device_monitor_send_device() -> device_monitor_send()

This commit is contained in:
Yu Watanabe 2024-07-31 14:21:33 +09:00
parent bab889c51e
commit 9d37cf28a3
5 changed files with 16 additions and 16 deletions

View File

@ -18,4 +18,4 @@ typedef enum MonitorNetlinkGroup {
int device_monitor_new_full(sd_device_monitor **ret, MonitorNetlinkGroup group, int fd);
int device_monitor_get_address(sd_device_monitor *m, union sockaddr_union *ret);
int device_monitor_allow_unicast_sender(sd_device_monitor *m, sd_device_monitor *sender);
int device_monitor_send_device(sd_device_monitor *m, const union sockaddr_union *destination, sd_device *device);
int device_monitor_send(sd_device_monitor *m, const union sockaddr_union *destination, sd_device *device);

View File

@ -686,7 +686,7 @@ static uint64_t string_bloom64(const char *str) {
return bits;
}
int device_monitor_send_device(
int device_monitor_send(
sd_device_monitor *m,
const union sockaddr_union *destination,
sd_device *device) {

View File

@ -91,11 +91,11 @@ static void send_by_enumerator(
ASSERT_OK(device_add_property(d, "SEQNUM", "10"));
log_device_debug(d, "Sending device subsystem:%s syspath:%s", s, p);
ASSERT_OK(device_monitor_send_device(monitor_server, address, d));
ASSERT_OK(device_monitor_send(monitor_server, address, d));
/* The sysattr and parent filters are not implemented in BPF yet. So, sending multiple
* devices may fills up buffer and device_monitor_send_device() may return EAGAIN. Let's
* send only a few devices here, which should be filtered out by the receiver. */
* devices may fills up buffer and device_monitor_send() may return EAGAIN. Let's send only a
* few devices here, which should be filtered out by the receiver. */
if (n != SIZE_MAX && ++i >= n)
break;
}
@ -129,7 +129,7 @@ TEST(refuse_invalid_device) {
prepare_monitor(&monitor_server, &monitor_client, &sa);
ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath));
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, loopback));
ASSERT_OK(device_monitor_send(monitor_server, &sa, loopback));
ASSERT_OK(sd_event_run(sd_device_monitor_get_event(monitor_client), 0));
}
@ -159,7 +159,7 @@ static void test_send_receive_one(sd_device *device, bool subsystem_filter, bool
ASSERT_OK(sd_device_monitor_filter_update(monitor_client));
ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath));
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -211,7 +211,7 @@ TEST(sd_device_monitor_filter_add_match_subsystem_devtype) {
send_by_enumerator(monitor_server, &sa, e, SIZE_MAX, NULL);
log_device_info(device, "Sending device subsystem:%s syspath:%s", subsystem, syspath);
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -235,7 +235,7 @@ TEST(sd_device_monitor_filter_add_match_tag) {
send_by_enumerator(monitor_server, &sa, e, SIZE_MAX, NULL);
log_device_info(device, "Sending device syspath:%s", syspath);
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -262,7 +262,7 @@ TEST(sd_device_monitor_filter_add_match_sysattr) {
send_by_enumerator(monitor_server, &sa, e, 5, NULL);
log_device_info(device, "Sending device syspath:%s", syspath);
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -296,7 +296,7 @@ TEST(sd_device_monitor_add_match_parent) {
send_by_enumerator(monitor_server, &sa, e, 5, parent_syspath);
log_device_info(device, "Sending device syspath:%s", syspath);
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -315,12 +315,12 @@ TEST(sd_device_monitor_filter_remove) {
ASSERT_OK(sd_device_monitor_filter_add_match_subsystem_devtype(monitor_client, "hoge", NULL));
ASSERT_OK(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath));
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_OK(sd_event_run(sd_device_monitor_get_event(monitor_client), 0));
ASSERT_OK(sd_device_monitor_filter_remove(monitor_client));
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_EQ(sd_event_loop(sd_device_monitor_get_event(monitor_client)), 100);
}
@ -337,7 +337,7 @@ TEST(sd_device_monitor_receive) {
prepare_monitor(&monitor_server, &monitor_client, &sa);
ASSERT_OK(device_monitor_send_device(monitor_server, &sa, device));
ASSERT_OK(device_monitor_send(monitor_server, &sa, device));
ASSERT_OK(fd = sd_device_monitor_get_fd(monitor_client));
for (;;) {

View File

@ -450,7 +450,7 @@ static int event_run(Event *event) {
if (worker->state != WORKER_IDLE)
continue;
r = device_monitor_send_device(manager->monitor, &worker->address, event->dev);
r = device_monitor_send(manager->monitor, &worker->address, event->dev);
if (r < 0) {
log_device_error_errno(event->dev, r, "Worker ["PID_FMT"] did not accept message, killing the worker: %m",
worker->pid);

View File

@ -272,7 +272,7 @@ void udev_broadcast_result(sd_device_monitor *monitor, sd_device *dev, EventResu
}
}
r = device_monitor_send_device(monitor, NULL, dev);
r = device_monitor_send(monitor, NULL, dev);
if (r < 0)
log_device_warning_errno(dev, r,
"Failed to broadcast event to libudev listeners, ignoring: %m");