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

« back to all changes in this revision

Viewing changes to .pc/retry-pxe-after-efi.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
2642
2702
 
2643
2703
static int configure_accelerator(void)
2644
2704
{
2645
 
    const char *p = NULL;
 
2705
    const char *p;
2646
2706
    char buf[10];
2647
2707
    int i, ret;
2648
2708
    bool accel_initialised = false;
2649
2709
    bool init_failed = false;
2650
2710
 
2651
 
    QemuOptsList *list = qemu_find_opts("machine");
2652
 
    if (!QTAILQ_EMPTY(&list->head)) {
2653
 
        p = qemu_opt_get(QTAILQ_FIRST(&list->head), "accel");
2654
 
    }
2655
 
 
 
2711
    p = qemu_opt_get(qemu_get_machine_opts(), "accel");
2656
2712
    if (p == NULL) {
2657
2713
        /* Use the default "accelerator", tcg */
2658
2714
        p = "tcg";
2842
2898
    const char *icount_option = NULL;
2843
2899
    const char *initrd_filename;
2844
2900
    const char *kernel_filename, *kernel_cmdline;
2845
 
    char boot_devices[33] = "";
 
2901
    const char *boot_order = NULL;
2846
2902
    DisplayState *ds;
2847
2903
    int cyls, heads, secs, translation;
2848
2904
    QemuOpts *hda_opts = NULL, *opts, *machine_opts;
2896
2952
    qemu_add_opts(&qemu_trace_opts);
2897
2953
    qemu_add_opts(&qemu_option_rom_opts);
2898
2954
    qemu_add_opts(&qemu_machine_opts);
 
2955
    qemu_add_opts(&qemu_smp_opts);
2899
2956
    qemu_add_opts(&qemu_boot_opts);
2900
2957
    qemu_add_opts(&qemu_sandbox_opts);
2901
2958
    qemu_add_opts(&qemu_add_fd_opts);
2902
2959
    qemu_add_opts(&qemu_object_opts);
2903
2960
    qemu_add_opts(&qemu_tpmdev_opts);
2904
2961
    qemu_add_opts(&qemu_realtime_opts);
 
2962
    qemu_add_opts(&qemu_msg_opts);
2905
2963
 
2906
2964
    runstate_init();
2907
2965
 
3132
3190
                drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS);
3133
3191
                break;
3134
3192
            case QEMU_OPTION_boot:
3135
 
                {
3136
 
                    static const char * const params[] = {
3137
 
                        "order", "once", "menu",
3138
 
                        "splash", "splash-time",
3139
 
                        "reboot-timeout", "strict", NULL
3140
 
                    };
3141
 
                    char buf[sizeof(boot_devices)];
3142
 
                    char *standard_boot_devices;
3143
 
                    int legacy = 0;
3144
 
 
3145
 
                    if (!strchr(optarg, '=')) {
3146
 
                        legacy = 1;
3147
 
                        pstrcpy(buf, sizeof(buf), optarg);
3148
 
                    } else if (check_params(buf, sizeof(buf), params, optarg) < 0) {
3149
 
                        fprintf(stderr,
3150
 
                                "qemu: unknown boot parameter '%s' in '%s'\n",
3151
 
                                buf, optarg);
3152
 
                        exit(1);
3153
 
                    }
3154
 
 
3155
 
                    if (legacy ||
3156
 
                        get_param_value(buf, sizeof(buf), "order", optarg)) {
3157
 
                        validate_bootdevices(buf);
3158
 
                        pstrcpy(boot_devices, sizeof(boot_devices), buf);
3159
 
                    }
3160
 
                    if (!legacy) {
3161
 
                        if (get_param_value(buf, sizeof(buf),
3162
 
                                            "once", optarg)) {
3163
 
                            validate_bootdevices(buf);
3164
 
                            standard_boot_devices = g_strdup(boot_devices);
3165
 
                            pstrcpy(boot_devices, sizeof(boot_devices), buf);
3166
 
                            qemu_register_reset(restore_boot_devices,
3167
 
                                                standard_boot_devices);
3168
 
                        }
3169
 
                        if (get_param_value(buf, sizeof(buf),
3170
 
                                            "menu", optarg)) {
3171
 
                            if (!strcmp(buf, "on")) {
3172
 
                                boot_menu = 1;
3173
 
                            } else if (!strcmp(buf, "off")) {
3174
 
                                boot_menu = 0;
3175
 
                            } else {
3176
 
                                fprintf(stderr,
3177
 
                                        "qemu: invalid option value '%s'\n",
3178
 
                                        buf);
3179
 
                                exit(1);
3180
 
                            }
3181
 
                        }
3182
 
                        if (get_param_value(buf, sizeof(buf),
3183
 
                                            "strict", optarg)) {
3184
 
                            if (!strcmp(buf, "on")) {
3185
 
                                boot_strict = true;
3186
 
                            } else if (!strcmp(buf, "off")) {
3187
 
                                boot_strict = false;
3188
 
                            } else {
3189
 
                                fprintf(stderr,
3190
 
                                        "qemu: invalid option value '%s'\n",
3191
 
                                        buf);
3192
 
                                exit(1);
3193
 
                            }
3194
 
                        }
3195
 
                        if (!qemu_opts_parse(qemu_find_opts("boot-opts"),
3196
 
                                             optarg, 0)) {
3197
 
                            exit(1);
3198
 
                        }
3199
 
                    }
 
3193
                opts = qemu_opts_parse(qemu_find_opts("boot-opts"), optarg, 1);
 
3194
                if (!opts) {
 
3195
                    exit(1);
3200
3196
                }
3201
3197
                break;
3202
3198
            case QEMU_OPTION_fda:
3366
3362
                    break;
3367
3363
                }
3368
3364
            case QEMU_OPTION_monitor:
3369
 
                monitor_parse(optarg, "readline");
3370
3365
                default_monitor = 0;
 
3366
                if (strncmp(optarg, "none", 4)) {
 
3367
                    monitor_parse(optarg, "readline");
 
3368
                }
3371
3369
                break;
3372
3370
            case QEMU_OPTION_qmp:
3373
3371
                monitor_parse(optarg, "control");
3521
3519
            case QEMU_OPTION_full_screen:
3522
3520
                full_screen = 1;
3523
3521
                break;
3524
 
#ifdef CONFIG_SDL
3525
3522
            case QEMU_OPTION_no_frame:
3526
3523
                no_frame = 1;
3527
3524
                break;
3535
3532
                no_quit = 1;
3536
3533
                break;
3537
3534
            case QEMU_OPTION_sdl:
 
3535
#ifdef CONFIG_SDL
3538
3536
                display_type = DT_SDL;
3539
3537
                break;
3540
3538
#else
3541
 
            case QEMU_OPTION_no_frame:
3542
 
            case QEMU_OPTION_alt_grab:
3543
 
            case QEMU_OPTION_ctrl_grab:
3544
 
            case QEMU_OPTION_no_quit:
3545
 
            case QEMU_OPTION_sdl:
3546
3539
                fprintf(stderr, "SDL support is disabled\n");
3547
3540
                exit(1);
3548
3541
#endif
3627
3620
                }
3628
3621
                break;
3629
3622
            case QEMU_OPTION_smp:
3630
 
                smp_parse(optarg);
3631
 
                if (smp_cpus < 1) {
3632
 
                    fprintf(stderr, "Invalid number of CPUs\n");
3633
 
                    exit(1);
3634
 
                }
3635
 
                if (max_cpus < smp_cpus) {
3636
 
                    fprintf(stderr, "maxcpus must be equal to or greater than "
3637
 
                            "smp\n");
3638
 
                    exit(1);
3639
 
                }
3640
 
                if (max_cpus > 255) {
3641
 
                    fprintf(stderr, "Unsupported number of maxcpus\n");
 
3623
                if (!qemu_opts_parse(qemu_find_opts("smp-opts"), optarg, 1)) {
3642
3624
                    exit(1);
3643
3625
                }
3644
3626
                break;
3874
3856
                }
3875
3857
                configure_realtime(opts);
3876
3858
                break;
 
3859
            case QEMU_OPTION_msg:
 
3860
                opts = qemu_opts_parse(qemu_find_opts("msg"), optarg, 0);
 
3861
                if (!opts) {
 
3862
                    exit(1);
 
3863
                }
 
3864
                configure_msg(opts);
 
3865
                break;
3877
3866
            default:
3878
3867
                os_parse_cmd_args(popt->index, optarg);
3879
3868
            }
3962
3951
        data_dir[data_dir_idx++] = CONFIG_QEMU_DATADIR;
3963
3952
    }
3964
3953
 
3965
 
    /*
3966
 
     * Default to max_cpus = smp_cpus, in case the user doesn't
3967
 
     * specify a max_cpus value.
3968
 
     */
3969
 
    if (!max_cpus)
3970
 
        max_cpus = smp_cpus;
 
3954
    smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
3971
3955
 
3972
3956
    machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */
3973
3957
    if (smp_cpus > machine->max_cpus) {
4082
4066
#endif
4083
4067
    }
4084
4068
 
 
4069
    if ((no_frame || alt_grab || ctrl_grab) && display_type != DT_SDL) {
 
4070
        fprintf(stderr, "-no-frame, -alt-grab and -ctrl-grab are only valid "
 
4071
                        "for SDL, ignoring option\n");
 
4072
    }
 
4073
    if (no_quit && (display_type != DT_GTK && display_type != DT_SDL)) {
 
4074
        fprintf(stderr, "-no-quit is only valid for GTK and SDL, "
 
4075
                        "ignoring option\n");
 
4076
    }
 
4077
 
4085
4078
#if defined(CONFIG_GTK)
4086
4079
    if (display_type == DT_GTK) {
4087
4080
        early_gtk_display_init();
4121
4114
        qtest_init();
4122
4115
    }
4123
4116
 
4124
 
    machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
4125
 
    if (machine_opts) {
4126
 
        kernel_filename = qemu_opt_get(machine_opts, "kernel");
4127
 
        initrd_filename = qemu_opt_get(machine_opts, "initrd");
4128
 
        kernel_cmdline = qemu_opt_get(machine_opts, "append");
4129
 
    } else {
4130
 
        kernel_filename = initrd_filename = kernel_cmdline = NULL;
 
4117
    machine_opts = qemu_get_machine_opts();
 
4118
    kernel_filename = qemu_opt_get(machine_opts, "kernel");
 
4119
    initrd_filename = qemu_opt_get(machine_opts, "initrd");
 
4120
    kernel_cmdline = qemu_opt_get(machine_opts, "append");
 
4121
 
 
4122
    if (!boot_order) {
 
4123
        boot_order = machine->boot_order;
 
4124
    }
 
4125
    opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
 
4126
    if (opts) {
 
4127
        char *normal_boot_order;
 
4128
        const char *order, *once;
 
4129
 
 
4130
        order = qemu_opt_get(opts, "order");
 
4131
        if (order) {
 
4132
            validate_bootdevices(order);
 
4133
            boot_order = order;
 
4134
        }
 
4135
 
 
4136
        once = qemu_opt_get(opts, "once");
 
4137
        if (once) {
 
4138
            validate_bootdevices(once);
 
4139
            normal_boot_order = g_strdup(boot_order);
 
4140
            boot_order = once;
 
4141
            qemu_register_reset(restore_boot_order, normal_boot_order);
 
4142
        }
 
4143
 
 
4144
        boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu);
4131
4145
    }
4132
4146
 
4133
4147
    if (!kernel_cmdline) {
4146
4160
        exit(1);
4147
4161
    }
4148
4162
 
4149
 
    if (!linux_boot && machine_opts && qemu_opt_get(machine_opts, "dtb")) {
 
4163
    if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
4150
4164
        fprintf(stderr, "-dtb only allowed with -kernel option\n");
4151
4165
        exit(1);
4152
4166
    }
4294
4308
    qdev_machine_init();
4295
4309
 
4296
4310
    QEMUMachineInitArgs args = { .ram_size = ram_size,
4297
 
                                 .boot_device = (boot_devices[0] == '\0') ?
4298
 
                                                machine->boot_order :
4299
 
                                                boot_devices,
 
4311
                                 .boot_device = boot_order,
4300
4312
                                 .kernel_filename = kernel_filename,
4301
4313
                                 .kernel_cmdline = kernel_cmdline,
4302
4314
                                 .initrd_filename = initrd_filename,
4345
4357
#endif
4346
4358
#if defined(CONFIG_GTK)
4347
4359
    case DT_GTK:
4348
 
        gtk_display_init(ds);
 
4360
        gtk_display_init(ds, full_screen);
4349
4361
        break;
4350
4362
#endif
4351
4363
    default:
4374
4386
    }
4375
4387
#endif
4376
4388
#ifdef CONFIG_SPICE
4377
 
    if (using_spice && !qxl_enabled) {
 
4389
    if (using_spice && !spice_displays) {
4378
4390
        qemu_spice_display_init(ds);
4379
4391
    }
4380
4392
#endif