Revision eb159d13

b/blockdev.c
521 521
int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
522 522
{
523 523
    BlockDriverState *bs;
524
    int force = qdict_get_int(qdict, "force");
524
    int force = qdict_get_try_bool(qdict, "force", 0);
525 525
    const char *filename = qdict_get_str(qdict, "device");
526 526

  
527 527
    bs = bdrv_find(filename);
b/migration.c
75 75
{
76 76
    MigrationState *s = NULL;
77 77
    const char *p;
78
    int detach = qdict_get_int(qdict, "detach");
78
    int detach = qdict_get_try_bool(qdict, "detach", 0);
79
    int blk = qdict_get_try_bool(qdict, "blk", 0);
80
    int inc = qdict_get_try_bool(qdict, "inc", 0);
79 81
    const char *uri = qdict_get_str(qdict, "uri");
80 82

  
81 83
    if (current_migration &&
......
86 88

  
87 89
    if (strstart(uri, "tcp:", &p)) {
88 90
        s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
89
                                         (int)qdict_get_int(qdict, "blk"), 
90
                                         (int)qdict_get_int(qdict, "inc"));
91
                                         blk, inc);
91 92
#if !defined(WIN32)
92 93
    } else if (strstart(uri, "exec:", &p)) {
93 94
        s = exec_start_outgoing_migration(mon, p, max_throttle, detach,
94
                                          (int)qdict_get_int(qdict, "blk"), 
95
                                          (int)qdict_get_int(qdict, "inc"));
95
                                          blk, inc);
96 96
    } else if (strstart(uri, "unix:", &p)) {
97 97
        s = unix_start_outgoing_migration(mon, p, max_throttle, detach,
98
					  (int)qdict_get_int(qdict, "blk"), 
99
                                          (int)qdict_get_int(qdict, "inc"));
98
                                          blk, inc);
100 99
    } else if (strstart(uri, "fd:", &p)) {
101 100
        s = fd_start_outgoing_migration(mon, p, max_throttle, detach, 
102
                                        (int)qdict_get_int(qdict, "blk"), 
103
                                        (int)qdict_get_int(qdict, "inc"));
101
                                        blk, inc);
104 102
#endif
105 103
    } else {
106 104
        monitor_printf(mon, "unknown migration protocol: %s\n", uri);
b/monitor.c
3565 3565
        case '-':
3566 3566
            {
3567 3567
                const char *tmp = p;
3568
                int has_option, skip_key = 0;
3568
                int skip_key = 0;
3569 3569
                /* option */
3570 3570

  
3571 3571
                c = *typestr++;
......
3573 3573
                    goto bad_type;
3574 3574
                while (qemu_isspace(*p))
3575 3575
                    p++;
3576
                has_option = 0;
3577 3576
                if (*p == '-') {
3578 3577
                    p++;
3579 3578
                    if(c != *p) {
......
3589 3588
                    if(skip_key) {
3590 3589
                        p = tmp;
3591 3590
                    } else {
3591
                        /* has option */
3592 3592
                        p++;
3593
                        has_option = 1;
3593
                        qdict_put(qdict, key, qbool_from_int(1));
3594 3594
                    }
3595 3595
                }
3596
                qdict_put(qdict, key, qint_from_int(has_option));
3597 3596
            }
3598 3597
            break;
3599 3598
        default:
......
3985 3984
        return -1;
3986 3985
    }
3987 3986

  
3988
    if (cmd_args->type == '-') {
3989
        /* handlers expect a value, they need to be changed */
3990
        qdict_put(args, name, qint_from_int(0));
3991
    }
3992

  
3993 3987
    return 0;
3994 3988
}
3995 3989

  
......
4062 4056
                qerror_report(QERR_INVALID_PARAMETER_TYPE, name, "bool");
4063 4057
                return -1;
4064 4058
            }
4065
            if (qobject_type(value) == QTYPE_QBOOL) {
4066
                /* handlers expect a QInt, they need to be changed */
4067
                qdict_put(args, name,
4068
                         qint_from_int(qbool_get_int(qobject_to_qbool(value))));
4069
            }
4070 4059
            break;
4071 4060
        case 'O':
4072 4061
        default:

Also available in: Unified diff