static gboolean
register_disks_adapter (Adapter *adapter)
{
- DBusConnection *connection;
GError *error = NULL;
adapter->priv->system_bus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
}
goto error;
}
- connection = dbus_g_connection_get_connection (adapter->priv->system_bus_connection);
adapter->priv->object_path = compute_object_path (adapter->priv->native_path);
guint num_ports;
guint64 device_class;
const gchar *driver;
- guint class;
guint subclass;
- guint interface;
gchar *scsi_host_name;
gchar *s;
gchar *s2;
device_class = g_udev_device_get_sysfs_attr_as_uint64 (adapter->priv->d, "class");
driver = g_udev_device_get_driver (adapter->priv->d);
- class = (device_class & 0xff0000) >> 16;
subclass = (device_class & 0x00ff00) >> 8;
- interface = (device_class & 0x0000ff);
/* count number of scsi_host objects - this is to detect whether we are dealing with
* ATA - see comment in port.c:update_info_ata() for details about
GObjectConstructParam *construct_properties)
{
Device *device;
- DeviceClass *klass;
-
- klass = DEVICE_CLASS (g_type_class_peek (TYPE_DEVICE));
device = DEVICE (G_OBJECT_CLASS (device_parent_class)->constructor (type,
n_construct_properties,
static gboolean
register_disks_device (Device *device)
{
- DBusConnection *connection;
GError *error = NULL;
device->priv->system_bus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
}
goto error;
}
- connection = dbus_g_connection_get_connection (device->priv->system_bus_connection);
-
device->priv->object_path = compute_object_path (device->priv->native_path);
/* safety first */
*/
if (!is_partition && sysfs_file_exists (device->priv->native_path, "start"))
{
- guint64 start;
guint64 size;
guint64 offset;
guint64 alignment_offset;
guint n;
device_set_device_is_partition (device, TRUE);
- start = sysfs_get_uint64 (device->priv->native_path, "start");
size = sysfs_get_uint64 (device->priv->native_path, "size");
alignment_offset = sysfs_get_uint64 (device->priv->native_path, "alignment_offset");
gchar **options = user_data_elements[0];
int n;
char *argv[16];
- GError *error;
gboolean force_unmount;
char *mount_path;
uid_t uid;
argv[n++] = NULL;
run_job:
- error = NULL;
if (!job_new (context,
"FilesystemUnmount",
FALSE,
{
int n;
char *argv[16];
- GError *error;
if (!device->priv->device_is_mounted || device->priv->device_mount_paths->len == 0)
{
argv[n++] = ((gchar **) device->priv->device_mount_paths->pdata)[0];
argv[n++] = NULL;
- error = NULL;
if (!job_new (context, NULL, /* don't run this as a job */
FALSE, device, argv, NULL, filesystem_list_open_files_completed_cb, FALSE, NULL, NULL))
{
int n;
char *argv[16];
GError *error;
- char *mount_path;
error = NULL;
- mount_path = NULL;
if (!device->priv->device_is_drive)
{
int n;
char *argv[16];
GError *error;
- char *mount_path;
error = NULL;
- mount_path = NULL;
if (!device->priv->device_is_drive)
{
//gchar **options = user_data_elements[0];
int n;
char *argv[16];
- GError *error;
/* TODO: change when we have a file system that supports online fsck */
if (device->priv->device_is_mounted)
argv[n++] = device->priv->device_file;
argv[n++] = NULL;
- error = NULL;
if (!job_new (context, "FilesystemCheck", FALSE, device, argv, NULL, filesystem_check_completed_cb, FALSE, NULL, NULL))
{
goto out;
Device *cleartext_device;
int n;
char *argv[10];
- GError *error;
if (device->priv->id_usage == NULL || strcmp (device->priv->id_usage, "crypto") != 0)
{
argv[n++] = cleartext_device->priv->dm_name;
argv[n++] = NULL;
- error = NULL;
if (!job_new (context,
"LuksLock",
FALSE,
const char *new_secret = user_data_elements[1];
int n;
char *argv[10];
- GError *error;
char *secrets_as_stdin;
secrets_as_stdin = NULL;
argv[n++] = device->priv->device_file;
argv[n++] = NULL;
- error = NULL;
if (!job_new (context,
"LuksChangePassphrase",
FALSE,
char **options = user_data_elements[0];
int n;
char *argv[10];
- GError *error;
const char *simuldata;
gboolean nowakeup;
uid_t caller_uid;
argv[n++] = NULL;
}
- error = NULL;
-
if (!job_new (context, NULL, /* don't run this as a job */
FALSE, device, argv, NULL, drive_ata_smart_refresh_data_completed_cb, FALSE, NULL, NULL))
{
//gchar **options = user_data_elements[1];
int n;
char *argv[10];
- GError *error;
const gchar *job_name;
if (g_strcmp0 (test, "short") == 0)
argv[n++] = (char *) test;
argv[n++] = NULL;
- error = NULL;
if (!job_new (context,
job_name,
TRUE,
//gchar **options = user_data_elements[0];
int n;
char *argv[10];
- GError *error;
n = 0;
argv[n++] = "mdadm";
argv[n++] = device->priv->device_file;
argv[n++] = NULL;
- error = NULL;
if (!job_new (context, "LinuxMdStop", TRUE, device, argv, NULL, linux_md_stop_completed_cb, FALSE, NULL, NULL))
{
goto out;
gpointer *user_data_elements)
{
gchar **options = user_data_elements[0];
- gchar *filename;
int n, m;
char *argv[128];
const gchar *job_name;
- filename = NULL;
-
if (!device->priv->device_is_linux_md)
{
throw_error (context, ERROR_FAILED, "Device is not a Linux md drive");
char **options = user_data_elements[1];
int n, m;
char *argv[128];
- GError *error;
Device *slave;
slave = daemon_local_find_by_object_path (device->priv->daemon, component);
}
argv[n++] = NULL;
- error = NULL;
if (!job_new (context,
"LinuxMdRemoveComponent",
TRUE,