mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
qapi block: Elide redundant has_FOO in generated C
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/block*.json. Said commit explains the transformation in more detail. There is one instance of the invariant violation mentioned there: qcow2_signal_corruption() passes false, "" when node_name is an empty string. Take care to pass NULL then. The previous two commits cleaned up two more. Additionally, helper bdrv_latency_histogram_stats() loses its output parameters and returns a value instead. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Hanna Reitz <hreitz@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221104160712.3005652-11-armbru@redhat.com> [Fixes for #ifndef LIBRBD_SUPPORTS_ENCRYPTION and MacOS squashed in]
This commit is contained in:
parent
8461b4d601
commit
54fde4ff06
23 changed files with 173 additions and 281 deletions
11
ui/cocoa.m
11
ui/cocoa.m
|
@ -1481,8 +1481,8 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven
|
|||
|
||||
__block Error *err = NULL;
|
||||
with_iothread_lock(^{
|
||||
qmp_eject(true, [drive cStringUsingEncoding: NSASCIIStringEncoding],
|
||||
false, NULL, false, false, &err);
|
||||
qmp_eject([drive cStringUsingEncoding: NSASCIIStringEncoding],
|
||||
NULL, false, false, &err);
|
||||
});
|
||||
handleAnyDeviceErrors(err);
|
||||
}
|
||||
|
@ -1516,13 +1516,12 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven
|
|||
|
||||
__block Error *err = NULL;
|
||||
with_iothread_lock(^{
|
||||
qmp_blockdev_change_medium(true,
|
||||
[drive cStringUsingEncoding:
|
||||
qmp_blockdev_change_medium([drive cStringUsingEncoding:
|
||||
NSASCIIStringEncoding],
|
||||
false, NULL,
|
||||
NULL,
|
||||
[file cStringUsingEncoding:
|
||||
NSASCIIStringEncoding],
|
||||
true, "raw",
|
||||
"raw",
|
||||
true, false,
|
||||
false, 0,
|
||||
&err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue