1. 12 9月, 2012 6 次提交
  2. 11 9月, 2012 16 次提交
  3. 10 9月, 2012 7 次提交
    • C
      Fix unwanted closing of libvirt client connection · 164c03d3
      Christophe Fergeau 提交于
      e5a1bee0 introduced a regression in Boxes: when Boxes is left idle
      (it's still doing some libvirt calls in the background), the
      libvirt connection gets closed after a few minutes. What happens is
      that this code in virNetClientIOHandleOutput gets triggered:
      
      if (!thecall)
          return -1; /* Shouldn't happen, but you never know... */
      
      and after the changes in e5a1bee0, this causes the libvirt connection
      to be closed.
      
      Upon further investigation, what happens is that
      virNetClientIOHandleOutput is called from gvir_event_handle_dispatch
      in libvirt-glib, which is triggered because the client fd became
      writable. However, between the times gvir_event_handle_dispatch
      is called, and the time the client lock is grabbed and
      virNetClientIOHandleOutput is called, another thread runs and
      completes the current call. 'thecall' is then NULL when the first
      thread gets to run virNetClientIOHandleOutput.
      
      After describing this situation on IRC, danpb suggested this:
      
      11:37 < danpb> In that case I think the correct thing would be to change
                     'return -1' above to 'return 0' since that's not actually an
                     error - its a rare, but expected event
      
      which is what this patch is doing. I've tested it against master
      libvirt, and I didn't get disconnected in ~10 minutes while this
      happens in less than 5 minutes without this patch.
      164c03d3
    • O
      list: Expose virStoragePoolListAllVolumes to Python binding · fa2e35a3
      Osier Yang 提交于
      The implementation is done manually as the generator does not support
      wrapping lists of C pointers into Python objects.
      
      python/libvirt-override-api.xml: Document
      
      python/libvirt-override-virStoragePool.py:
        * New file, includes implementation of listAllVolumes.
      
      python/libvirt-override.c: Implementation for the wrapper.
      fa2e35a3
    • O
      list: Use virStoragePoolListAllVolumes in virsh · 7e9548fc
      Osier Yang 提交于
      tools/virsh-volume.c:
        * vshStorageVolSorter to sort storage vols by name
      
        * vshStorageVolumeListFree to free the volume objects list
      
        * vshStorageVolumeListCollect to collect the volume objects, trying
          to use new API first, fall back to older APIs if it's not supported.
      7e9548fc
    • O
      list: Implement virStoragePoolListAllVolumes for test driver · a4d7f4a0
      Osier Yang 提交于
      src/test/test_driver.c: Implement poolListAllVolumes.
      a4d7f4a0
    • O
      list: Implement virStoragePoolListAllVolumes for storage driver · 7254a367
      Osier Yang 提交于
      src/storage/storage_driver.c: Implement poolListAllVolumes.
      7254a367
    • O
      list: Implement RPC calls for virStoragePoolListAllVolumes · a8bac1c0
      Osier Yang 提交于
      The RPC generator doesn't returning support list of object, this
      patch do the work manually.
      
        * daemon/remote.c:
          Implemente the server side handler remoteDispatchStoragePoolListAllVolumes
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteStoragePoolListAllVolumes
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_STORAGE_POOL_LIST_ALL_VOLUMES and
          structs to represent the args and ret for it.
      
        * src/remote_protocol-structs: Likewise.
      a8bac1c0
    • O
      list: Define new API virStoragePoolListAllVolumes · a42eac60
      Osier Yang 提交于
      Simply returns the storage volume objects. No supported filter
      flags.
      
      include/libvirt/libvirt.h.in: Declare the API
      python/generator.py: Skip the function for generating. virStoragePool.py
                           will be added in later patch.
      src/driver.h: virDrvStoragePoolListVolumesFlags
      src/libvirt.c: Implementation for the API.
      src/libvirt_public.syms: Export the symbol to public
      a42eac60
  4. 09 9月, 2012 2 次提交
  5. 08 9月, 2012 1 次提交
    • E
      build: fix build on older gcc · 89224251
      Eric Blake 提交于
      On RHEL 6.2, gcc 4.4.6 complains:
      cc1: warning: command line option "-Wenum-compare" is valid for C++/ObjC++ but not for C
      which in turn breaks a -Werror build.
      
      Meanwhile, in Fedora 17, gcc 4.7.0, -Wenum-compare has been enhanced
      to also work on C, but at the same time, it is documented that -Wall
      now implicitly includes -Wenum-compare.
      
      Therefore, it is sufficient to remove explicit checks for this option,
      avoiding the warning from older gcc while still getting the
      compile-time safety from newer gcc.
      
      * m4/virt-compile-warnings.m4 (-Wenum-compare): Omit explicit check.
      89224251
  6. 07 9月, 2012 8 次提交
    • D
      3f685c4d
    • C
      events: Fix domain event race on client disconnect · defa8b85
      Christophe Fergeau 提交于
      GNOME Boxes sometimes stops getting domain events from libvirtd, even
      after restarting it. Further investigation in libvirtd shows that
      events are properly queued with virDomainEventStateQueue, but the
      timer virDomainEventTimer which flushes the events and sends them to
      the clients never gets called. Looking at the event queue in gdb
      shows that it's non-empty and that its size increases with each new
      events.
      
      virDomainEventTimer is set up in virDomainEventStateRegister[ID]
      when going from 0 client connecte to 1 client connected, but is
      initially disabled. The timer is removed in
      virDomainEventStateRegister[ID] when the last client is disconnected
      (going from 1 client connected to 0).
      
      This timer (which handles sending the events to the clients) is
      enabled in virDomainEventStateQueue when queueing an event on an
      empty queue (queue containing 0 events). It's disabled in
      virDomainEventStateFlush after flushing the queue (ie removing all
      the elements from it). This way, no extra work is done when the queue
      is empty, and when the next event comes up, the timer will get
      reenabled because the queue will go from 0 event to 1 event, which
      triggers enabling the timer.
      
      However, with this Boxes bug, we have a client connected (Boxes), a
      non-empty queue (there are events waiting to be sent), but a disabled
      timer, so something went wrong.
      
      When Boxes connects (it's the only client connecting to the libvirtd
      instance I used for debugging), the event timer is not set as expected
      (state->timer == -1 when virDomainEventStateRegisterID is called),
      but at the same time the event queue is not empty. In other words,
      we had no clients connected, but pending events. This also explains
      why the timer never gets enabled as this is only done when an event
      is queued on an empty queue.
      
      I think this can happen if an event gets queued using
      virDomainEventStateQueue and the client disconnection happens before
      the event timer virDomainEventTimer gets a chance to run and flush
      the event. In this situation, virDomainEventStateDeregister[ID] will
      get called with a non-empty event queue, the timer will be destroyed
      if this was the only client connected. Then, when other clients connect
      at a later time, they will never get notified about domain events as
      the event timer will never get enabled because the timer is only
      enabled if the event queue is empty when virDomainEventStateRegister[ID]
      gets called, which will is no longer the case.
      
      To avoid this issue, this commit makes sure to remove all events from
      the event queue when the last client in unregistered. As there is
      no longer anyone interested in receiving these events, these events
      are stale so there is no need to keep them around. A client connecting
      later will have no interest in getting events that happened before it
      got connected.
      defa8b85
    • D
      Fix location of SELinux mount during RPM builds · bd172f13
      Daniel P. Berrange 提交于
      When building RPMs the host kernel cannot be assumed to match
      the target OS kernel. Thus auto-detecting /selinux vs
      /sys/fs/selinux based on the host kernel can result in the
      wrong choice (eg F18 builds on a RHEL6 host kernel)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bd172f13
    • D
      Don't assume use of /sys/fs/cgroup · a4fd7405
      Daniel P. Berrange 提交于
      The introduction of /sys/fs/cgroup came in fairly recent kernels.
      Prior to that time distros would pick a custom directory like
      /cgroup or /dev/cgroup. We need to auto-detect where this is,
      rather than hardcoding it
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a4fd7405
    • D
      Introduce a test suite for the JSON monitor · 48d11221
      Daniel P. Berrange 提交于
      Take advantage of the previously added monitor helpers to
      create a test suite for the QEMU JSON monitor impl. As a
      proof of concept, this tests the 'qemuMonitorGetStatus'
      implementation
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      48d11221
    • D
      Add helper library for testing the qemu monitor code · 8d78fd04
      Daniel P. Berrange 提交于
      To be able to test the QEMU monitor code, we need to have a fake
      QEMU monitor server. This introduces a simple (dumb) framework
      that can do this. The test case registers a series of items to
      be sent back as replies to commands that will be executed. A
      thread runs the event loop looking for incoming replies and
      sending back this pre-registered data. This allows testing all
      QEMU monitor code that deals with parsing responses and errors
      from QEMU, without needing QEMU around
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8d78fd04
    • D
      Add non-null annotations to qemuMonitorOpen · 1f490138
      Daniel P. Berrange 提交于
      Add some non-null annotations to qemuMonitorOpen and also
      check that the error callback is set, since it is mandatory
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1f490138
    • J
      examples: Fix event detail printing in python test · e2a7f97b
      Jiri Denemark 提交于
      If there is only one detail string for a particular event, we need to pu
      comma after the string otherwise the string itself will be taken as a
      list and only its first character will be printed out. For example,
      
          myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown F
      
      instead of the desired
      
          myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown Finished
      e2a7f97b