~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/use-fixed-data-path.patch/vl.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
199
199
QEMUClock *rtc_clock;
200
200
int vga_interface_type = VGA_NONE;
201
201
static int full_screen = 0;
202
 
#ifdef CONFIG_SDL
203
202
static int no_frame = 0;
204
 
#endif
205
203
int no_quit = 0;
206
204
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
207
205
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
411
409
            .help = "Dump current dtb to a file and quit",
412
410
        }, {
413
411
            .name = "phandle_start",
414
 
            .type = QEMU_OPT_STRING,
 
412
            .type = QEMU_OPT_NUMBER,
415
413
            .help = "The first phandle ID we may generate dynamically",
416
414
        }, {
417
415
            .name = "dt_compatible",
436
434
 
437
435
static QemuOptsList qemu_boot_opts = {
438
436
    .name = "boot-opts",
 
437
    .implied_opt_name = "order",
 
438
    .merge_lists = true,
439
439
    .head = QTAILQ_HEAD_INITIALIZER(qemu_boot_opts.head),
440
440
    .desc = {
441
 
        /* the three names below are not used now */
442
441
        {
443
442
            .name = "order",
444
443
            .type = QEMU_OPT_STRING,
447
446
            .type = QEMU_OPT_STRING,
448
447
        }, {
449
448
            .name = "menu",
450
 
            .type = QEMU_OPT_STRING,
451
 
        /* following are really used */
 
449
            .type = QEMU_OPT_BOOL,
452
450
        }, {
453
451
            .name = "splash",
454
452
            .type = QEMU_OPT_STRING,
518
516
    },
519
517
};
520
518
 
 
519
static QemuOptsList qemu_msg_opts = {
 
520
    .name = "msg",
 
521
    .head = QTAILQ_HEAD_INITIALIZER(qemu_msg_opts.head),
 
522
    .desc = {
 
523
        {
 
524
            .name = "timestamp",
 
525
            .type = QEMU_OPT_BOOL,
 
526
        },
 
527
        { /* end of list */ }
 
528
    },
 
529
};
 
530
 
 
531
/**
 
532
 * Get machine options
 
533
 *
 
534
 * Returns: machine options (never null).
 
535
 */
 
536
QemuOpts *qemu_get_machine_opts(void)
 
537
{
 
538
    QemuOptsList *list;
 
539
    QemuOpts *opts;
 
540
 
 
541
    list = qemu_find_opts("machine");
 
542
    assert(list);
 
543
    opts = qemu_opts_find(list, NULL);
 
544
    if (!opts) {
 
545
        opts = qemu_opts_create_nofail(list);
 
546
    }
 
547
    return opts;
 
548
}
 
549
 
521
550
const char *qemu_get_vm_name(void)
522
551
{
523
552
    return qemu_name;
610
639
 
611
640
    { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
612
641
    { RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
 
642
    { RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG },
613
643
 
614
644
    { RUN_STATE_MAX, RUN_STATE_MAX },
615
645
};
1018
1048
    return 0;
1019
1049
}
1020
1050
 
1021
 
/*********QEMU USB setting******/
1022
1051
bool usb_enabled(bool default_usb)
1023
1052
{
1024
 
    QemuOpts *mach_opts;
1025
 
    mach_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
1026
 
    if (mach_opts) {
1027
 
        return qemu_opt_get_bool(mach_opts, "usb", default_usb);
1028
 
    }
1029
 
    return default_usb;
 
1053
    return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", default_usb);
1030
1054
}
1031
1055
 
1032
1056
#ifndef _WIN32
1150
1174
    boot_set_opaque = opaque;
1151
1175
}
1152
1176
 
1153
 
int qemu_boot_set(const char *boot_devices)
 
1177
int qemu_boot_set(const char *boot_order)
1154
1178
{
1155
1179
    if (!boot_set_handler) {
1156
1180
        return -EINVAL;
1157
1181
    }
1158
 
    return boot_set_handler(boot_set_opaque, boot_devices);
 
1182
    return boot_set_handler(boot_set_opaque, boot_order);
1159
1183
}
1160
1184
 
1161
 
static void validate_bootdevices(char *devices)
 
1185
static void validate_bootdevices(const char *devices)
1162
1186
{
1163
1187
    /* We just do some generic consistency checks */
1164
1188
    const char *p;
1186
1210
    }
1187
1211
}
1188
1212
 
1189
 
static void restore_boot_devices(void *opaque)
 
1213
static void restore_boot_order(void *opaque)
1190
1214
{
1191
 
    char *standard_boot_devices = opaque;
 
1215
    char *normal_boot_order = opaque;
1192
1216
    static int first = 1;
1193
1217
 
1194
1218
    /* Restore boot order and remove ourselves after the first boot */
1197
1221
        return;
1198
1222
    }
1199
1223
 
1200
 
    qemu_boot_set(standard_boot_devices);
 
1224
    qemu_boot_set(normal_boot_order);
1201
1225
 
1202
 
    qemu_unregister_reset(restore_boot_devices, standard_boot_devices);
1203
 
    g_free(standard_boot_devices);
 
1226
    qemu_unregister_reset(restore_boot_order, normal_boot_order);
 
1227
    g_free(normal_boot_order);
1204
1228
}
1205
1229
 
1206
1230
void add_boot_device_path(int32_t bootindex, DeviceState *dev,
1402
1426
    }
1403
1427
}
1404
1428
 
1405
 
static void smp_parse(const char *optarg)
 
1429
static QemuOptsList qemu_smp_opts = {
 
1430
    .name = "smp-opts",
 
1431
    .implied_opt_name = "cpus",
 
1432
    .merge_lists = true,
 
1433
    .head = QTAILQ_HEAD_INITIALIZER(qemu_smp_opts.head),
 
1434
    .desc = {
 
1435
        {
 
1436
            .name = "cpus",
 
1437
            .type = QEMU_OPT_NUMBER,
 
1438
        }, {
 
1439
            .name = "sockets",
 
1440
            .type = QEMU_OPT_NUMBER,
 
1441
        }, {
 
1442
            .name = "cores",
 
1443
            .type = QEMU_OPT_NUMBER,
 
1444
        }, {
 
1445
            .name = "threads",
 
1446
            .type = QEMU_OPT_NUMBER,
 
1447
        }, {
 
1448
            .name = "maxcpus",
 
1449
            .type = QEMU_OPT_NUMBER,
 
1450
        },
 
1451
        { /*End of list */ }
 
1452
    },
 
1453
};
 
1454
 
 
1455
static void smp_parse(QemuOpts *opts)
1406
1456
{
1407
 
    int smp, sockets = 0, threads = 0, cores = 0;
1408
 
    char *endptr;
1409
 
    char option[128];
1410
 
 
1411
 
    smp = strtoul(optarg, &endptr, 10);
1412
 
    if (endptr != optarg) {
1413
 
        if (*endptr == ',') {
1414
 
            endptr++;
1415
 
        }
1416
 
    }
1417
 
    if (get_param_value(option, 128, "sockets", endptr) != 0)
1418
 
        sockets = strtoull(option, NULL, 10);
1419
 
    if (get_param_value(option, 128, "cores", endptr) != 0)
1420
 
        cores = strtoull(option, NULL, 10);
1421
 
    if (get_param_value(option, 128, "threads", endptr) != 0)
1422
 
        threads = strtoull(option, NULL, 10);
1423
 
    if (get_param_value(option, 128, "maxcpus", endptr) != 0)
1424
 
        max_cpus = strtoull(option, NULL, 10);
1425
 
 
1426
 
    /* compute missing values, prefer sockets over cores over threads */
1427
 
    if (smp == 0 || sockets == 0) {
1428
 
        sockets = sockets > 0 ? sockets : 1;
1429
 
        cores = cores > 0 ? cores : 1;
1430
 
        threads = threads > 0 ? threads : 1;
1431
 
        if (smp == 0) {
1432
 
            smp = cores * threads * sockets;
1433
 
        }
1434
 
    } else {
1435
 
        if (cores == 0) {
 
1457
    if (opts) {
 
1458
 
 
1459
        unsigned cpus    = qemu_opt_get_number(opts, "cpus", 0);
 
1460
        unsigned sockets = qemu_opt_get_number(opts, "sockets", 0);
 
1461
        unsigned cores   = qemu_opt_get_number(opts, "cores", 0);
 
1462
        unsigned threads = qemu_opt_get_number(opts, "threads", 0);
 
1463
 
 
1464
        /* compute missing values, prefer sockets over cores over threads */
 
1465
        if (cpus == 0 || sockets == 0) {
 
1466
            sockets = sockets > 0 ? sockets : 1;
 
1467
            cores = cores > 0 ? cores : 1;
1436
1468
            threads = threads > 0 ? threads : 1;
1437
 
            cores = smp / (sockets * threads);
 
1469
            if (cpus == 0) {
 
1470
                cpus = cores * threads * sockets;
 
1471
            }
1438
1472
        } else {
1439
 
            threads = smp / (cores * sockets);
 
1473
            if (cores == 0) {
 
1474
                threads = threads > 0 ? threads : 1;
 
1475
                cores = cpus / (sockets * threads);
 
1476
            } else {
 
1477
                threads = cpus / (cores * sockets);
 
1478
            }
1440
1479
        }
 
1480
 
 
1481
        max_cpus = qemu_opt_get_number(opts, "maxcpus", 0);
 
1482
 
 
1483
        smp_cpus = cpus;
 
1484
        smp_cores = cores > 0 ? cores : 1;
 
1485
        smp_threads = threads > 0 ? threads : 1;
 
1486
 
1441
1487
    }
1442
 
    smp_cpus = smp;
1443
 
    smp_cores = cores > 0 ? cores : 1;
1444
 
    smp_threads = threads > 0 ? threads : 1;
1445
 
    if (max_cpus == 0)
 
1488
 
 
1489
    if (max_cpus == 0) {
1446
1490
        max_cpus = smp_cpus;
 
1491
    }
 
1492
 
 
1493
    if (max_cpus > 255) {
 
1494
        fprintf(stderr, "Unsupported number of maxcpus\n");
 
1495
        exit(1);
 
1496
    }
 
1497
    if (max_cpus < smp_cpus) {
 
1498
        fprintf(stderr, "maxcpus must be equal to or greater than smp\n");
 
1499
        exit(1);
 
1500
    }
 
1501
 
1447
1502
}
1448
1503
 
1449
1504
static void configure_realtime(QemuOpts *opts)
1460
1515
    }
1461
1516
}
1462
1517
 
 
1518
 
 
1519
static void configure_msg(QemuOpts *opts)
 
1520
{
 
1521
    enable_timestamp_msg = qemu_opt_get_bool(opts, "timestamp", true);
 
1522
}
 
1523
 
1463
1524
/***********************************************************/
1464
1525
/* USB devices */
1465
1526
 
1731
1792
static int powerdown_requested;
1732
1793
static int debug_requested;
1733
1794
static int suspend_requested;
1734
 
static int wakeup_requested;
 
1795
static WakeupReason wakeup_reason;
1735
1796
static NotifierList powerdown_notifiers =
1736
1797
    NOTIFIER_LIST_INITIALIZER(powerdown_notifiers);
1737
1798
static NotifierList suspend_notifiers =
1738
1799
    NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
1739
1800
static NotifierList wakeup_notifiers =
1740
1801
    NOTIFIER_LIST_INITIALIZER(wakeup_notifiers);
1741
 
static uint32_t wakeup_reason_mask = ~0;
 
1802
static uint32_t wakeup_reason_mask = ~(1 << QEMU_WAKEUP_REASON_NONE);
1742
1803
static RunState vmstop_requested = RUN_STATE_MAX;
1743
1804
 
1744
1805
int qemu_shutdown_requested_get(void)
1788
1849
    return r;
1789
1850
}
1790
1851
 
1791
 
static int qemu_wakeup_requested(void)
 
1852
static WakeupReason qemu_wakeup_requested(void)
1792
1853
{
1793
 
    int r = wakeup_requested;
1794
 
    wakeup_requested = 0;
1795
 
    return r;
 
1854
    return wakeup_reason;
1796
1855
}
1797
1856
 
1798
1857
static int qemu_powerdown_requested(void)
1909
1968
        return;
1910
1969
    }
1911
1970
    runstate_set(RUN_STATE_RUNNING);
1912
 
    notifier_list_notify(&wakeup_notifiers, &reason);
1913
 
    wakeup_requested = 1;
 
1971
    wakeup_reason = reason;
1914
1972
    qemu_notify_event();
1915
1973
}
1916
1974
 
2002
2060
        pause_all_vcpus();
2003
2061
        cpu_synchronize_all_states();
2004
2062
        qemu_system_reset(VMRESET_SILENT);
 
2063
        notifier_list_notify(&wakeup_notifiers, &wakeup_reason);
 
2064
        wakeup_reason = QEMU_WAKEUP_REASON_NONE;
2005
2065
        resume_all_vcpus();
2006
2066
        monitor_protocol_event(QEVENT_WAKEUP, NULL);
2007
2067
    }
2022
2082
    int64_t ti;
2023
2083
#endif
2024
2084
    do {
2025
 
        nonblocking = !kvm_enabled() && last_io > 0;
 
2085
        nonblocking = !kvm_enabled() && !xen_enabled() && last_io > 0;
2026
2086
#ifdef CONFIG_PROFILER
2027
2087
        ti = profile_getclock();
2028
2088
#endif
2653
2713
 
2654
2714
static int configure_accelerator(void)
2655
2715
{
2656
 
    const char *p = NULL;
 
2716
    const char *p;
2657
2717
    char buf[10];
2658
2718
    int i, ret;
2659
2719
    bool accel_initialised = false;
2660
2720
    bool init_failed = false;
2661
2721
 
2662
 
    QemuOptsList *list = qemu_find_opts("machine");
2663
 
    if (!QTAILQ_EMPTY(&list->head)) {
2664
 
        p = qemu_opt_get(QTAILQ_FIRST(&list->head), "accel");
2665
 
    }
2666
 
 
 
2722
    p = qemu_opt_get(qemu_get_machine_opts(), "accel");
2667
2723
    if (p == NULL) {
2668
2724
        /* Use the default "accelerator", tcg */
2669
2725
        p = "tcg";
2853
2909
    const char *icount_option = NULL;
2854
2910
    const char *initrd_filename;
2855
2911
    const char *kernel_filename, *kernel_cmdline;
2856
 
    char boot_devices[33] = "";
 
2912
    const char *boot_order = NULL;
2857
2913
    DisplayState *ds;
2858
2914
    int cyls, heads, secs, translation;
2859
2915
    QemuOpts *hda_opts = NULL, *opts, *machine_opts;
2907
2963
    qemu_add_opts(&qemu_trace_opts);
2908
2964
    qemu_add_opts(&qemu_option_rom_opts);
2909
2965
    qemu_add_opts(&qemu_machine_opts);
 
2966
    qemu_add_opts(&qemu_smp_opts);
2910
2967
    qemu_add_opts(&qemu_boot_opts);
2911
2968
    qemu_add_opts(&qemu_sandbox_opts);
2912
2969
    qemu_add_opts(&qemu_add_fd_opts);
2913
2970
    qemu_add_opts(&qemu_object_opts);
2914
2971
    qemu_add_opts(&qemu_tpmdev_opts);
2915
2972
    qemu_add_opts(&qemu_realtime_opts);
 
2973
    qemu_add_opts(&qemu_msg_opts);
2916
2974
 
2917
2975
    runstate_init();
2918
2976
 
3143
3201
                drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS);
3144
3202
                break;
3145
3203
            case QEMU_OPTION_boot:
3146
 
                {
3147
 
                    static const char * const params[] = {
3148
 
                        "order", "once", "menu",
3149
 
                        "splash", "splash-time",
3150
 
                        "reboot-timeout", "strict", NULL
3151
 
                    };
3152
 
                    char buf[sizeof(boot_devices)];
3153
 
                    char *standard_boot_devices;
3154
 
                    int legacy = 0;
3155
 
 
3156
 
                    if (!strchr(optarg, '=')) {
3157
 
                        legacy = 1;
3158
 
                        pstrcpy(buf, sizeof(buf), optarg);
3159
 
                    } else if (check_params(buf, sizeof(buf), params, optarg) < 0) {
3160
 
                        fprintf(stderr,
3161
 
                                "qemu: unknown boot parameter '%s' in '%s'\n",
3162
 
                                buf, optarg);
3163
 
                        exit(1);
3164
 
                    }
3165
 
 
3166
 
                    if (legacy ||
3167
 
                        get_param_value(buf, sizeof(buf), "order", optarg)) {
3168
 
                        validate_bootdevices(buf);
3169
 
                        pstrcpy(boot_devices, sizeof(boot_devices), buf);
3170
 
                    }
3171
 
                    if (!legacy) {
3172
 
                        if (get_param_value(buf, sizeof(buf),
3173
 
                                            "once", optarg)) {
3174
 
                            validate_bootdevices(buf);
3175
 
                            standard_boot_devices = g_strdup(boot_devices);
3176
 
                            pstrcpy(boot_devices, sizeof(boot_devices), buf);
3177
 
                            qemu_register_reset(restore_boot_devices,
3178
 
                                                standard_boot_devices);
3179
 
                        }
3180
 
                        if (get_param_value(buf, sizeof(buf),
3181
 
                                            "menu", optarg)) {
3182
 
                            if (!strcmp(buf, "on")) {
3183
 
                                boot_menu = 1;
3184
 
                            } else if (!strcmp(buf, "off")) {
3185
 
                                boot_menu = 0;
3186
 
                            } else {
3187
 
                                fprintf(stderr,
3188
 
                                        "qemu: invalid option value '%s'\n",
3189
 
                                        buf);
3190
 
                                exit(1);
3191
 
                            }
3192
 
                        }
3193
 
                        if (get_param_value(buf, sizeof(buf),
3194
 
                                            "strict", optarg)) {
3195
 
                            if (!strcmp(buf, "on")) {
3196
 
                                boot_strict = true;
3197
 
                            } else if (!strcmp(buf, "off")) {
3198
 
                                boot_strict = false;
3199
 
                            } else {
3200
 
                                fprintf(stderr,
3201
 
                                        "qemu: invalid option value '%s'\n",
3202
 
                                        buf);
3203
 
                                exit(1);
3204
 
                            }
3205
 
                        }
3206
 
                        if (!qemu_opts_parse(qemu_find_opts("boot-opts"),
3207
 
                                             optarg, 0)) {
3208
 
                            exit(1);
3209
 
                        }
3210
 
                    }
 
3204
                opts = qemu_opts_parse(qemu_find_opts("boot-opts"), optarg, 1);
 
3205
                if (!opts) {
 
3206
                    exit(1);
3211
3207
                }
3212
3208
                break;
3213
3209
            case QEMU_OPTION_fda:
3377
3373
                    break;
3378
3374
                }
3379
3375
            case QEMU_OPTION_monitor:
3380
 
                monitor_parse(optarg, "readline");
3381
3376
                default_monitor = 0;
 
3377
                if (strncmp(optarg, "none", 4)) {
 
3378
                    monitor_parse(optarg, "readline");
 
3379
                }
3382
3380
                break;
3383
3381
            case QEMU_OPTION_qmp:
3384
3382
                monitor_parse(optarg, "control");
3532
3530
            case QEMU_OPTION_full_screen:
3533
3531
                full_screen = 1;
3534
3532
                break;
3535
 
#ifdef CONFIG_SDL
3536
3533
            case QEMU_OPTION_no_frame:
3537
3534
                no_frame = 1;
3538
3535
                break;
3546
3543
                no_quit = 1;
3547
3544
                break;
3548
3545
            case QEMU_OPTION_sdl:
 
3546
#ifdef CONFIG_SDL
3549
3547
                display_type = DT_SDL;
3550
3548
                break;
3551
3549
#else
3552
 
            case QEMU_OPTION_no_frame:
3553
 
            case QEMU_OPTION_alt_grab:
3554
 
            case QEMU_OPTION_ctrl_grab:
3555
 
            case QEMU_OPTION_no_quit:
3556
 
            case QEMU_OPTION_sdl:
3557
3550
                fprintf(stderr, "SDL support is disabled\n");
3558
3551
                exit(1);
3559
3552
#endif
3638
3631
                }
3639
3632
                break;
3640
3633
            case QEMU_OPTION_smp:
3641
 
                smp_parse(optarg);
3642
 
                if (smp_cpus < 1) {
3643
 
                    fprintf(stderr, "Invalid number of CPUs\n");
3644
 
                    exit(1);
3645
 
                }
3646
 
                if (max_cpus < smp_cpus) {
3647
 
                    fprintf(stderr, "maxcpus must be equal to or greater than "
3648
 
                            "smp\n");
3649
 
                    exit(1);
3650
 
                }
3651
 
                if (max_cpus > 255) {
3652
 
                    fprintf(stderr, "Unsupported number of maxcpus\n");
 
3634
                if (!qemu_opts_parse(qemu_find_opts("smp-opts"), optarg, 1)) {
3653
3635
                    exit(1);
3654
3636
                }
3655
3637
                break;
3885
3867
                }
3886
3868
                configure_realtime(opts);
3887
3869
                break;
 
3870
            case QEMU_OPTION_msg:
 
3871
                opts = qemu_opts_parse(qemu_find_opts("msg"), optarg, 0);
 
3872
                if (!opts) {
 
3873
                    exit(1);
 
3874
                }
 
3875
                configure_msg(opts);
 
3876
                break;
3888
3877
            default:
3889
3878
                os_parse_cmd_args(popt->index, optarg);
3890
3879
            }
3973
3962
        data_dir[data_dir_idx++] = CONFIG_QEMU_DATADIR;
3974
3963
    }
3975
3964
 
3976
 
    /*
3977
 
     * Default to max_cpus = smp_cpus, in case the user doesn't
3978
 
     * specify a max_cpus value.
3979
 
     */
3980
 
    if (!max_cpus)
3981
 
        max_cpus = smp_cpus;
 
3965
    smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
3982
3966
 
3983
3967
    machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */
3984
3968
    if (smp_cpus > machine->max_cpus) {
4093
4077
#endif
4094
4078
    }
4095
4079
 
 
4080
    if ((no_frame || alt_grab || ctrl_grab) && display_type != DT_SDL) {
 
4081
        fprintf(stderr, "-no-frame, -alt-grab and -ctrl-grab are only valid "
 
4082
                        "for SDL, ignoring option\n");
 
4083
    }
 
4084
    if (no_quit && (display_type != DT_GTK && display_type != DT_SDL)) {
 
4085
        fprintf(stderr, "-no-quit is only valid for GTK and SDL, "
 
4086
                        "ignoring option\n");
 
4087
    }
 
4088
 
4096
4089
#if defined(CONFIG_GTK)
4097
4090
    if (display_type == DT_GTK) {
4098
4091
        early_gtk_display_init();
4132
4125
        qtest_init();
4133
4126
    }
4134
4127
 
4135
 
    machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
4136
 
    if (machine_opts) {
4137
 
        kernel_filename = qemu_opt_get(machine_opts, "kernel");
4138
 
        initrd_filename = qemu_opt_get(machine_opts, "initrd");
4139
 
        kernel_cmdline = qemu_opt_get(machine_opts, "append");
4140
 
    } else {
4141
 
        kernel_filename = initrd_filename = kernel_cmdline = NULL;
 
4128
    machine_opts = qemu_get_machine_opts();
 
4129
    kernel_filename = qemu_opt_get(machine_opts, "kernel");
 
4130
    initrd_filename = qemu_opt_get(machine_opts, "initrd");
 
4131
    kernel_cmdline = qemu_opt_get(machine_opts, "append");
 
4132
 
 
4133
    if (!boot_order) {
 
4134
        boot_order = machine->boot_order;
 
4135
    }
 
4136
    opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
 
4137
    if (opts) {
 
4138
        char *normal_boot_order;
 
4139
        const char *order, *once;
 
4140
 
 
4141
        order = qemu_opt_get(opts, "order");
 
4142
        if (order) {
 
4143
            validate_bootdevices(order);
 
4144
            boot_order = order;
 
4145
        }
 
4146
 
 
4147
        once = qemu_opt_get(opts, "once");
 
4148
        if (once) {
 
4149
            validate_bootdevices(once);
 
4150
            normal_boot_order = g_strdup(boot_order);
 
4151
            boot_order = once;
 
4152
            qemu_register_reset(restore_boot_order, normal_boot_order);
 
4153
        }
 
4154
 
 
4155
        boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu);
4142
4156
    }
4143
4157
 
4144
4158
    if (!kernel_cmdline) {
4157
4171
        exit(1);
4158
4172
    }
4159
4173
 
4160
 
    if (!linux_boot && machine_opts && qemu_opt_get(machine_opts, "dtb")) {
 
4174
    if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
4161
4175
        fprintf(stderr, "-dtb only allowed with -kernel option\n");
4162
4176
        exit(1);
4163
4177
    }
4305
4319
    qdev_machine_init();
4306
4320
 
4307
4321
    QEMUMachineInitArgs args = { .ram_size = ram_size,
4308
 
                                 .boot_device = (boot_devices[0] == '\0') ?
4309
 
                                                machine->boot_order :
4310
 
                                                boot_devices,
 
4322
                                 .boot_device = boot_order,
4311
4323
                                 .kernel_filename = kernel_filename,
4312
4324
                                 .kernel_cmdline = kernel_cmdline,
4313
4325
                                 .initrd_filename = initrd_filename,
4356
4368
#endif
4357
4369
#if defined(CONFIG_GTK)
4358
4370
    case DT_GTK:
4359
 
        gtk_display_init(ds);
 
4371
        gtk_display_init(ds, full_screen);
4360
4372
        break;
4361
4373
#endif
4362
4374
    default:
4385
4397
    }
4386
4398
#endif
4387
4399
#ifdef CONFIG_SPICE
4388
 
    if (using_spice && !qxl_enabled) {
 
4400
    if (using_spice && !spice_displays) {
4389
4401
        qemu_spice_display_init(ds);
4390
4402
    }
4391
4403
#endif