]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 3 Mar 2015 12:07:47 +0000 (12:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 3 Mar 2015 12:07:47 +0000 (12:07 +0000)
- more config options
- bootdevice, iscsi, virtio-scsi fixes
- build system patches for MinGW and config-devices.mak
- qemu_mutex_lock_iothread deadlock fixes
- another tiny patch from the record/replay series

# gpg: Signature made Mon Mar  2 09:59:14 2015 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  cpus: be more paranoid in avoiding deadlocks
  cpus: fix deadlock and segfault in qemu_mutex_lock_iothread
  virtio-scsi: Allocate op blocker reason before blocking
  Makefile.target: binary depends on config-devices
  Makefile: don't silence mak file test with V=1
  Makefile: fix up parallel building under MSYS+MinGW
  iscsi: Handle write protected case in reopen
  Give ivshmem its own config option
  Create specific config option for "platform-bus"
  Add specific config options for PCI-E bridges
  bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
  timer: replace time() with QEMU_CLOCK_HOST
  virtio-scsi-dataplane: Call blk_set_aio_context within BQL
  block: Forbid bdrv_set_aio_context outside BQL
  scsi: give device a parent before setting properties

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
vl.c

diff --combined vl.c
index 09693f5f0c7fa6c7bbedd365e4f0ca84e5ce8b01,9213f687f1f19d38f78d2b19d5680ed73e14d558..5d13d2fd5ef36b88d02956ee7a213edabbea0ccb
--- 1/vl.c
--- 2/vl.c
+++ b/vl.c
@@@ -78,7 -78,6 +78,7 @@@ int main(int argc, char **argv
  #include "monitor/monitor.h"
  #include "ui/console.h"
  #include "sysemu/sysemu.h"
 +#include "sysemu/numa.h"
  #include "exec/gdbstub.h"
  #include "qemu/timer.h"
  #include "sysemu/char.h"
@@@ -184,6 -183,10 +184,6 @@@ uint8_t qemu_extra_params_fw[2]
  
  int icount_align_option;
  
 -int nb_numa_nodes;
 -int max_numa_nodeid;
 -NodeInfo numa_info[MAX_NODES];
 -
  /* The bytes in qemu_uuid[] are in the order specified by RFC4122, _not_ in the
   * little-endian "wire format" described in the SMBIOS 2.6 specification.
   */
@@@ -707,13 -710,17 +707,17 @@@ void vm_start(void
  /***********************************************************/
  /* real time host monotonic timer */
  
+ static time_t qemu_time(void)
+ {
+     return qemu_clock_get_ms(QEMU_CLOCK_HOST) / 1000;
+ }
  /***********************************************************/
  /* host time/date access */
  void qemu_get_timedate(struct tm *tm, int offset)
  {
-     time_t ti;
+     time_t ti = qemu_time();
  
-     time(&ti);
      ti += offset;
      if (rtc_date_offset == -1) {
          if (rtc_utc)
@@@ -741,7 -748,7 +745,7 @@@ int qemu_timedate_diff(struct tm *tm
      else
          seconds = mktimegm(tm) + rtc_date_offset;
  
-     return seconds - time(NULL);
+     return seconds - qemu_time();
  }
  
  static void configure_rtc_date_offset(const char *startdate, int legacy)
                              "'2006-06-17T16:01:21' or '2006-06-17'\n");
              exit(1);
          }
-         rtc_date_offset = time(NULL) - rtc_start_date;
+         rtc_date_offset = qemu_time() - rtc_start_date;
      }
  }
  
@@@ -1093,7 -1100,7 +1097,7 @@@ static int drive_init_func(QemuOpts *op
  static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
  {
      if (qemu_opt_get(opts, "snapshot") == NULL) {
 -        qemu_opt_set(opts, "snapshot", "on");
 +        qemu_opt_set(opts, "snapshot", "on", &error_abort);
      }
      return 0;
  }
@@@ -2071,7 -2078,7 +2075,7 @@@ static int balloon_parse(const char *ar
              opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
                                      &error_abort);
          }
 -        qemu_opt_set(opts, "driver", "virtio-balloon");
 +        qemu_opt_set(opts, "driver", "virtio-balloon", &error_abort);
          return 0;
      }
  
@@@ -2217,11 -2224,11 +2221,11 @@@ static void monitor_parse(const char *o
          error_report_err(local_err);
          exit(1);
      }
 -    qemu_opt_set(opts, "mode", mode);
 -    qemu_opt_set(opts, "chardev", label);
 -    qemu_opt_set_bool(opts, "pretty", pretty);
 +    qemu_opt_set(opts, "mode", mode, &error_abort);
 +    qemu_opt_set(opts, "chardev", label, &error_abort);
 +    qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
      if (def)
 -        qemu_opt_set(opts, "default", "on");
 +        qemu_opt_set(opts, "default", "on", &error_abort);
      monitor_device_index++;
  }
  
@@@ -2333,13 -2340,13 +2337,13 @@@ static int virtcon_parse(const char *de
  
      bus_opts = qemu_opts_create(device, NULL, 0, &error_abort);
      if (arch_type == QEMU_ARCH_S390X) {
 -        qemu_opt_set(bus_opts, "driver", "virtio-serial-s390");
 +        qemu_opt_set(bus_opts, "driver", "virtio-serial-s390", &error_abort);
      } else {
 -        qemu_opt_set(bus_opts, "driver", "virtio-serial-pci");
 +        qemu_opt_set(bus_opts, "driver", "virtio-serial-pci", &error_abort);
      }
  
      dev_opts = qemu_opts_create(device, NULL, 0, &error_abort);
 -    qemu_opt_set(dev_opts, "driver", "virtconsole");
 +    qemu_opt_set(dev_opts, "driver", "virtconsole", &error_abort);
  
      snprintf(label, sizeof(label), "virtcon%d", index);
      virtcon_hds[index] = qemu_chr_new(label, devname, NULL);
                  " to character backend '%s'\n", devname);
          return -1;
      }
 -    qemu_opt_set(dev_opts, "chardev", label);
 +    qemu_opt_set(dev_opts, "chardev", label, &error_abort);
  
      index++;
      return 0;
@@@ -2372,7 -2379,7 +2376,7 @@@ static int sclp_parse(const char *devna
      assert(arch_type == QEMU_ARCH_S390X);
  
      dev_opts = qemu_opts_create(device, NULL, 0, NULL);
 -    qemu_opt_set(dev_opts, "driver", "sclpconsole");
 +    qemu_opt_set(dev_opts, "driver", "sclpconsole", &error_abort);
  
      snprintf(label, sizeof(label), "sclpcon%d", index);
      sclp_hds[index] = qemu_chr_new(label, devname, NULL);
                  " to character backend '%s'\n", devname);
          return -1;
      }
 -    qemu_opt_set(dev_opts, "chardev", label);
 +    qemu_opt_set(dev_opts, "chardev", label, &error_abort);
  
      index++;
      return 0;
@@@ -2399,8 -2406,8 +2403,8 @@@ static int debugcon_parse(const char *d
          fprintf(stderr, "qemu: already have a debugcon device\n");
          exit(1);
      }
 -    qemu_opt_set(opts, "driver", "isa-debugcon");
 -    qemu_opt_set(opts, "chardev", "debugcon");
 +    qemu_opt_set(opts, "driver", "isa-debugcon", &error_abort);
 +    qemu_opt_set(opts, "chardev", "debugcon", &error_abort);
      return 0;
  }
  
@@@ -2681,7 -2688,7 +2685,7 @@@ static void set_memory_options(uint64_
      }
  
      /* store value for the future use */
 -    qemu_opt_set_number(opts, "size", ram_size);
 +    qemu_opt_set_number(opts, "size", ram_size, &error_abort);
      *maxram_size = ram_size;
  
      maxmem_str = qemu_opt_get(opts, "maxmem");
@@@ -2813,6 -2820,14 +2817,6 @@@ int main(int argc, char **argv, char **
      cyls = heads = secs = 0;
      translation = BIOS_ATA_TRANSLATION_AUTO;
  
 -    for (i = 0; i < MAX_NODES; i++) {
 -        numa_info[i].node_mem = 0;
 -        numa_info[i].present = false;
 -        bitmap_zero(numa_info[i].node_cpu, MAX_CPUMASK_BITS);
 -    }
 -
 -    nb_numa_nodes = 0;
 -    max_numa_nodeid = 0;
      nb_nics = 0;
  
      bdrv_init_with_whitelist();
                          exit(1);
                      }
                      if (hda_opts != NULL) {
 -                        char num[16];
 -                        snprintf(num, sizeof(num), "%d", cyls);
 -                        qemu_opt_set(hda_opts, "cyls", num);
 -                        snprintf(num, sizeof(num), "%d", heads);
 -                        qemu_opt_set(hda_opts, "heads", num);
 -                        snprintf(num, sizeof(num), "%d", secs);
 -                        qemu_opt_set(hda_opts, "secs", num);
 +                        qemu_opt_set_number(hda_opts, "cyls", cyls,
 +                                            &error_abort);
 +                        qemu_opt_set_number(hda_opts, "heads", heads,
 +                                            &error_abort);
 +                        qemu_opt_set_number(hda_opts, "secs", secs,
 +                                            &error_abort);
                          if (translation == BIOS_ATA_TRANSLATION_LARGE) {
 -                            qemu_opt_set(hda_opts, "trans", "large");
 +                            qemu_opt_set(hda_opts, "trans", "large",
 +                                         &error_abort);
                          } else if (translation == BIOS_ATA_TRANSLATION_RECHS) {
 -                            qemu_opt_set(hda_opts, "trans", "rechs");
 +                            qemu_opt_set(hda_opts, "trans", "rechs",
 +                                         &error_abort);
                          } else if (translation == BIOS_ATA_TRANSLATION_LBA) {
 -                            qemu_opt_set(hda_opts, "trans", "lba");
 +                            qemu_opt_set(hda_opts, "trans", "lba",
 +                                         &error_abort);
                          } else if (translation == BIOS_ATA_TRANSLATION_NONE) {
 -                            qemu_opt_set(hda_opts, "trans", "none");
 +                            qemu_opt_set(hda_opts, "trans", "none",
 +                                         &error_abort);
                          }
                      }
                  }
                  }
                  break;
              case QEMU_OPTION_kernel:
 -                qemu_opts_set(qemu_find_opts("machine"), 0, "kernel", optarg);
 +                qemu_opts_set(qemu_find_opts("machine"), 0, "kernel", optarg,
 +                              &error_abort);
                  break;
              case QEMU_OPTION_initrd:
 -                qemu_opts_set(qemu_find_opts("machine"), 0, "initrd", optarg);
 +                qemu_opts_set(qemu_find_opts("machine"), 0, "initrd", optarg,
 +                              &error_abort);
                  break;
              case QEMU_OPTION_append:
 -                qemu_opts_set(qemu_find_opts("machine"), 0, "append", optarg);
 +                qemu_opts_set(qemu_find_opts("machine"), 0, "append", optarg,
 +                              &error_abort);
                  break;
              case QEMU_OPTION_dtb:
 -                qemu_opts_set(qemu_find_opts("machine"), 0, "dtb", optarg);
 +                qemu_opts_set(qemu_find_opts("machine"), 0, "dtb", optarg,
 +                              &error_abort);
                  break;
              case QEMU_OPTION_cdrom:
                  drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS);
                  }
                  break;
              case QEMU_OPTION_bios:
 -                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg);
 +                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg,
 +                              &error_abort);
                  break;
              case QEMU_OPTION_singlestep:
                  singlestep = 1;
                  writeout = qemu_opt_get(opts, "writeout");
                  if (writeout) {
  #ifdef CONFIG_SYNC_FILE_RANGE
 -                    qemu_opt_set(fsdev, "writeout", writeout);
 +                    qemu_opt_set(fsdev, "writeout", writeout, &error_abort);
  #else
                      fprintf(stderr, "writeout=immediate not supported on "
                              "this platform\n");
                      exit(1);
  #endif
                  }
 -                qemu_opt_set(fsdev, "fsdriver", qemu_opt_get(opts, "fsdriver"));
 -                qemu_opt_set(fsdev, "path", qemu_opt_get(opts, "path"));
 +                qemu_opt_set(fsdev, "fsdriver",
 +                             qemu_opt_get(opts, "fsdriver"), &error_abort);
 +                qemu_opt_set(fsdev, "path", qemu_opt_get(opts, "path"),
 +                             &error_abort);
                  qemu_opt_set(fsdev, "security_model",
 -                             qemu_opt_get(opts, "security_model"));
 +                             qemu_opt_get(opts, "security_model"),
 +                             &error_abort);
                  socket = qemu_opt_get(opts, "socket");
                  if (socket) {
 -                    qemu_opt_set(fsdev, "socket", socket);
 +                    qemu_opt_set(fsdev, "socket", socket, &error_abort);
                  }
                  sock_fd = qemu_opt_get(opts, "sock_fd");
                  if (sock_fd) {
 -                    qemu_opt_set(fsdev, "sock_fd", sock_fd);
 +                    qemu_opt_set(fsdev, "sock_fd", sock_fd, &error_abort);
                  }
  
                  qemu_opt_set_bool(fsdev, "readonly",
 -                                qemu_opt_get_bool(opts, "readonly", 0));
 +                                  qemu_opt_get_bool(opts, "readonly", 0),
 +                                  &error_abort);
                  device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
                                            &error_abort);
 -                qemu_opt_set(device, "driver", "virtio-9p-pci");
 +                qemu_opt_set(device, "driver", "virtio-9p-pci", &error_abort);
                  qemu_opt_set(device, "fsdev",
 -                             qemu_opt_get(opts, "mount_tag"));
 +                             qemu_opt_get(opts, "mount_tag"), &error_abort);
                  qemu_opt_set(device, "mount_tag",
 -                             qemu_opt_get(opts, "mount_tag"));
 +                             qemu_opt_get(opts, "mount_tag"), &error_abort);
                  break;
              }
              case QEMU_OPTION_virtfs_synth: {
                      fprintf(stderr, "duplicate option: %s\n", "virtfs_synth");
                      exit(1);
                  }
 -                qemu_opt_set(fsdev, "fsdriver", "synth");
 +                qemu_opt_set(fsdev, "fsdriver", "synth", &error_abort);
  
                  device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
                                            &error_abort);
 -                qemu_opt_set(device, "driver", "virtio-9p-pci");
 -                qemu_opt_set(device, "fsdev", "v_synth");
 -                qemu_opt_set(device, "mount_tag", "v_synth");
 +                qemu_opt_set(device, "driver", "virtio-9p-pci", &error_abort);
 +                qemu_opt_set(device, "fsdev", "v_synth", &error_abort);
 +                qemu_opt_set(device, "mount_tag", "v_synth", &error_abort);
                  break;
              }
              case QEMU_OPTION_serial:
      default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
      default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
  
 -    if (qemu_opts_foreach(qemu_find_opts("numa"), numa_init_func,
 -                          NULL, 1) != 0) {
 -        exit(1);
 -    }
 -
 -    set_numa_nodes();
 +    parse_numa_opts();
  
      if (qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, 1) != 0) {
          exit(1);
  
      cpu_synchronize_all_post_init();
  
 -    set_numa_modes();
 +    numa_post_machine_init();
  
      /* init USB devices */
      if (usb_enabled()) {