@@ -241,7 +241,6 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
241
241
DriveMirror mirror = {
242
242
.device = (char * )qdict_get_str (qdict , "device" ),
243
243
.target = (char * )filename ,
244
- .has_format = !!format ,
245
244
.format = (char * )format ,
246
245
.sync = full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP ,
247
246
.has_mode = true,
@@ -270,7 +269,6 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
270
269
DriveBackup backup = {
271
270
.device = (char * )device ,
272
271
.target = (char * )filename ,
273
- .has_format = !!format ,
274
272
.format = (char * )format ,
275
273
.sync = full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP ,
276
274
.has_mode = true,
@@ -360,9 +358,7 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
360
358
}
361
359
362
360
mode = reuse ? NEW_IMAGE_MODE_EXISTING : NEW_IMAGE_MODE_ABSOLUTE_PATHS ;
363
- qmp_blockdev_snapshot_sync (true, device , false, NULL ,
364
- filename , false, NULL ,
365
- !!format , format ,
361
+ qmp_blockdev_snapshot_sync (device , NULL , filename , NULL , format ,
366
362
true, mode , & err );
367
363
end :
368
364
hmp_handle_error (mon , err );
@@ -385,8 +381,7 @@ void hmp_snapshot_delete_blkdev_internal(Monitor *mon, const QDict *qdict)
385
381
const char * id = qdict_get_try_str (qdict , "id" );
386
382
Error * err = NULL ;
387
383
388
- qmp_blockdev_snapshot_delete_internal_sync (device , !!id , id ,
389
- true, name , & err );
384
+ qmp_blockdev_snapshot_delete_internal_sync (device , id , name , & err );
390
385
hmp_handle_error (mon , err );
391
386
}
392
387
@@ -427,7 +422,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
427
422
block_list = qmp_query_block (NULL );
428
423
429
424
for (info = block_list ; info ; info = info -> next ) {
430
- if (!info -> value -> has_inserted ) {
425
+ if (!info -> value -> inserted ) {
431
426
continue ;
432
427
}
433
428
@@ -460,7 +455,6 @@ void hmp_nbd_server_add(Monitor *mon, const QDict *qdict)
460
455
461
456
NbdServerAddOptions export = {
462
457
.device = (char * ) device ,
463
- .has_name = !!name ,
464
458
.name = (char * ) name ,
465
459
.has_writable = true,
466
460
.writable = writable ,
@@ -495,7 +489,7 @@ void coroutine_fn hmp_block_resize(Monitor *mon, const QDict *qdict)
495
489
int64_t size = qdict_get_int (qdict , "size" );
496
490
Error * err = NULL ;
497
491
498
- qmp_block_resize (true, device , false , NULL , size , & err );
492
+ qmp_block_resize (device , NULL , size , & err );
499
493
hmp_handle_error (mon , err );
500
494
}
501
495
@@ -506,11 +500,10 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
506
500
const char * base = qdict_get_try_str (qdict , "base" );
507
501
int64_t speed = qdict_get_try_int (qdict , "speed" , 0 );
508
502
509
- qmp_block_stream (true, device , device , base != NULL , base , false, NULL ,
510
- false, NULL , false, NULL ,
511
- qdict_haskey (qdict , "speed" ), speed , true,
512
- BLOCKDEV_ON_ERROR_REPORT , false, NULL , false, false, false,
513
- false, & error );
503
+ qmp_block_stream (device , device , base , NULL , NULL , NULL ,
504
+ qdict_haskey (qdict , "speed" ), speed ,
505
+ true, BLOCKDEV_ON_ERROR_REPORT , NULL ,
506
+ false, false, false, false, & error );
514
507
515
508
hmp_handle_error (mon , error );
516
509
}
@@ -534,10 +527,8 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict)
534
527
* version has only one, so we must decide which one to pass.
535
528
*/
536
529
if (blk_by_name (device )) {
537
- throttle .has_device = true;
538
530
throttle .device = device ;
539
531
} else {
540
- throttle .has_id = true;
541
532
throttle .id = device ;
542
533
}
543
534
@@ -551,7 +542,7 @@ void hmp_eject(Monitor *mon, const QDict *qdict)
551
542
const char * device = qdict_get_str (qdict , "device" );
552
543
Error * err = NULL ;
553
544
554
- qmp_eject (true, device , false , NULL , true, force , & err );
545
+ qmp_eject (device , NULL , true, force , & err );
555
546
hmp_handle_error (mon , err );
556
547
}
557
548
@@ -635,18 +626,18 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
635
626
{
636
627
ImageInfo * image_info ;
637
628
638
- assert (!info || !info -> has_inserted || info -> inserted == inserted );
629
+ assert (!info || !info -> inserted || info -> inserted == inserted );
639
630
640
631
if (info && * info -> device ) {
641
632
monitor_puts (mon , info -> device );
642
- if (inserted && inserted -> has_node_name ) {
633
+ if (inserted && inserted -> node_name ) {
643
634
monitor_printf (mon , " (%s)" , inserted -> node_name );
644
635
}
645
636
} else {
646
637
assert (info || inserted );
647
638
monitor_puts (mon ,
648
- inserted && inserted -> has_node_name ? inserted -> node_name
649
- : info && info -> has_qdev ? info -> qdev
639
+ inserted && inserted -> node_name ? inserted -> node_name
640
+ : info && info -> qdev ? info -> qdev
650
641
: "<anonymous>" );
651
642
}
652
643
@@ -661,7 +652,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
661
652
}
662
653
663
654
if (info ) {
664
- if (info -> has_qdev ) {
655
+ if (info -> qdev ) {
665
656
monitor_printf (mon , " Attached to: %s\n" , info -> qdev );
666
657
}
667
658
if (info -> has_io_status && info -> io_status != BLOCK_DEVICE_IO_STATUS_OK ) {
@@ -686,7 +677,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
686
677
inserted -> cache -> direct ? ", direct" : "" ,
687
678
inserted -> cache -> no_flush ? ", ignore flushes" : "" );
688
679
689
- if (inserted -> has_backing_file ) {
680
+ if (inserted -> backing_file ) {
690
681
monitor_printf (mon ,
691
682
" Backing file: %s "
692
683
"(chain depth: %" PRId64 ")\n" ,
@@ -735,7 +726,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
735
726
image_info = inserted -> image ;
736
727
while (1 ) {
737
728
bdrv_image_info_dump (image_info );
738
- if (image_info -> has_backing_image ) {
729
+ if (image_info -> backing_image ) {
739
730
image_info = image_info -> backing_image ;
740
731
} else {
741
732
break ;
@@ -769,8 +760,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
769
760
monitor_printf (mon , "\n" );
770
761
}
771
762
772
- print_block_info (mon , info -> value , info -> value -> has_inserted
773
- ? info -> value -> inserted : NULL ,
763
+ print_block_info (mon , info -> value , info -> value -> inserted ,
774
764
verbose );
775
765
printed = true;
776
766
}
@@ -784,7 +774,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
784
774
/* Print node information */
785
775
blockdev_list = qmp_query_named_block_nodes (false, false, NULL );
786
776
for (blockdev = blockdev_list ; blockdev ; blockdev = blockdev -> next ) {
787
- assert (blockdev -> value -> has_node_name );
777
+ assert (blockdev -> value -> node_name );
788
778
if (device && strcmp (device , blockdev -> value -> node_name )) {
789
779
continue ;
790
780
}
@@ -805,7 +795,7 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
805
795
stats_list = qmp_query_blockstats (false, false, NULL );
806
796
807
797
for (stats = stats_list ; stats ; stats = stats -> next ) {
808
- if (!stats -> value -> has_device ) {
798
+ if (!stats -> value -> device ) {
809
799
continue ;
810
800
}
811
801
0 commit comments