1. 24 10月, 2016 3 次提交
  2. 12 10月, 2016 1 次提交
  3. 08 10月, 2016 1 次提交
  4. 04 10月, 2016 1 次提交
  5. 23 9月, 2016 1 次提交
  6. 19 9月, 2016 8 次提交
  7. 08 8月, 2016 1 次提交
    • M
      monitor: fix crash when leaving qemu with spice audio · 2ef45716
      Marc-André Lureau 提交于
      Since aa5cb7f5, the chardevs are being cleaned up when leaving
      qemu. However, the monitor has still references to them, which may
      lead to crashes when running atexit() and trying to send monitor
      events:
      
       #0  0x00007fffdb18f6f5 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
       #1  0x00007fffdb1912fa in __GI_abort () at abort.c:89
       #2  0x0000555555c263e7 in error_exit (err=22, msg=0x555555d47980 <__func__.13537> "qemu_mutex_lock") at util/qemu-thread-posix.c:39
       #3  0x0000555555c26488 in qemu_mutex_lock (mutex=0x5555567a2420) at util/qemu-thread-posix.c:66
       #4  0x00005555558c52db in qemu_chr_fe_write (s=0x5555567a2420, buf=0x55555740dc40 "{\"timestamp\": {\"seconds\": 1470041716, \"microseconds\": 989699}, \"event\": \"SPICE_DISCONNECTED\", \"data\": {\"server\": {\"port\": \"5900\", \"family\": \"ipv4\", \"host\": \"127.0.0.1\"}, \"client\": {\"port\": \"40272\", \"f"..., len=240) at qemu-char.c:280
       #5  0x0000555555787cad in monitor_flush_locked (mon=0x5555567bd9e0) at /home/elmarco/src/qemu/monitor.c:311
       #6  0x0000555555787e46 in monitor_puts (mon=0x5555567bd9e0, str=0x5555567a44ef "") at /home/elmarco/src/qemu/monitor.c:353
       #7  0x00005555557880fe in monitor_json_emitter (mon=0x5555567bd9e0, data=0x5555567c73a0) at /home/elmarco/src/qemu/monitor.c:401
       #8  0x00005555557882d2 in monitor_qapi_event_emit (event=QAPI_EVENT_SPICE_DISCONNECTED, qdict=0x5555567c73a0) at /home/elmarco/src/qemu/monitor.c:472
       #9  0x000055555578838f in monitor_qapi_event_queue (event=QAPI_EVENT_SPICE_DISCONNECTED, qdict=0x5555567c73a0, errp=0x7fffffffca88) at /home/elmarco/src/qemu/monitor.c:497
       #10 0x0000555555c15541 in qapi_event_send_spice_disconnected (server=0x5555571139d0, client=0x5555570d0db0, errp=0x5555566c0428 <error_abort>) at qapi-event.c:1038
       #11 0x0000555555b11bc6 in channel_event (event=3, info=0x5555570d6c00) at ui/spice-core.c:248
       #12 0x00007fffdcc9983a in adapter_channel_event (event=3, info=0x5555570d6c00) at reds.c:120
       #13 0x00007fffdcc99a25 in reds_handle_channel_event (reds=0x5555567a9d60, event=3, info=0x5555570d6c00) at reds.c:324
       #14 0x00007fffdcc7d4c4 in main_dispatcher_self_handle_channel_event (self=0x5555567b28b0, event=3, info=0x5555570d6c00) at main-dispatcher.c:175
       #15 0x00007fffdcc7d5b1 in main_dispatcher_channel_event (self=0x5555567b28b0, event=3, info=0x5555570d6c00) at main-dispatcher.c:194
       #16 0x00007fffdcca7674 in reds_stream_push_channel_event (s=0x5555570d9910, event=3) at reds-stream.c:354
       #17 0x00007fffdcca749b in reds_stream_free (s=0x5555570d9910) at reds-stream.c:323
       #18 0x00007fffdccb5dad in snd_disconnect_channel (channel=0x5555576a89a0) at sound.c:229
       #19 0x00007fffdccb9e57 in snd_detach_common (worker=0x555557739720) at sound.c:1589
       #20 0x00007fffdccb9f0e in snd_detach_playback (sin=0x5555569fe3f8) at sound.c:1602
       #21 0x00007fffdcca3373 in spice_server_remove_interface (sin=0x5555569fe3f8) at reds.c:3387
       #22 0x00005555558ff6e2 in line_out_fini (hw=0x5555569fe370) at audio/spiceaudio.c:152
       #23 0x00005555558f909e in audio_atexit () at audio/audio.c:1754
       #24 0x00007fffdb1941e8 in __run_exit_handlers (status=0, listp=0x7fffdb5175d8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
       #25 0x00007fffdb194235 in __GI_exit (status=<optimized out>) at exit.c:104
       #26 0x00007fffdb17b738 in __libc_start_main (main=0x5555558d7874 <main>, argc=67, argv=0x7fffffffcf48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffcf38) at ../csu/libc-start.c:323
      
      Add a monitor_cleanup() functions to remove all the monitors before
      cleaning up the chardev. Note that we are "losing" some events that
      used to be sent during atexit().
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20160801112343.29082-2-marcandre.lureau@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      2ef45716
  8. 20 7月, 2016 1 次提交
    • E
      qapi: Change Netdev into a flat union · f394b2e2
      Eric Blake 提交于
      This is a mostly-mechanical conversion that creates a new flat
      union 'Netdev' QAPI type that covers all the branches of the
      former 'NetClientOptions' simple union, where the branches are
      now listed in a new 'NetClientDriver' enum rather than generated
      from the simple union.  The existence of a flat union has no
      change to the command line syntax accepted for new code, and
      will make it possible for a future patch to switch the QMP
      command to parse a boxed union for no change to valid QMP; but
      it does have some ripple effect on the C code when dealing with
      the new types.
      
      While making the conversion, note that the 'NetLegacy' type
      remains unchanged: it applies only to legacy command line options,
      and will not be ported to QMP, so it should remain a wrapper
      around a simple union; to avoid confusion, the type named
      'NetClientOptions' is now gone, and we introduce 'NetLegacyOptions'
      in its place.  Then, in the C code, we convert from NetLegacy to
      Netdev as soon as possible, so that the bulk of the net stack
      only has to deal with one QAPI type, not two.  Note that since
      the old legacy code always rejected 'hubport', we can just omit
      that branch from the new 'NetLegacyOptions' simple union.
      
      Based on an idea originally by Zoltán Kővágó <DirtY.iCE.hu@gmail.com>:
      Message-Id: <01a527fbf1a5de880091f98cf011616a78adeeee.1441627176.git.DirtY.iCE.hu@gmail.com>
      although the sed script in that patch no longer applies due to
      other changes in the tree since then, and I also did some manual
      cleanups (such as fixing whitespace to keep checkpatch happy).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1468468228-27827-13-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Fixup from Eric squashed in]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f394b2e2
  9. 19 7月, 2016 2 次提交
  10. 12 7月, 2016 2 次提交
  11. 06 7月, 2016 1 次提交
  12. 20 6月, 2016 1 次提交
    • M
      log: Fix qemu_set_log_filename() error handling · daa76aa4
      Markus Armbruster 提交于
      When qemu_set_log_filename() detects an invalid file name, it reports
      an error, closes the log file (if any), and starts logging to stderr
      (unless daemonized or nothing is being logged).
      
      This is wrong.  Asking for an invalid log file on the command line
      should be fatal.  Asking for one in the monitor should fail without
      messing up an existing logfile.
      
      Fix by converting qemu_set_log_filename() to Error.  Pass it
      &error_fatal, except for hmp_logfile report errors.
      
      This also permits testing without a subprocess, so do that.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1466011636-6112-4-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      daa76aa4
  13. 17 6月, 2016 1 次提交
    • I
      QMP: Add query-hotpluggable-cpus · d4633541
      Igor Mammedov 提交于
      It will allow mgmt to query present and hotpluggable CPU objects,
      it is required from a target platform that wishes to support command
      to implement and set MachineClass.query_hotpluggable_cpus callback,
      which will return a list of possible CPU objects with options that
      would be needed for hotplugging possible CPU objects.
      
      There are:
      'type': 'str' - QOM CPU object type for usage with device_add
      'vcpus-count': 'int' - number of logical VCPU threads per
                              CPU object (mgmt needs to know)
      
      and a set of optional fields that are to used for hotplugging a CPU
      objects and would allows mgmt tools to know what/where it could be
      hotplugged;
      [node],[socket],[core],[thread]
      
      For present CPUs there is a 'qom-path' field which would allow mgmt to
      inspect whatever object/abstraction the target platform considers
      as CPU object.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d4633541
  14. 07 6月, 2016 1 次提交
  15. 26 5月, 2016 1 次提交
    • K
      block: Fix bdrv_next() memory leak · 88be7b4b
      Kevin Wolf 提交于
      The bdrv_next() users all leaked the BdrvNextIterator after completing
      the iteration. Simply changing bdrv_next() to free the iterator before
      returning NULL at the end of list doesn't work because some callers exit
      the loop before looking at all BDSes.
      
      This patch moves the BdrvNextIterator from the heap to the stack of
      the caller and switches to a bdrv_first()/bdrv_next() interface for
      initialising the iterator.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      88be7b4b
  16. 19 5月, 2016 4 次提交
  17. 31 3月, 2016 1 次提交
    • P
      arm: qmp: add query-gic-capabilities interface · ae50a770
      Peter Xu 提交于
      This patch add "query-gic-capabilities" but does not implement it. The
      command is ARM-only. The command will return a list of GICCapability
      structs that describes all GIC versions that current QEMU and system
      support.
      
      Libvirt is possibly the first consumer of this new command.
      
      Before this patch, a libvirt user can successfully configure all kinds
      of GIC devices for ARM guests, no matter whether current QEMU/kernel
      supports them. If the specified GIC version/type is not supported, the
      user will get an ambiguous "QEMU boot failure" error when trying to start
      the VM. This is not user-friendly.
      
      With this patch, libvirt should be able to query which type (and which
      version) of GIC device is supported. Using this information, libvirt
      can warn the user during configuration of guests when specified GIC
      device type is not supported. Or better, we can just list those versions
      that we support, and filter out the unsupported ones.
      
      For example, if we got the query result:
      
      {"return": [{"emulated": false, "version": 3, "kernel": true},
                  {"emulated": true, "version": 2, "kernel": false}]}
      
      then it means that we support emulated GIC version 2 using:
      
        qemu-system-aarch64 -M virt,accel=tcg,gic-version=2 ...
      
      or KVM-accelerated GIC version 3 using:
      
        qemu-system-aarch64 -M virt,accel=kvm,gic-version=3 ...
      
      If we specify other explicit GIC versions rather than the above, QEMU
      will not be able to boot.
      
      The community is working on a more generic way to query these kinds of
      information about valid values of machine properties. However, due to
      the importance of supporting this specific use case, weecided to first
      implement this ad-hoc one; then when the generic method is ready, we
      can move on to that one smoothly.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1458788142-17509-2-git-send-email-peterx@redhat.com
      [PMM: tweaked commit message a bit; monitor.o is CONFIG_SOFTMMU only]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ae50a770
  18. 23 3月, 2016 2 次提交
  19. 17 3月, 2016 1 次提交
  20. 15 3月, 2016 2 次提交
  21. 01 3月, 2016 1 次提交
  22. 05 2月, 2016 1 次提交
    • P
      all: Clean up includes · d38ea87a
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  23. 13 1月, 2016 1 次提交
    • M
      error: Use error_report_err() instead of monitor_printf() · 193227f9
      Markus Armbruster 提交于
      Both error_report_err() and monitor_printf() print to the same
      destination when monitor_printf() is used correctly, i.e. within an
      HMP monitor.  Elsewhere, monitor_printf() does nothing, while
      error_report_err() reports to stderr.
      
      Most changed functions are HMP command handlers.  These should only
      run within an HMP monitor.  The one exception is bdrv_password_cb(),
      which should also only run within an HMP monitor.
      
      Four command handlers prefix the error message with the command name:
      balloon, migrate_set_capability, migrate_set_parameter, migrate.
      Pointless, drop.
      
      Unlike monitor_printf(), error_report_err() uses the error whole
      instead of just its message obtained with error_get_pretty().  This
      avoids suppressing its hint (see commit 50b7b000).  Example:
      
          (qemu) device_add ivshmem,id=666
          Parameter 'id' expects an identifier
          Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.
          Try "help device_add" for more information
      
      The "Identifiers consist of..." line is new with this patch.
      
      Coccinelle semantic patch:
      
          @@
          expression M, E;
          @@
          -    monitor_printf(M, "%s\n", error_get_pretty(E));
          -    error_free(E);
          +    error_report_err(E);
          @r1@
          expression M, E;
          format F;
          position p;
          @@
          -    monitor_printf(M, "...%@F@\n", error_get_pretty(E));@p
          -    error_free(E);
          +    error_report_err(E);
          @script:python@
      	p << r1.p;
          @@
          print "%s:%s:%s: prefix dropped" % (p[0].file, p[0].line, p[0].column)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1450452927-8346-4-git-send-email-armbru@redhat.com>
      193227f9
  24. 17 12月, 2015 1 次提交
    • E
      qapi: Change munging of CamelCase enum values · d20a580b
      Eric Blake 提交于
      When munging enum values, the fact that we were passing the entire
      prefix + value through camel_to_upper() meant that enum values
      spelled with CamelCase could be turned into CAMEL_CASE.  However,
      this provides a potential collision (both OneTwo and One-Two would
      munge into ONE_TWO) for enum types, when the same two names are
      valid side-by-side as QAPI member names.  By changing the generation
      of enum constants to always be prefix + '_' + c_name(value,
      False).upper(), and ensuring that there are no case collisions (in
      the next patches), we no longer have to worry about names that
      would be distinct as QAPI members but collide as variant tag names,
      without having to think about what munging the heuristics in
      camel_to_upper() will actually perform on an enum value.
      
      Making the change will affect enums that did not follow coding
      conventions, using 'CamelCase' rather than desired 'lower-case'.
      
      Thankfully, there are only two culprits: InputButton and ErrorClass.
      We already tweaked ErrorClass to make it an alias of QapiErrorClass,
      where only the alias needs changing rather than the whole tree.  So
      the bulk of this change is modifying INPUT_BUTTON_WHEEL_UP to the
      new INPUT_BUTTON_WHEELUP (and likewise for WHEELDOWN).  That part
      of this commit may later need reverting if we rename the enum
      constants from 'WheelUp' to 'wheel-up' as part of moving
      x-input-send-event to a stable interface; but at least we have
      documentation bread crumbs in place to remind us (commit 513e7cdb),
      and it matches the fact that SDL constants are also spelled
      SDL_BUTTON_WHEELUP.
      
      Suggested by: Markus Armbruster <armbru@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-27-git-send-email-eblake@redhat.com>
      [Commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d20a580b