1. 20 1月, 2014 1 次提交
  2. 16 1月, 2014 1 次提交
    • E
      event: add notion of remoteID for filtering client network events · a59097e5
      Eric Blake 提交于
      In order to mirror a server with per-object filtering, the client
      needs to track which server callbackID is servicing the client
      callback.  This patch introduces the notion of a serverID, as
      well as the plumbing to use it for network events, although the
      actual complexity of using per-object filtering in the remote
      driver is deferred to a later patch.
      
      * src/conf/object_event.h (virObjectEventStateEventID): Add parameter.
      (virObjectEventStateQueueRemote, virObjectEventStateSetRemote):
      New prototypes.
      (virObjectEventStateRegisterID): Move...
      * src/conf/object_event_private.h: ...here, and add parameter.
      (_virObjectEvent): Add field.
      * src/conf/network_event.h (virNetworkEventStateRegisterClient): New
      prototype.
      * src/conf/object_event.c (_virObjectEventCallback): Add field.
      (virObjectEventStateSetRemote): New function.
      (virObjectEventStateQueue): Make wrapper around...
      (virObjectEventStateQueueRemote): New function.
      (virObjectEventCallbackListCount): Tweak return count when remote
      id matching is used.
      (virObjectEventCallbackLookup, virObjectEventStateRegisterID):
      Tweak registration when remote id matching will be used.
      (virObjectEventNew): Default to no remote id.
      (virObjectEventCallbackListAddID): Likewise, but set remote id
      when one is available.
      (virObjectEventCallbackListRemoveID)
      (virObjectEventCallbackListMarkDeleteID): Adjust return value when
      remote id was set.
      (virObjectEventStateEventID): Query existing id.
      (virObjectEventDispatchMatchCallback): Require matching event id.
      (virObjectEventStateCallbackID): Adjust caller.
      * src/conf/network_event.c (virNetworkEventStateRegisterClient): New
      function.
      (virNetworkEventStateRegisterID): Update caller.
      * src/conf/domain_event.c (virDomainEventStateRegister)
      (virDomainEventStateRegisterID): Update callers.
      * src/remote/remote_driver.c
      (remoteConnectNetworkEventRegisterAny)
      (remoteConnectNetworkEventDeregisterAny)
      (remoteConnectDomainEventDeregisterAny): Likewise.
      (remoteEventQueue): Hoist earlier to avoid forward declaration,
      and add parameter.  Adjust all callers.
      * src/libvirt_private.syms (conf/object_event.h): Drop function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a59097e5
  3. 08 1月, 2014 1 次提交
    • L
      Fix bridge configuration when OUTPUT policy is DROP on the host · 538daf7f
      Lénaïc Huard 提交于
      When the host is configured with very restrictive firewall (default policy
      is DROP for all chains, including OUTPUT), the bridge driver for Linux
      adds netfilter entries to allow DHCP and DNS requests to go from the VM
      to the dnsmasq of the host.
      
      The issue that this commit fixes is the fact that a DROP policy on the OUTPUT
      chain blocks the DHCP replies from the host’s dnsmasq to the VM.
      As DHCP replies are sent in UDP, they are not caught by any --ctstate ESTABLISHED
      rule and so, need to be explicitly allowed.
      Signed-off-by: NLénaïc Huard <lenaic@lhuard.fr.eu.org>
      538daf7f
  4. 04 1月, 2014 1 次提交
    • E
      event: fix doc typos, and doc more public methods · 6742fb0b
      Eric Blake 提交于
      While working on events, I found a number of minor issues; I'm
      hoisting these to the front rather than doing it piecemeal in
      the patches where I first noticed bad or missing documentation.
      
      * src/conf/object_event.c: Fix grammar, document all parameters
      of public functions, wrap some long lines.
      * src/conf/object_event.h: Likewise.
      * src/conf/network_event.c: Likewise.
      * src/conf/domain_event.c: Likewise (except for the large number
      of event creation functions).
      * src/libvirt_private.cyms (conf/object_event.h): Split...
      (conf/network_event.h): ...to account for new file.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6742fb0b
  5. 12 12月, 2013 1 次提交
  6. 11 12月, 2013 1 次提交
    • C
      Added Network events API and virNetworkEventLifecycle. · 9ff38c54
      Cédric Bosdonnat 提交于
      Define the public API for (de-)registering network events
      and the callbacks for receiving lifecycle events. The lifecycle
      event includes a 'detail' parameter to match the domain lifecycle
      event data, but this is currently unused.
      
      The network events related code goes into its own set of internal
      files src/conf/network_event.[ch]
      9ff38c54
  7. 10 12月, 2013 5 次提交
  8. 03 12月, 2013 1 次提交
    • P
      qemu: Refactor qemuTranslateDiskSourcePool · e1a4d08b
      Peter Krempa 提交于
      Before this patch, the translation function still needs a second ugly
      helper function to actually format the command line for qemu. But if we
      do the right stuff in the translation function, we don't have to bother
      with the second function any more.
      
      This patch removes the messy qemuBuildVolumeString function and changes
      qemuTranslateDiskSourcePool to set stuff up correctly so that the
      regular code paths meant for volumes can be used to format the command
      line correctly.
      
      For this purpose a new helper "qemuDiskGetActualType()" is introduced to
      return the type of the volume in a pool.
      
      As a part of the refactor the qemuTranslateDiskSourcePool function is
      fixed to do decisions based on the pool type instead of the volume type.
      This allows to separate pool-type-specific stuff more clearly and will
      ease addition of other pool types that will require certain other
      operations to get the correct pool source.
      
      The previously fixed tests should make sure that we don't break stuff
      that was working before.
      e1a4d08b
  9. 02 12月, 2013 2 次提交
  10. 28 11月, 2013 2 次提交
  11. 27 11月, 2013 1 次提交
  12. 12 11月, 2013 1 次提交
  13. 07 11月, 2013 3 次提交
    • E
      storage: always probe type with buffer · 348b4e25
      Eric Blake 提交于
      This gets rid of another stat() per volume, as well as cutting
      bytes read in half, when populating the volumes of a directory
      pool during a pool refresh.  Not to mention that it provides an
      interface that can let gluster pools also probe file types.
      
      * src/util/virstoragefile.h (virStorageFileProbeFormatFromFD):
      Delete.
      (virStorageFileProbeFormatFromBuf): New prototype.
      (VIR_STORAGE_MAX_HEADER): New constant, based on...
      * src/util/virstoragefile.c (STORAGE_MAX_HEAD): ...old name.
      (vmdk4GetBackingStore, virStorageFileGetMetadataInternal)
      (virStorageFileProbeFormat): Adjust clients.
      (virStorageFileProbeFormatFromFD): Delete.
      (virStorageFileProbeFormatFromBuf): Export.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Adjust client.
      * src/libvirt_private.syms (virstoragefile.h): Adjust exports.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      348b4e25
    • E
      storage: refactor backing chain division of labor · 3ead2e7d
      Eric Blake 提交于
      Future patches will want to learn metadata about a file using
      a buffer that was already parsed in order to probe the file's
      format.  Rather than reopening and re-reading the file, it makes
      sense to separate getting file contents from actually parsing
      those contents.
      
      * src/util/virstoragefile.c (virStorageFileGetMetadataFromBuf)
      (virStorageFileGetMetadataFromFDInternal): New functions.
      (virStorageFileGetMetadataInternal): Hoist fstat() and read() into
      callers.
      (virStorageFileGetMetadataFromFD)
      (virStorageFileGetMetadataRecurse): Rework clients.
      * src/util/virstoragefile.h (virStorageFileGetMetadataFromBuf):
      New prototype.
      * src/libvirt_private.syms (virstoragefile.h): Export it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3ead2e7d
    • E
      storage: avoid short reads while chasing backing chain · 5327fad4
      Eric Blake 提交于
      Our backing file chain code was not very robust to an ill-timed
      EINTR, which could lead to a short read causing us to randomly
      treat metadata differently than usual.  But the existing
      virFileReadLimFD forces an error if we don't read the entire
      file, even though we only care about the header of the file.
      So add a new virFile function that does what we want.
      
      * src/util/virfile.h (virFileReadHeaderFD): New prototype.
      * src/util/virfile.c (virFileReadHeaderFD): New function.
      * src/libvirt_private.syms (virfile.h): Export it.
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
      (virStorageFileProbeFormatFromFD): Use it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5327fad4
  14. 05 11月, 2013 1 次提交
  15. 04 11月, 2013 4 次提交
  16. 29 10月, 2013 2 次提交
  17. 21 10月, 2013 2 次提交
  18. 15 10月, 2013 1 次提交
  19. 14 10月, 2013 2 次提交
  20. 11 10月, 2013 1 次提交
  21. 10 10月, 2013 1 次提交
    • P
      qemu: Prefer VFIO for PCI device passthrough · f094aaac
      Peter Krempa 提交于
      Prefer using VFIO (if available) to the legacy KVM device passthrough.
      
      With this patch a PCI passthrough device without the driver configured
      will be started with VFIO if it's available on the host. If not legacy
      KVM passthrough is checked and error is reported if it's not available.
      f094aaac
  22. 05 10月, 2013 1 次提交
    • E
      build: fix build --without-remote · bdc55cc7
      Eric Blake 提交于
      I tried to test ./configure --without-lxc --without-remote.
      First, the build failed with some odd errors, such as an
      inability to build xen, or link failures for virNetTLSInit.
      But when you think about it, once there is no remote code,
      all of libvirtd is useless, any stateful driver that depends
      on libvirtd is also not worth compiling, and any libraries
      used only by RPC code are not needed.  So I patched
      configure.ac to make for some saner defaults when an
      explicit disable is attempted.  Similarly, since we have
      migrated virnetdevbridge into generic code, the workaround
      for Linux kernel stupidity must not depend on stateful
      drivers being in use.
      
      Then there's 'make check' that needs segregation.
      
      Wow - quite a bit of cleanup to make --without-remote useful :)
      
      * configure.ac: Let --without-remote toggle defaults on stateful
      drivers and other libraries.  Pick up Linux kernel workarounds
      even when qemu and lxc are not being compiled.
      * tests/Makefile.am (test_programs): Factor out programs that
      require remote.
      * src/libvirt_private.syms (rpc/virnet*.h): Move...
      * src/libvirt_remote.syms: ...into new file.
      * src/Makefile.am (SYM_FILES): Ship new syms file.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bdc55cc7
  23. 04 10月, 2013 1 次提交
  24. 30 9月, 2013 1 次提交
  25. 25 9月, 2013 1 次提交
    • L
      util/viriptables: add/remove rules that short-circuit masquerading · ccca5dc3
      Laszlo Ersek 提交于
      The functions
      - iptablesAddForwardDontMasquerade(),
      - iptablesRemoveForwardDontMasquerade
      handle exceptions in the masquerading implemented in the POSTROUTING chain
      of the "nat" table. Such exceptions should be added as chronologically
      latest, logically top-most rules.
      
      The bridge driver will call these functions beginning with the next patch:
      some special destination IP addresses always refer to the local
      subnetwork, even though they don't match any practical subnetwork's
      netmask. Packets from virbrN targeting such IP addresses are never routed
      outwards, but the current rules treat them as non-virbrN-destined packets
      and masquerade them. This causes problems for some receivers on virbrN.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      ccca5dc3
  26. 24 9月, 2013 1 次提交