Age | Commit message (Collapse) | Author |
|
With the new sd_rtnl_message_read_string(), there is no longer a need for
rtnl_message_get_ifname().
|
|
This patch introduces new netlink attribute parsing logic
which is table based lookup and sd_rtnl_message_read_*
methods for reading attributes. By doing this user does not
have to loop for the attribute values . Only providing the
attribute type it gets the attribute values which is optimized
and sd_rtnl_message_read_* methods are simplified.
|
|
We need a separate container_enter() function, which will be part of a largerg
API change. For now, just fix message_read().
|
|
|
|
|
|
for the unit that is created
The code for parsing these properties is shared with "systemctl
set-property", which means all the resource control settings are
immediately available.
|
|
This mirrors set_consume and makes the common use a bit nicer.
|
|
Implements IPv4LL with respect to RFC 3927
(http://tools.ietf.org/rfc/rfc3927.txt) and integrates it
with networkd. Majority of the IPv4LL state machine is
taken from avahi (http://avahi.org/) project's autoip.
IPv4LL can be enabled by IPv4LL=yes under [Network]
section of .network file.
IPv4LL works independent of DHCP but if DHCP lease is
aquired, then LL address will be dropped.
[tomegun: removed a trailing newline and a compiler warning]
|
|
|
|
This is primarily useful for services that need to track clients which
reference certain objects they maintain, or which explicitly want to
subscribe to certain events. Something like this is done in a large
number of services, and not trivial to do. Hence, let's unify this at
one place.
This also ports over PID 1 to use this to ensure that subscriptions to
job and manager events are correctly tracked. As a side-effect this
makes sure we properly serialize and restore the track list across
daemon reexec/reload, which didn't work correctly before.
This also simplifies how we distribute messages to broadcast to the
direct busses: we only track subscriptions for the API bus and
implicitly assume that all direct busses are subscribed. This should be
a pretty OK simplification since clients connected via direct bus
connections are shortlived anyway.
|
|
|
|
This partially reverts 41a55c46ab8fb4ef6727434227071321fc762cce
Some specifications we want to stay compatibility actually document
/var/run, not /run, and we should stay compatible with that. In order to
make sure our D-Bus implementation works on any system, regardless if
running systemd or not, we should always use /var/run which is the
only path mandated by the D-Bus spec.
Similar, glibc hardcodes the utmp location to /var/run, and this is
exposed in _UTMP_PATH in limits.h, hence let's stay in sync with this
public API, too.
We simply do not support systems where /var/run is not a symlink → /run.
Hence both are equivalent. Staying compatible with upstream
specifications hence weighs more than cleaning up superficial
appearance.
|
|
/run was already used almost everywhere, fix the remaining places
for consistency.
|
|
container
|
|
As pointed-out by clang -Wunreachable-code.
No behaviour changes.
|
|
../src/shared/unit-name.c:462: error: undefined reference to 'sd_bus_label_escape'
../src/shared/unit-name.c:477: error: undefined reference to 'sd_bus_label_unescape'
collect2: error: ld returned 1 exit status
|
|
sd_memfd_new is available twice. Remove the second one.
|
|
|
|
|
|
This new event source is triggered by the dispatching of any non-post
event source. It can thus be used to do clean-up or recheck work,
triggered by any other event source having been executed.
This is different from "defer" event source which are unconditionally
triggered as long as they are enabled. A "defer" event source that does
nothing will result in the event loop busy looping unless it is turned
off eventually. This is different for "post" event sources that will be
only triggered when some other non-post ran, and will thus not keep the
event loop busy on its own.
|
|
There was a copy-paste error introduced in commit c2ba3ad6604ef2e189d7e0a36d6911116e84d3ab
which causes the following error when using timer units:
Assertion '(x->type == SOURCE_MONOTONIC && y->type == SOURCE_MONOTONIC) || (x->type == SOURCE_REALTIME && y->type == SOURCE_REALTIME)'
failed at src/libsystemd/sd-event/sd-event.c:264, function latest_time_prioq_compare(). Aborting.
|
|
gcc (4.8.2, arm) doesn't understand that vtable_property_get_userdata()
will always set 'u' when it returns > 0. Hence, the warning is bogus,
but anyway.
src/libsystemd/sd-bus/bus-objects.c:510:19: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]
(and yes, indeed, even the reported line numbers are bogus in this case)
|
|
first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
|
|
This matches the API of previous headers, such as sd-journal.h.
|
|
|
|
|
|
|
|
|
|
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter.
|
|
|
|
|
|
These were added to the kernel between 3.5 and 3.9, let's not require such
recent kernels (yet).
|
|
Setting a child-source state to anything but SD_EVENT_OFF currently does
nothing. The condition logic is flawed. Move the state update *below* the
test for the previous state.
Fixes a crash if you call:
sd_event_source_set_enabled(source, SD_EVENT_ON);
sd_event_source_unref(source);
on a child-source in its own callback.
|
|
|
|
This mimics the sd-bus api, as we may need it in the future.
|
|
|
|
Resolve spotted issues related to missing or extraneous commas, dashes.
|
|
The kernel will then look up the ifindex itself based on the name.
This should be used very carefully as it is racey.
[This was a left-over hunk from my previous nspawn patch.]
|
|
|
|
|
|
We can always know the size based on the type, so let's do this inside the library.
|
|
The kernel will happily treat 0x0 as 0xffffffff, but it is for backwards
compatibility only, so let's not perpetuate this.
|
|
|
|
sd_rtnl_xxx_new_yyy()
So far we followed the rule to always indicate the "flavour" of
constructors after the "_new_" or "_open_" in the function name, so
let's keep things in sync here for rtnl and do the same.
|
|
The "sd_" prefix is supposed to be used on exported symbols only, and
not in the middle of names. Let's drop it from the cleanup macros hence,
to make things simpler.
The bus cleanup macros don't carry the "sd_" either, so this brings the
APIs a bit nearer.
|
|
The .sym file somehow lacks these declarations, so add these. You have to
run "make clean" to make sure the sym-test runs fine afterwards.
|
|
|
|
We are more likely to catch errors if we don't use '0' as test value.
|
|
|
|
|