1. 26 9月, 2012 2 次提交
  2. 23 9月, 2012 1 次提交
    • H
      curses: don't initialize curses when qemu is daemonized · 995ee2bf
      Hitoshi Mitake 提交于
      Current qemu initializes curses even if -daemonize option is
      passed. This cause problem because shell prompt appears without
      calling endwin().
      
      This patch adds new function, is_daemonized(), to OS dependent
      code. With this function, curses_display_init() can check that qemu is
      daemonized or not. If daemonized, curses_display_init() isn't called
      and the problem is avoided.
      
      Of course, -daemonize && -curses doesn't make sense. Users shouldn't
      pass the arguments at the same time. But the problem is very painful
      because Ctrl-C cannot be delivered to the terminal.
      
      Cc: Andrzej Zaborowski  <balrog@zabor.org>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NHitoshi Mitake <h.mitake@gmail.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
      995ee2bf
  3. 27 8月, 2012 3 次提交
  4. 24 8月, 2012 3 次提交
  5. 19 8月, 2012 1 次提交
  6. 17 8月, 2012 3 次提交
    • D
      Allow QEMUMachine to override reset sequencing · be522029
      David Gibson 提交于
      qemu_system_reset() function always performs the same basic actions on
      all machines.  This includes running all the reset handler hooks,
      however the order in which these will run is not always easily predictable.
      
      This patch splits the core of qemu_system_reset() - the invocation of
      the reset handlers - out into a new qemu_devices_reset() function.
      qemu_system_reset() will usually call qemu_devices_reset(), but that
      can be now overriden by a new reset method in the QEMUMachine
      structure.
      
      Individual machines can use this reset method, if necessary, to
      perform any extra, machine specific initializations which have to
      occur before or after the bulk of the reset handlers.  It's expected
      that the method will call qemu_devices_reset() at some point, but if
      the machine has really strange ordering requirements between devices
      resets it could even override that with it's own reset sequence (with
      great care, obviously).
      
      For a specific example of when this might be needed: a number of
      machines (but not PC) load images specified with -kernel or -initrd
      directly into the machine RAM before booting the guest.  This mostly
      works at the moment, but to make this actually safe requires that this
      load occurs after peripheral devices are reset - otherwise they could
      have active DMAs in progress which would clobber the in memory images.
      Some machines (notably pseries) also have other entry conditions which
      need to be set up as the last thing before executing in guest space -
      some of this could be considered "emulated firmware" in the sense that
      the actions of the firmware are emulated directly by qemu rather than
      by executing a firmware image within the guest.  When the platform's
      firmware to OS interface is sufficiently well specified, this saves
      time both in implementing the "firmware" and executing it.
      
      aliguori: don't unconditionally dereference current_machine
      Reviewed-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      be522029
    • E
      Command line support for seccomp with -sandbox (v8) · 7d76ad4f
      Eduardo Otubo 提交于
      Signed-off-by: NEduardo Otubo <otubo@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ---
      v7 -> v8
       - Parse options correctly (aliguori)
      7d76ad4f
    • E
      Adding seccomp calls to vl.c (v8) · 452dfbef
      Eduardo Otubo 提交于
      Signed-off-by: NEduardo Otubo <otubo@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ---
      v1:
       - Full seccomp calls and data included in vl.c
      
      v1 -> v2:
       - Full seccomp calls and data removed from vl.c and put into separate
         qemu-seccomp.[ch] file.
      452dfbef
  7. 14 8月, 2012 3 次提交
  8. 10 8月, 2012 2 次提交
  9. 09 8月, 2012 1 次提交
    • R
      iscsi: Pick default initiator-name based on the name of the VM · 31459f46
      Ronnie Sahlberg 提交于
      This patch updates the iscsi layer to automatically pick a 'unique'
      initiator-name based on the name of the vm in case the user has not set
      an explicit iqn-name to use.
      
      Create a new function qemu_get_vm_name() that returns the name of the VM,
      if specified.
      
      This way we can thus create default names to use as the initiator name
      based on the guest session.
      
      If the VM is not named via the '-name' command line argument, the iscsi
      initiator-name used wiull simply be
      
          iqn.2008-11.org.linux-kvm
      
      If a name for the VM was specified with the '-name' option, iscsi will
      use a default initiatorname of
      
          iqn.2008-11.org.linux-kvm:<name>
      
      These names are just the default iscsi initiator name that qemu will
      generate/use only when the user has not set an explicit initiator name
      via the commandlines or config files.
      Signed-off-by: NRonnie Sahlberg <ronniesahlberg@gmail.com>
      31459f46
  10. 04 8月, 2012 3 次提交
    • C
      Fixes related to processing of qemu's -numa option · ee785fed
      Chegu Vinod 提交于
      The -numa option to qemu is used to create [fake] numa nodes
      and expose them to the guest OS instance.
      
      There are a couple of issues with the -numa option:
      
      a) Max VCPU's that can be specified for a guest while using
         the qemu's -numa option is 64. Due to a typecasting issue
         when the number of VCPUs is > 32 the VCPUs don't show up
         under the specified [fake] numa nodes.
      
      b) KVM currently has support for 160VCPUs per guest. The
         qemu's -numa option has only support for upto 64VCPUs
         per guest.
      This patch addresses these two issues.
      
      Below are examples of (a) and (b)
      
      a) >32 VCPUs are specified with the -numa option:
      
      /usr/local/bin/qemu-system-x86_64 \
      -enable-kvm \
      71:01:01 \
      -net tap,ifname=tap0,script=no,downscript=no \
      -vnc :4
      
      ...
      Upstream qemu :
      --------------
      
      QEMU 1.1.50 monitor - type 'help' for more information
      (qemu) info numa
      6 nodes
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 32 33 34 35 36 37 38 39 40 41
      node 0 size: 131072 MB
      node 1 cpus: 10 11 12 13 14 15 16 17 18 19 42 43 44 45 46 47 48 49 50 51
      node 1 size: 131072 MB
      node 2 cpus: 20 21 22 23 24 25 26 27 28 29 52 53 54 55 56 57 58 59
      node 2 size: 131072 MB
      node 3 cpus: 30
      node 3 size: 131072 MB
      node 4 cpus:
      node 4 size: 131072 MB
      node 5 cpus: 31
      node 5 size: 131072 MB
      
      With the patch applied :
      -----------------------
      
      QEMU 1.1.50 monitor - type 'help' for more information
      (qemu) info numa
      6 nodes
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9
      node 0 size: 131072 MB
      node 1 cpus: 10 11 12 13 14 15 16 17 18 19
      node 1 size: 131072 MB
      node 2 cpus: 20 21 22 23 24 25 26 27 28 29
      node 2 size: 131072 MB
      node 3 cpus: 30 31 32 33 34 35 36 37 38 39
      node 3 size: 131072 MB
      node 4 cpus: 40 41 42 43 44 45 46 47 48 49
      node 4 size: 131072 MB
      node 5 cpus: 50 51 52 53 54 55 56 57 58 59
      node 5 size: 131072 MB
      
      b) >64 VCPUs specified with -numa option:
      
      /usr/local/bin/qemu-system-x86_64 \
      -enable-kvm \
      -cpu Westmere,+rdtscp,+pdpe1gb,+dca,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pclmuldq,+pbe,+tm,+ht,+ss,+acpi,+d-vnc :4
      
      ...
      
      Upstream qemu :
      --------------
      
      only 63 CPUs in NUMA mode supported.
      only 64 CPUs in NUMA mode supported.
      QEMU 1.1.50 monitor - type 'help' for more information
      (qemu) info numa
      8 nodes
      node 0 cpus: 6 7 8 9 38 39 40 41 70 71 72 73
      node 0 size: 65536 MB
      node 1 cpus: 10 11 12 13 14 15 16 17 18 19 42 43 44 45 46 47 48 49 50 51 74 75 76 77 78 79
      node 1 size: 65536 MB
      node 2 cpus: 20 21 22 23 24 25 26 27 28 29 52 53 54 55 56 57 58 59 60 61
      node 2 size: 65536 MB
      node 3 cpus: 30 62
      node 3 size: 65536 MB
      node 4 cpus:
      node 4 size: 65536 MB
      node 5 cpus:
      node 5 size: 65536 MB
      node 6 cpus: 31 63
      node 6 size: 65536 MB
      node 7 cpus: 0 1 2 3 4 5 32 33 34 35 36 37 64 65 66 67 68 69
      node 7 size: 65536 MB
      
      With the patch applied :
      -----------------------
      
      QEMU 1.1.50 monitor - type 'help' for more information
      (qemu) info numa
      8 nodes
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9
      node 0 size: 65536 MB
      node 1 cpus: 10 11 12 13 14 15 16 17 18 19
      node 1 size: 65536 MB
      node 2 cpus: 20 21 22 23 24 25 26 27 28 29
      node 2 size: 65536 MB
      node 3 cpus: 30 31 32 33 34 35 36 37 38 39
      node 3 size: 65536 MB
      node 4 cpus: 40 41 42 43 44 45 46 47 48 49
      node 4 size: 65536 MB
      node 5 cpus: 50 51 52 53 54 55 56 57 58 59
      node 5 size: 65536 MB
      node 6 cpus: 60 61 62 63 64 65 66 67 68 69
      node 6 size: 65536 MB
      node 7 cpus: 70 71 72 73 74 75 76 77 78 79
      Signed-off-by: NChegu Vinod &lt;chegu_vinod@hp.com&gt;, Jim Hull &lt;jim.hull@hp.com&gt;, Craig Hada <craig.hada@hp.com>
      Tested-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      ee785fed
    • A
      fips: fix build on !Linux · 70678b82
      Anthony Liguori 提交于
      Commit 0f66998f makes -enable-fips conditional on Linux hosts but then uses it
      unconditionally in vl.c.
      
      Fix this by moving the fips handling to os-posix.c and adding a condition.
      
      Cc: Paul Moore <pmoore@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      70678b82
    • P
      vnc: disable VNC password authentication (security type 2) when in FIPS mode · 0f66998f
      Paul Moore 提交于
      FIPS 140-2 requires disabling certain ciphers, including DES, which is used
      by VNC to obscure passwords when they are sent over the network.  The
      solution for FIPS users is to disable the use of VNC password auth when the
      host system is operating in FIPS compliance mode and the user has specified
      '-enable-fips' on the QEMU command line.
      
      This patch causes QEMU to emit a message to stderr when the host system is
      running in FIPS mode and a VNC password was specified on the commend line.
      If the system is not running in FIPS mode, or is running in FIPS mode but
      VNC password authentication was not requested, QEMU operates normally.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      0f66998f
  11. 03 8月, 2012 1 次提交
    • P
      Support 'help' as a synonym for '?' in command line options · c8057f95
      Peter Maydell 提交于
      For command line options which permit '?' meaning 'please list the
      permitted values', add support for 'help' as a synonym, by abstracting
      the check out into a helper function.
      
      This change means that in some cases where we were being lazy in
      our string parsing, "?junk" will now be rejected as an invalid option
      rather than being (undocumentedly) treated the same way as "?".
      
      Update the documentation to use 'help' rather than '?', since '?'
      is a shell metacharacter and thus prone to fail confusingly if there
      is a single character filename in the current working directory and
      the '?' has not been escaped. It's therefore better to steer users
      towards 'help', though '?' is retained for backwards compatibility.
      
      We do not, however, update the output of the system emulator's -help
      (or any documentation autogenerated from the qemu-options.hx which
      is the source of the -help text) because libvirt parses our -help
      output and will break. At a later date when QEMU provides a better
      interface so libvirt can avoid having to do this, we can update the
      -help text too.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c8057f95
  12. 28 7月, 2012 1 次提交
  13. 20 7月, 2012 1 次提交
  14. 17 7月, 2012 1 次提交
    • M
      block: Geometry and translation hints are now useless, purge them · 2b584959
      Markus Armbruster 提交于
      There are two producers of these hints: drive_init() on behalf of
      -drive, and hd_geometry_guess().
      
      The only consumer of the hint is hd_geometry_guess().
      
      The callers of hd_geometry_guess() call it only when drive_init()
      didn't set the hints.  Therefore, drive_init()'s hints are never used.
      
      Thus, hd_geometry_guess() only ever sees hints it produced itself in a
      prior call.  Only the first call computes something, subsequent calls
      just repeat the first call's results.  However, hd_geometry_guess() is
      never called more than once: the device models don't, and the block
      device is destroyed on unplug.  Thus, dropping the repeat feature
      doesn't break anything now.
      
      If a block device wasn't destroyed on unplug and could be reused with
      a new device, then repeating old results would be wrong.  Thus,
      dropping the repeat feature prevents future breakage.
      
      This renders the hints unused.  Purge them from the block layer.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2b584959
  15. 13 7月, 2012 1 次提交
  16. 11 7月, 2012 1 次提交
    • P
      qemu_find_file: check name as a straight path even if it has no '/' · 31783203
      Peter Maydell 提交于
      Make qemu_find_file() check for the passed in name as a straight
      pathname even if it doesn't have any path separator character in it.
      This means that "-bios foo", "-dtb foo" etc will find a file 'foo'
      in the current directory.
      This removes an inconsistency with -kernel and -initrd, which both
      accept plain filenames as meaning files in the current directory.
      It's also less confusing for the user than an undocumented restriction
      that "this option accepts a filename, except for the special case
      where the filename you pass happens not to have a '/' in it, in
      which case we'll ignore it."
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      31783203
  17. 20 6月, 2012 1 次提交
  18. 09 6月, 2012 1 次提交
    • M
      do not include <libutil.h> needlessly or if it doesn't exist · 3294ce18
      Michael Tokarev 提交于
      <libutil.h> and <util.h> on *BSD (some have one, some another)
      were #included just for openpty() declaration.  The only file
      where this function is actually used is qemu-char.c.
      
      In vl.c and net/tap-bsd.c, none of functions declared in libutil.h
      (login logout logwtmp timdomain openpty forkpty uu_lock realhostname
      fparseln and a few others depending on version) are used.
      
      Initially the code which is currently in qemu-char.c was in vl.c,
      it has been removed into separate file in commit 0e82f34d
      Fri Oct 31 18:44:40 2008, but the #includes were left in vl.c.
      So with vl.c, we just remove includes - libutil.h, util.h and
      pty.h (which declares only openpty() and forkpty()) from there.
      
      The code in net/tap-bsd.c, which come from net/tap.c, had this
      
      commit 5281d757
      Author: Mark McLoughlin <markmc@redhat.com>
      Date:   Thu Oct 22 17:49:07 2009 +0100
      
          net: split all the tap code out into net/tap.c
      
      Note this commit not only moved stuff out of net.c to net/tap.c,
      but also rewrote large portions of the tap code, and added these
      completely unnecessary #includes -- as usual, I question why such
      a misleading commit messages are allowed.
      
      Again, no functions defined in libutil.h or util.h on *BSD are
      used by neither net/tap.c nor net/tap-bsd.c.  Removing them.
      
      And finally, the only real user for these #includes, qemu-char.c,
      which actually uses openpty().  There, the #ifdef logic is wrong.
      A GLIBC-based system has <pty.h>, even if it is a variant of *BSD.
      So __GLIBC__ should be checked first, and instead of trying to
      include <libutil.h> or <util.h>, we include <pty.h>.  If it is not
      GLIBC-based, we check for variations between <*util.h> as before.
      
      This patch fixes build of qemu 1.1 on Debian/kFreebsd (well, one
      of the two problems): it is a distribution with a FreeBSD kernel,
      so it #defines at least __FreeBSD_kernel__, but since it is based
      on GLIBC, it has <pty.h>, but current version does not have neither
      <util.h> nor <libutil.h>, which the code tries to include 3 times
      but uses only once.
      Signed-off-By: NMichael Tokarev <mjt@tls.msk.ru>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      3294ce18
  19. 05 6月, 2012 1 次提交
    • L
      qemu-option: qemu_opts_create(): use error_set() · 8be7e7e4
      Luiz Capitulino 提交于
      This commit converts qemu_opts_create() from qerror_report() to
      error_set().
      
      Currently, most calls to qemu_opts_create() can't fail, so most
      callers don't need any changes.
      
      The two cases where code checks for qemu_opts_create() erros are:
      
       1. Initialization code in vl.c. All of them print their own
          error messages directly to stderr, no need to pass the Error
          object
      
       2. The functions opts_parse(), qemu_opts_from_qdict() and
          qemu_chr_parse_compat() make use of the error information and
          they can be called from HMP or QMP. In this case, to allow for
          incremental conversion, we propagate the error up using
          qerror_report_err(), which keeps the QError semantics
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-By: NLaszlo Ersek <lersek@redhat.com>
      8be7e7e4
  20. 12 5月, 2012 1 次提交
    • P
      vga: disable default VGA if appropriate -device is used · 7f1b17f2
      Paolo Bonzini 提交于
      This is a partial revert of commits a369da5f (vga: improve VGA logic,
      committed 2012-01-22) and c5bd4f3d (vga: fix -nodefaults -device VGA,
      2012-01-24) which broke command-line option parsing in different ways.
      
      Since commit a369da5f it has become impossible to specify a VGA device
      entirely with QemuOpts-enabled options, i.e. without needing an explicit
      "-vga none".
      
      In addition, until commit c5bd4f3d -nodefaults would not disable the device
      you specified with the legacy "-vga" option, independent of the order.
      Since commit c5bd4f3d QEMU -nodefaults will override a previous -vga
      option.
      
      I did not reintroduce machine->no_vga.  Boards can simply ignore the
      vga_interface_type variable, and most will indeed do so.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      7f1b17f2
  21. 11 5月, 2012 4 次提交
  22. 09 5月, 2012 2 次提交
  23. 30 3月, 2012 2 次提交
    • A
      qtest: add test framework · c7f0f3b1
      Anthony Liguori 提交于
      The idea behind qtest is pretty simple.  Instead of executing a CPU via TCG or
      KVM, rely on an external process to send events to the device model that the CPU
      would normally generate.
      
      qtest presents itself as an accelerator.  In addition, a new option is added to
      establish a qtest server (-qtest) that takes a character device.  This is what
      allows the external process to send CPU events to the device model.
      
      qtest uses a simple line based protocol to send the events.  Documentation of
      that protocol is in qtest.c.
      
      I considered reusing the monitor for this job.  Adding interrupts would be a bit
      difficult.  In addition, logging would also be difficult.
      
      qtest has extensive logging support.  All protocol commands are logged with
      time stamps using a new command line option (-qtest-log).  Logging is important
      since ultimately, this is a feature for debugging.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c7f0f3b1
    • P
      rtc: add -rtc clock=rt · 78808141
      Paolo Bonzini 提交于
      This will let people use backwards-compatible semantics for devices that
      will be affected by the following patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      78808141