Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Günther Wagner
gnome-builder
Commits
f5357976
Commit
f5357976
authored
Mar 21, 2018
by
Christian Hergert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qemu: port to IdeTask
parent
46c8f034
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
src/plugins/qemu/gbp-qemu-device-provider.c
src/plugins/qemu/gbp-qemu-device-provider.c
+24
-24
No files found.
src/plugins/qemu/gbp-qemu-device-provider.c
View file @
f5357976
...
...
@@ -44,7 +44,7 @@ static const struct {
#ifdef __linux__
static
void
gbp_qemu_device_provider_load_worker
(
G
Task
*
task
,
gbp_qemu_device_provider_load_worker
(
Ide
Task
*
task
,
gpointer
source_object
,
gpointer
task_data
,
GCancellable
*
cancellable
)
...
...
@@ -57,7 +57,7 @@ gbp_qemu_device_provider_load_worker (GTask *task,
IDE_ENTRY
;
g_assert
(
G
_IS_TASK
(
task
));
g_assert
(
IDE
_IS_TASK
(
task
));
g_assert
(
GBP_IS_QEMU_DEVICE_PROVIDER
(
source_object
));
g_assert
(
!
cancellable
||
G_IS_CANCELLABLE
(
cancellable
));
...
...
@@ -69,33 +69,33 @@ gbp_qemu_device_provider_load_worker (GTask *task,
if
(
!
ide_g_host_file_get_contents
(
"/proc/mounts"
,
&
mounts
,
NULL
,
&
error
))
{
g
_task_return_error
(
task
,
g_steal_pointer
(
&
error
));
ide
_task_return_error
(
task
,
g_steal_pointer
(
&
error
));
IDE_EXIT
;
}
/* @mounts is guaranteed to have a \0 suffix */
if
(
strstr
(
mounts
,
"binfmt"
)
==
NULL
)
{
g
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_FAILED
,
"binfmt is missing from /proc/mounts"
);
ide
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_FAILED
,
"binfmt is missing from /proc/mounts"
);
IDE_EXIT
;
}
if
(
!
ide_g_host_file_get_contents
(
"/proc/sys/fs/binfmt_misc/status"
,
&
status
,
NULL
,
&
error
))
{
g
_task_return_error
(
task
,
g_steal_pointer
(
&
error
));
ide
_task_return_error
(
task
,
g_steal_pointer
(
&
error
));
IDE_EXIT
;
}
/* @status is guaranteed to have a \0 suffix */
if
(
!
g_str_equal
(
g_strstrip
(
status
),
"enabled"
))
{
g
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_FAILED
,
"binfmt hooks are not currently enabled"
);
ide
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_FAILED
,
"binfmt hooks are not currently enabled"
);
IDE_EXIT
;
}
...
...
@@ -137,9 +137,9 @@ gbp_qemu_device_provider_load_worker (GTask *task,
}
}
g
_task_return_pointer
(
task
,
g_steal_pointer
(
&
devices
),
(
GDestroyNotify
)
g_ptr_array_unref
);
ide
_task_return_pointer
(
task
,
g_steal_pointer
(
&
devices
),
(
GDestroyNotify
)
g_ptr_array_unref
);
IDE_EXIT
;
}
...
...
@@ -151,23 +151,23 @@ gbp_qemu_device_provider_load_async (IdeDeviceProvider *provider,
GAsyncReadyCallback
callback
,
gpointer
user_data
)
{
g_autoptr
(
G
Task
)
task
=
NULL
;
g_autoptr
(
Ide
Task
)
task
=
NULL
;
IDE_ENTRY
;
g_assert
(
GBP_IS_QEMU_DEVICE_PROVIDER
(
provider
));
g_assert
(
!
cancellable
||
G_IS_CANCELLABLE
(
cancellable
));
task
=
g
_task_new
(
provider
,
cancellable
,
callback
,
user_data
);
g
_task_set_source_tag
(
task
,
gbp_qemu_device_provider_load_async
);
task
=
ide
_task_new
(
provider
,
cancellable
,
callback
,
user_data
);
ide
_task_set_source_tag
(
task
,
gbp_qemu_device_provider_load_async
);
#ifdef __linux__
g
_task_run_in_thread
(
task
,
gbp_qemu_device_provider_load_worker
);
ide
_task_run_in_thread
(
task
,
gbp_qemu_device_provider_load_worker
);
#else
g
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_NOT_SUPPORTED
,
"Qemu device hooks are only supported on Linux"
);
ide
_task_return_new_error
(
task
,
G_IO_ERROR
,
G_IO_ERROR_NOT_SUPPORTED
,
"Qemu device hooks are only supported on Linux"
);
#endif
IDE_EXIT
;
...
...
@@ -185,7 +185,7 @@ gbp_qemu_device_provider_load_finish (IdeDeviceProvider *provider,
g_assert
(
IDE_IS_DEVICE_PROVIDER
(
provider
));
g_assert
(
G_IS_ASYNC_RESULT
(
result
));
if
((
devices
=
g
_task_propagate_pointer
(
G
_TASK
(
result
),
error
)))
if
((
devices
=
ide
_task_propagate_pointer
(
IDE
_TASK
(
result
),
error
)))
{
for
(
guint
i
=
0
;
i
<
devices
->
len
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment