1. 31 10月, 2012 1 次提交
  2. 29 10月, 2012 1 次提交
    • Z
      Add USB option in machine options · 094b287f
      zhlcindy@gmail.com 提交于
      When -usb option is used, global varible usb_enabled is set.
      And all the plaform will create one USB controller according
      to this variable. In fact, global varibles make code hard
      to read.
      
      So this patch is to remove global variable usb_enabled and
      add USB option in machine options. All the plaforms will get
      USB option value from machine options.
      
      USB option of machine options will be set either by:
        * -usb
        * -machine type=pseries,usb=on
      
      Both these ways can work now. They both set USB option in
      machine options. In the future, the first way will be removed.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Acked-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      094b287f
  3. 24 10月, 2012 2 次提交
    • P
      migration: go to paused state after finishing incoming migration with -S · 29ed72f1
      Paolo Bonzini 提交于
      At the end of migration the machine has started already, and cannot be
      destroyed without losing the guest's data.  Hence, prelaunch is the
      wrong state.  Go to the paused state instead.  QEMU would reach that
      state anyway (after running the guest for the blink of an eye) if the
      "stop" command had been received after the start of migration.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      29ed72f1
    • C
      qemu-config: Add new -add-fd command line option · 587ed6be
      Corey Bryant 提交于
      This option can be used for passing file descriptors on the
      command line.  It mirrors the existing add-fd QMP command which
      allows an fd to be passed to QEMU via SCM_RIGHTS and added to an
      fd set.
      
      This can be combined with commands such as -drive to link file
      descriptors in an fd set to a drive:
      
          qemu-kvm -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
                   -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
                   -drive file=/dev/fdset/2,index=0,media=disk
      
      This example adds dups of fds 3 and 4, and the accompanying opaque
      strings to the fd set with ID=2.  qemu_open() already knows how
      to handle a filename of this format.  qemu_open() searches the
      corresponding fd set for an fd and when it finds a match, QEMU
      goes on to use a dup of that fd just like it would have used an
      fd that it opened itself.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      587ed6be
  4. 23 10月, 2012 2 次提交
  5. 20 10月, 2012 1 次提交
    • E
      create struct for machine initialization arguments · 5f072e1f
      Eduardo Habkost 提交于
      This should help us to:
      - More easily add or remove machine initialization arguments without
        having to change every single machine init function;
      - More easily make mechanical changes involving the machine init
        functions in the future;
      - Let machine initialization forward the init arguments to other
        functions more easily.
      
      This change was half-mechanical process: first the struct was added with
      the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local
      variable initialization to all functions. Then the compiler helped me
      locate the local variables that are unused, so they could be removed.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      5f072e1f
  6. 07 10月, 2012 3 次提交
  7. 05 10月, 2012 1 次提交
  8. 26 9月, 2012 3 次提交
  9. 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
  10. 27 8月, 2012 3 次提交
  11. 24 8月, 2012 3 次提交
  12. 19 8月, 2012 1 次提交
  13. 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
  14. 14 8月, 2012 3 次提交
  15. 10 8月, 2012 2 次提交
  16. 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
  17. 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
  18. 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
  19. 28 7月, 2012 1 次提交
  20. 20 7月, 2012 1 次提交
  21. 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
  22. 13 7月, 2012 1 次提交
  23. 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