- 24 Nov, 2020 2 commits
-
-
Christian Kellner authored
Add a new helper to get the unique id (uid) for a device. It uses the new define in bolt-names.h for the sysfs attribute.
-
Christian Kellner authored
Add a define for the the 'unique_id' sysfs attribute which is used to uniquely identify thunderbolt devices.
-
- 20 Nov, 2020 5 commits
-
-
Christian Kellner authored
In the manager's initialization, we want to make sure that we have at least one domain controller online in order detect the security level. Additionally, now that stale domains are cleaned up on store upgrades, we also want to make sure that domain controllers are fully initialized and the corresponding BotlDomain is online, so that we don't accidentally clean up a non-stale domain. In order to do so, we wait for at least one host controller to be present, not just the plain domain. For this we enumerate all domains and for each domain we enumerate the thunderbolt udev device directly beneath it (should only be one). Rename and re-purpose the various `count_domains` functions. Adapt the test to add host devices to the corresponding domains.
-
Christian Kellner authored
Use the LOG_DOM () macro and do not use `bolt_domain_get_id` which might return NULL for disconnected domains.
-
Christian Kellner authored
Simulate stale domains by creating a store with four domains, one of which has a bootacl journal with entries. Since the store does not have a 'version' file, an upgrade will be performed which will lead to the cleanup of stale domains. All domains, except the one with the non-empty bootacl journal should be cleaned up.
-
Christian Kellner authored
When the store is upgraded, clean up any stale domains. Previous versions of bolt (< 0.9.1) would store domains that did not have stable uuids, i.e. their uuid would change on every boot. These stored domains would be loaded and exported but would never come online, since they can not ever by matched to an online domain. When the store cleanup method is executed, in the manager's initialization method, the domain controller should either be powered (they use runtime power management only and are thus not physically powered down on ice lake anyway) or force-powered and thus any domain that is not yet online will be removed. This can fail if the domain has a boot acl journal with entries, which protects the loss of data for domains that are not force-powered, maybe because they are even slower, but do have a stable uuid.
-
Christian Kellner authored
After the store was upgraded, get the new version from the store and report that in the logs, not the old, pre-upgrade version.
-
- 17 Nov, 2020 1 commit
-
-
Christian Kellner authored
Remove some duplicated code by moving the un-export code for the device to a central location: `manager_deregister_device`. This method will be called for all devices that can be de-registered, i.e. either devices that got disconnected and are not store via the `handle_udev_device_removed` udev event handler, or devices that got remove from the store and are disconnected. The latter is handled via `handle_store_device_removed`. In both cases the device should be de-registered and (if exported) be un-exported. Thus this is where the un-export code is now moved to.
-
- 10 Nov, 2020 28 commits
-
-
Christian Kellner authored
Add a store upgrade test: force the store to have version 0 and then upgrade it to 1. The only difference between the to is the presence of the "version" file (which must contain the version info, i.e. "1"). Check that calling the upgrade function again does not change anything.
-
Christian Kellner authored
Add basic checks for the version property. Check it matches the store code version.
-
Christian Kellner authored
Use the new store upgrade mechanism to upgrade the store. Currently nothing is done if an upgrade happens, but it will be used to clean up stale domains, which might have accumulated due to the ice lake domain uuid instability.
-
Christian Kellner authored
Add a new function to upgrade the store from version "0" to "1". Except the addition of the 'version' file there is no difference between the two versions and thus creating said 'version' file is all the store upgrade does. This can still be useful, because it can be used as a marker, e.g. the manager can use it to clean up the store once when upgrading from version 0.
-
Christian Kellner authored
Add version information to the on-disk store and expose that information via a new "version" store object property. The on-disk information is stored in a new 'version' file, that is located at the root of the store. In case no such file is found, the store version is defined as 0 (zero). When a store is opened, and the root of the store is completely empty (i.e. no sub-directories or the version file is present), the store is assumed to be new and is initialized by creating the 'version' containing the BOLT_STORE_VERSION number.
-
Christian Kellner authored
Convert the store use the GInitable interface. This prepares for store on-disk initialization that can fail. Currently, nothing is actually done in initialize and thus it will never fail. Adapt all tests to check for potential store creation errors and also convert the manager's store initialization method to handle the error.
-
Christian Kellner authored
Instead of initializing the store in the basic object init method, create a new method that bundles all store related initialization and call that from bolt_manager_initialize. This prepares for the possibility that store initialization can fail.
-
Christian Kellner authored
Checks for various invocations of bolt_renameat, including error reporting.
-
Christian Kellner authored
Add a simple wrapper for renameat(2), mainly for GError based error reporting.
-
Christian Kellner authored
Check basic functionality and error reporting for bolt_mkdirat.
-
Christian Kellner authored
Add a simple mkdirat(2) wrapper for GError based error reporting.
-
Christian Kellner authored
-
Christian Kellner authored
-
Christian Kellner authored
Simple checks that we get the expected errors for non existent files and files containing unexpected data.
-
Christian Kellner authored
Extract the test table for string to integer conversion, which was duplicated in two different test cases.
-
Christian Kellner authored
Extract the test table for string to unsigned integer conversion, which was duplicated in two different test cases.
-
Christian Kellner authored
Basic test cases for writing an unsigned integer to disk. The data is verify via bolt_read_unit_at.
-
Christian Kellner authored
Small helper which writes a plain unsigned integer to a file. Uses bolt_write_file_at internally.
-
Christian Kellner authored
Test case for bolt_read_uint_at. Duplicates the test table for test_str_parse_uint for now.
-
Christian Kellner authored
Basic checks for bolt_write_int_at. Uses bolt_read_int_at to verify the integer got written properly.
-
Christian Kellner authored
Add a new helper that writes a plain int to a file, internally using bolt_write_file_at.
-
Christian Kellner authored
Test case for bolt_read_int_at. Duplicates the test table for test_str_parse_int for now.
-
Christian Kellner authored
Re-implement bolt_file_write_all in terms of bolt_write_file_at, since open (...) <=> openat (AT_FDWCD, ...).
-
Christian Kellner authored
Basically the same test as test_io_file_write_all: write data, check it is all there, overwrite the file, check it got overwritten and truncated.
-
Christian Kellner authored
This is like the existing `bolt_file_write_all`, except it takes a file descriptor to a directory to be able to specify the parent directory. Will create a new file or overwrite an existing. Does not do atomic io or the rename-to-do-atomic-io rename dance.
-
Christian Kellner authored
Create a define of open flags that is typically used to create or overwrite new files; with a plain text spelling out of the flags. This is done so that they can be reused in other functions.
-
Christian Kellner authored
Analogous to bolt_read_int_at, but for unsigned integers; uses bolt_read_value_at and bolt_str_parse_as_unit internally.
-
Christian Kellner authored
Change a stray podman usage to docker, since podman is not even installed and the image is built with docker.
-
- 09 Nov, 2020 4 commits
-
-
Christian Kellner authored
The ORG argument needs to be set as well.
-
Christian Kellner authored
Specify the missing build arguments for the coverity container.
-
Christian Kellner authored
Only meant to be run from schedule pipelines, since there is a rate limit for coverity.
-
Christian Kellner authored
Add a new container to perform coverity analysis, i.e. it fetches the coverity distribution. Add a new coverity.sh script to actually perform the analysis and upload the results.
-