1. 21 5月, 2015 1 次提交
  2. 07 5月, 2015 1 次提交
    • M
      processSerialChangedEvent: Close agent monitor early · 2af51483
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=890648
      
      So, imagine you've issued an API that involves guest agent. For
      instance, you want to query guest's IP addresses. So the API acquires
      QUERY_JOB, locks the guest agent and issues the agent command.
      However, for some reason, guest agent replies to initial ping
      correctly, but then crashes tragically while executing real command
      (in this case guest-network-get-interfaces). Since initial ping went
      well, libvirt thinks guest agent is accessible and awaits reply to the
      real command. But it will never come. What will is a monitor event.
      Our handler (processSerialChangedEvent) will try to acquire
      MODIFY_JOB, which will fail obviously because the other thread that's
      executing the API already holds a job. So the event handler exits
      early, and the QUERY_JOB is never released nor ended.
      
      The way how to solve this is to put flag somewhere in the monitor
      internals. The flag is called @running and agent commands are issued
      iff the flag is set. The flag itself is set when we connect to the
      agent socket. And unset whenever we see DISCONNECT event from the
      agent. Moreover, we must wake up all the threads waiting for the
      agent. This is done by signalizing the condition they're waiting on.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2af51483
  3. 26 4月, 2015 1 次提交
  4. 02 4月, 2015 1 次提交
  5. 18 3月, 2015 1 次提交
  6. 17 3月, 2015 1 次提交
    • N
      domifaddr: Implement the API for qemu · 0977b8aa
      Nehal J Wani 提交于
      By querying the qemu guest agent with the QMP command
      "guest-network-get-interfaces" and converting the received JSON
      output to structured objects.
      
      Although "ifconfig" is deprecated, IP aliases created by "ifconfig"
      are supported by this API. The legacy syntax of an IP alias is:
      "<ifname>:<alias-name>". Since we want all aliases to be clubbed
      under parent interface, simply stripping ":<alias-name>" suffices.
      Note that IP aliases formed by "ip" aren't visible to "ifconfig",
      and aliases created by "ip" do not have any specific name. But
      we are lucky, as qemu guest agent detects aliases created by both.
      
      src/qemu/qemu_agent.h:
        * Define qemuAgentGetInterfaces
      
      src/qemu/qemu_agent.c:
        * Implement qemuAgentGetInterface
      
      src/qemu/qemu_driver.c:
        * New function qemuGetDHCPInterfaces
        * New function qemuDomainInterfaceAddresses
      
      src/remote_protocol-sructs:
        * Define new structs
      
      tests/qemuagenttest.c:
        * Add new test: testQemuAgentGetInterfaces
          Test cases for IP aliases, 0 or multiple ipv4/ipv6 address(es)
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      0977b8aa
  7. 24 11月, 2014 1 次提交
  8. 15 11月, 2014 1 次提交
  9. 29 10月, 2014 1 次提交
    • M
      qemu_agent: Produce more readable error messages · b7fe5a65
      Michal Privoznik 提交于
      Not every error message from qemu-ga has to have the 'class' field
      filled out. For instance, I've seen this error message lately:
      
        qemuAgentCheckError:1047 : unable to execute QEMU agent command \
        {"execute":"guest-set-time"}: \
        {"error":{"desc":"Invalid parameter type, expected: integer"}}
      
      However, this got translated into rather generic error message:
      
        internal error: unable to execute QEMU agent command
        'guest-set-time': unknown QEMU command error
      
      So we've dropped better error message in favor of a generic one.
      This is due to our code which expects 'class' which is not
      present here.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7fe5a65
  10. 28 8月, 2014 1 次提交
    • J
      qemu_agent: Resolve Coverity RESOURCE_LEAK · 6f8a4f6d
      John Ferlan 提交于
      Coverity found that on error paths, the 'arg' value wasn't be cleaned
      up. Followed the example in qemuAgentSetVCPUs() where upon successful call
      to qemuAgentCommand() the 'cpus' is set to NULL; otherwise, when cleanup
      occurs the free the memory for 'arg'
      6f8a4f6d
  11. 11 8月, 2014 1 次提交
  12. 20 5月, 2014 1 次提交
    • P
      avoid 'sync' as variable name · d5c86278
      Pavel Hrdina 提交于
      Old gcc complains about shadowing 'sync' variable:
      
      ../../src/qemu/qemu_agent.c: In function 'qemuAgentSetTime':
      ../../src/qemu/qemu_agent.c:1737: warning: declaration of 'sync'
        shadows a global declaration [-Wshadow]
      /usr/include/unistd.h:464: warning: shadowed declaration is here
        [-Wshadow]
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      d5c86278
  13. 15 5月, 2014 1 次提交
  14. 13 5月, 2014 1 次提交
  15. 03 4月, 2014 1 次提交
    • M
      qemu: make sure agent returns error when required data are missing · 736e017e
      Martin Kletzander 提交于
      Commit 5b3492fa aimed to fix this and caught one error but exposed
      another one.  When agent command is being executed and the thread
      waiting for the reply is woken up by an event (e.g. EOF in case of
      shutdown), the command finishes with no data (rxObject == NULL), but
      no error is reported, since this might be desired by the caller
      (e.g. suspend through agent).  However, in other situations, when the
      data are required (e.g. getting vCPUs), we proceed to getting desired
      data out of the reply, but none of the virJSON*() functions works well
      with NULLs.  I chose the way of a new parameter for qemuAgentCommand()
      function that specifies whether reply is required and behaves
      according to that.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      736e017e
  16. 02 4月, 2014 2 次提交
  17. 25 3月, 2014 1 次提交
  18. 21 3月, 2014 1 次提交
  19. 18 3月, 2014 1 次提交
  20. 10 3月, 2014 1 次提交
  21. 05 12月, 2013 1 次提交
    • W
      qemuAgentDispose: Reset lastError · 36ae35f0
      Wangyufei (James) 提交于
      When an error occurred in qemuAgentIO, it will be saved in mon->lastError,
      but it will not be freed at the end.  Present since commit c160ce33;
      and compare to commit 9cc8a5af fixing the same problem in qemu_monitor.c.
      
      ==22219== 54 bytes in 1 blocks are definitely lost in loss record 982 of 1,379
      ==22219==    at 0x4C26B9B: malloc (vg_replace_malloc.c:263)
      ==22219==    by 0x8520521: strdup (in /lib64/libc-2.11.3.so)
      ==22219==    by 0x52E99CB: virStrdup (virstring.c:554)
      ==22219==    by 0x52B44C4: virCopyError (virerror.c:195)
      ==22219==    by 0x52B5123: virCopyLastError (virerror.c:312)
      ==22219==    by 0x10905877: qemuAgentIO (qemu_agent.c:660)
      ==22219==    by 0x52B6122: virEventPollDispatchHandles (vireventpoll.c:501)
      ==22219==    by 0x52B7AEA: virEventPollRunOnce (vireventpoll.c:647)
      ==22219==    by 0x52B5C1B: virEventRunDefaultImpl (virevent.c:274)
      ==22219==    by 0x54181FD: virNetServerRun (virnetserver.c:1112)
      ==22219==    by 0x11EF4D: main (libvirtd.c:1513)
      Signed-off-by: NZhou Yimin <zhouyimin@huawei.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      36ae35f0
  22. 31 7月, 2013 3 次提交
  23. 16 7月, 2013 1 次提交
  24. 11 7月, 2013 1 次提交
  25. 10 7月, 2013 1 次提交
  26. 07 6月, 2013 1 次提交
  27. 06 6月, 2013 1 次提交
  28. 03 6月, 2013 1 次提交
  29. 21 5月, 2013 1 次提交
  30. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  31. 16 4月, 2013 1 次提交
  32. 26 2月, 2013 1 次提交
    • E
      qemu: don't override earlier json error · 29424d1a
      Eric Blake 提交于
      I built without yajl support, and noticed a strange failure message
      in qemumonitorjsontest:
      
      2013-02-22 16:12:37.503+0000: 19812: error : virJSONValueToString:1119 : internal error No JSON parser implementation is available
      2013-02-22 16:12:37.503+0000: 19812: error : qemuMonitorJSONCommandWithFd:253 : out of memory
      
      While a later patch will fix the test to skip when json is not present,
      this patch avoids overriding the more useful error message from
      virJSONValueToString returning NULL.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCommandWithFd):
      Don't override message.
      (qemuMonitorJSONCheckError): Don't print NULL.
      * src/qemu/qemu_agent.c (qemuAgentCommand): Don't override message.
      (qemuAgentCheckError): Don't print NULL.
      (qemuAgentArbitraryCommand): Properly fail on OOM.
      29424d1a
  33. 08 2月, 2013 1 次提交
  34. 06 2月, 2013 1 次提交
  35. 16 1月, 2013 2 次提交
  36. 21 12月, 2012 1 次提交