mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-07 20:20:43 +01:00
fixup! dbus: device: add SetManaged method
This commit is contained in:
parent
e2b622042b
commit
8f73178063
2 changed files with 11 additions and 0 deletions
|
|
@ -14946,6 +14946,8 @@ typedef struct {
|
|||
static gboolean
|
||||
set_managed(NMDevice *self, gboolean managed, NMDeviceManagedFlags flags, GError **error)
|
||||
{
|
||||
nm_assert((flags & ~NM_DEVICE_MANAGED_FLAGS_ALL) == 0);
|
||||
|
||||
g_object_set(self, NM_DEVICE_MANAGED, managed, NULL);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -14967,6 +14969,13 @@ set_managed_cb(NMDevice *self,
|
|||
flags = set_managed_data->managed_flags;
|
||||
nm_g_slice_free(set_managed_data);
|
||||
|
||||
if (!error && (flags & ~NM_DEVICE_MANAGED_FLAGS_ALL) != 0) {
|
||||
g_set_error_literal(&error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_INVALID_ARGUMENT,
|
||||
"Invalid flags");
|
||||
}
|
||||
|
||||
if (error) {
|
||||
nm_audit_log_device_op(NM_AUDIT_OP_DEVICE_MANAGED,
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -1259,6 +1259,8 @@ typedef enum /*< flags >*/ {
|
|||
*/
|
||||
typedef enum /*< flags >*/ {
|
||||
NM_DEVICE_MANAGED_FLAGS_NONE = 0,
|
||||
|
||||
NM_DEVICE_MANAGED_FLAGS_ALL = 0, /* <skip> */
|
||||
} NMDeviceManagedFlags;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue