1. 27 7月, 2011 8 次提交
    • J
      qemu: Remove special case for virDomainBlockStats · 90feb02d
      Jiri Denemark 提交于
      Like other query commands, this can now be called directly during
      migration.
      90feb02d
    • J
      qemu: Remove special case for virDomainGetBlockInfo · fb3cada0
      Jiri Denemark 提交于
      Like other query commands, this can now be called directly during
      migration.
      fb3cada0
    • J
      qemu: Recover from interrupted migration · 9cfd2197
      Jiri Denemark 提交于
      9cfd2197
    • J
      qemu: Migration job on source daemon · d58e91a8
      Jiri Denemark 提交于
      Make MIGRATION_OUT use the new helper methods.
      
      This also introduces new protection to migration v3 process: the
      migration job is held from Begin to Confirm to avoid changes to a domain
      during migration (esp. between Begin and Perform phases). This change is
      automatically applied to p2p and tunneled migrations. For normal
      migration, this requires support from a client. In other words, if an
      old (pre 0.9.4) client starts normal migration of a domain, the domain
      will not be protected against changes between Begin and Perform steps.
      d58e91a8
    • J
      qemu: Migration job on destination daemon · eeb008db
      Jiri Denemark 提交于
      Make MIGRATION_IN use the new helper methods.
      eeb008db
    • J
      qemu: Implement migration job phases · 92713670
      Jiri Denemark 提交于
      This patch introduces several helper methods to deal with jobs and
      phases during migration in a simpler manner.
      92713670
    • E
      build: support warnings on RHEL 5 · 1c93fbbb
      Eric Blake 提交于
      Without this, a configure built by autoconf 2.59 was broken when
      trying to detect which compiler warning flags were supported.
      
      * .gnulib: Update to latest, for warnings.m4 fix.
      * bootstrap.conf: Add fclose explicitly, to match recent gnulib
      implicit dependency changes.
      * src/qemu/qemu_conf.c (includes): Drop unused include.
      * src/uml/uml_conf.c (include): Likewise.
      Reported by Daniel P. Berrange.
      1c93fbbb
    • M
      bandwidth: Integrate bandwidth into portgroups · fe957f0a
      Michal Privoznik 提交于
      Every DomainNetDef has a bandwidth, as does every portgroup.
      Whenever a DomainNetDef of type NETWORK is about to be used, a call is
      made to networkAllocateActualDevice(). This function chooses the "best"
      bandwidth object and places it in the DomainActualNetDef.
      From that point on, whenever some code needs to use the bandwidth data
      for the interface, it's retrieved with virDomainNetGetActualBandwidth(),
      which will always return the "best" info as determined in the
      previous step.
      fe957f0a
  2. 26 7月, 2011 12 次提交
    • S
      Build: fix build if HAVE_AVAHI is not defined · f63930a7
      Stefan Berger 提交于
      Fix the build if HAVE_AVAHI is not defined.
      f63930a7
    • D
      Fix race in ref counting when handling RPC jobs · 0302391e
      Daniel P. Berrange 提交于
      When an incoming RPC message is ready for processing,
      
        virNetServerClientDispatchRead()
      
      will invoke the 'dispatchFunc' callback. This is set to
      
        virNetServerDispatchNewMessage
      
      This function puts the message + client in a queue for processing by the thread
      pool. The thread pool worker function is
      
        virNetServerHandleJob
      
      The first thing this does is acquire an extra reference on the 'client'.
      
      Unfortunately, between the time the message+client are put on the thread pool
      queue, and the time the worker runs, the client object may have had its last
      reference removed.
      
      We clearly need to add the reference to the client object before putting the
      client on the processing queue
      
      * src/rpc/virnetserverclient.c: Add a reference to the client when
        invoking the dispatch function
      * src/rpc/virnetserver.c: Don't acquire a reference to the client
        when in the worker thread
      0302391e
    • W
      set cpu bandwidth for the vm · 652e55b7
      Wen Congyang 提交于
      The cpu bandwidth is applied at the vcpu group level. We should apply it
      at the vm group level too, because the vm may do heavy I/O, and it will affect
      the other vm.
      
      We apply cpu bandwidth at the vcpu and the vm group level, so we must ensure
      that max(child_quota) <= parent_quota when we modify cpu bandwidth.
      652e55b7
    • D
      Fix build with gnutls 1.0.x branch · 4d349ef7
      Daniel P. Berrange 提交于
      4d349ef7
    • O
      network: Fix typo · 8fb9fdc3
      Osier Yang 提交于
      Introduced by commit 239322cb, reported by Ruben Kerkhof.
      8fb9fdc3
    • D
      Add mutex protection to SASL and TLS modules · 5622830c
      Daniel P. Berrange 提交于
      The virNetSASLContext, virNetSASLSession, virNetTLSContext and
      virNetTLSSession classes previously relied in their owners
      (virNetClient / virNetServer / virNetServerClient) to provide
      locking protection for concurrent usage. When virNetSocket
      gained its own locking code, this invalidated the implicit
      safety the SASL/TLS modules relied on. Thus we need to give
      them all explicit locking of their own via new mutexes.
      
      * src/rpc/virnetsaslcontext.c, src/rpc/virnettlscontext.c: Add
        a mutex per object
      5622830c
    • D
      Report error if unable to bind to any socket · a4458597
      Daniel P. Berrange 提交于
      When setting up a server socket, we must skip EADDRINUSE errors
      from bind, since the IPv6 socket bind may have already bound to
      the IPv4 socket too. If we don't manage to bind to any sockets
      at all though, we should then report the EADDRINUSE error as
      normal.
      
      This fixes the case where libvirtd would not exit if some other
      program was listening on its TCP/TLS ports.
      
      * src/rpc/virnetsocket.c: Report EADDRINUSE
      a4458597
    • D
      Fix leak of mDNS object in virNetServer · 4bfd0cf7
      Daniel P. Berrange 提交于
      * src/rpc/virnetserver.c: Free mDNS object
      4bfd0cf7
    • D
      Fix memory leaks in MDNS code · 268cc6e9
      Daniel P. Berrange 提交于
      * src/rpc/virnetservermdns.c: Fix leaks
      268cc6e9
    • E
      vcpu: teach getVcpusFlags about current · 59d04287
      Eric Blake 提交于
      Now that virDomainSetVcpusFlags knows about VIR_DOMAIN_AFFECT_CURRENT,
      so should virDomainGetVcpusFlags.
      
      Unfortunately, the virsh counterpart 'virsh vcpucount' has already
      commandeered --current for a different meaning, so teaching virsh
      to expose this in the next patch will require a bit of care.
      
      * src/libvirt.c (virDomainGetVcpusFlags): Allow
      VIR_DOMAIN_AFFECT_CURRENT.
      * src/libxl/libxl_driver.c (libxlDomainGetVcpusFlags): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainGetVcpusFlags): Likewise.
      * src/test/test_driver.c (testDomainGetVcpusFlags): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainGetVcpusFlags): Likewise.
      59d04287
    • L
      util: change virFile*Pid functions to return < 0 on failure · d6354c16
      Laine Stump 提交于
      Although most functions in libvirt return 0 on success and < 0 on
      failure, there are a few functions lingering around that return errno
      (a positive value) on failure, and sometimes code calling those
      functions incorrectly assumes the <0 standard. I noticed one of these
      the other day when auditing networkStartDhcpDaemon after Guido Gunther
      found a place where success was improperly returned on failure (that
      patch has been acked and is pending a push). The problem was that it
      expected the return value from virFileReadPid to be < 0 on failure,
      but it was actually positive (it was also neglected to set the return
      code in this case, similar to the bug found by Guido).
      
      This all led to the fact that *all* of the virFile*Pid functions in
      util.c are returning errno on failure. This patch remedies that
      problem by changing them all to return -errno on failure, and makes
      any necessary changes to callers of the functions. (In the meantime, I
      also properly set the return code on failure of virFileReadPid in
      networkStartDhcpDaemon).
      d6354c16
    • G
      Catch dnsmasq start failures · 85a954ce
      Guido Günther 提交于
      While we checked the return value we didn't maks sure ret != 0 which
      resulted in dnsmasq errors being ignored.
      85a954ce
  3. 25 7月, 2011 8 次提交
    • W
      rename cfs_* to vcpu_* · 2a667c34
      Wen Congyang 提交于
      In the XML file we now have
      
        <cputune>
          <shares>1024</shares>
          <period>90000</period>
          <quota>0</quota>
        </cputune>
      
      But the schedinfo parameter are being named
      
       cpu_shares: 1024
       cfs_period: 90000
       cfs_quota: 0
      
      The period/quota is per-vcpu value, so these new tunables should be named
      'vcpu_period' and 'vcpu_quota'.
      2a667c34
    • W
      driver.h: Fix two driver documentation mistakes · 2fdf2173
      Wieland Hoffmann 提交于
      2fdf2173
    • M
      bandwidth: Implement functions to enable and disable QoS · 90074ecf
      Michal Privoznik 提交于
      These function executes 'tc' with appropriate arguments to set
      desired QoS setting on interface or bridge during its creation.
      90074ecf
    • M
      bandwidth: Create format functions · aaa98b08
      Michal Privoznik 提交于
      aaa98b08
    • M
      bandwidth: Add parsing and free functions · e2ed67a8
      Michal Privoznik 提交于
      These functions parse given XML node and return pointer to the
      output. Unknown elements are silently ignored. Attributes must
      be integer and must fit in unsigned long long.
      
      Free function frees elements of virBandwidth structure.
      e2ed67a8
    • M
      bandwidth: Declare internal structures · 73731882
      Michal Privoznik 提交于
      73731882
    • L
      network: provide internal API to return IP of a network · 239322cb
      Laine Stump 提交于
      The new listenNetwork attribute needs to learn an IP address based on a
      named network. This patch provides a function networkGetNetworkAddress
      which provides that.
      
      Some networks have an IP address explicitly in their configuration
      (ie, those with a forward type of "none", "route", or "nat"). For
      those, we can just return the IP address from the config.
      
      The rest will have a physical device associated with them (either via
      <bridge name='...'/>, <forward ... dev='...'/>, or possibly via a pool
      of interfaces inside the network's <forward> element) and we will need
      to ask the kernel for a current IP address of that device (via the
      newly added ifaceGetIPAddress)
      
      If networkGetNetworkAddress encounters an error while trying to learn
      the address for a network, it will return -1. In the case that libvirt
      has been compiled without the network driver, the call is a macro
      which reduces to -2. This allows differentiating between a failure of
      the network driver, and its complete absence.
      239322cb
    • L
      util: add an ifaceGetIPAddress to the interface utilities · c5d1592e
      Laine Stump 提交于
      This function uses ioctl(SIOCGIFADDR), which limits it to returning
      the first IPv4 address of an interface, but that's what we want right
      now (the place we're going to use the address only accepts one).
      c5d1592e
  4. 22 7月, 2011 12 次提交
    • D
      Pre-create /var/lib/libvirt/sanlock directory · c198d916
      Daniel P. Berrange 提交于
      The sanlock plugin for libvirt expects the directory
      /var/lib/libvirt/sanlock to exist. Create this and add
      it to the RPM
      
      * libvirt.spec.in: Add /var/lib/libvirt/sanlock
      * src/Makefile.am: Create /var/lib/libvirt/sanlock
      c198d916
    • D
      Honour filesystem readonly flag & make special FS readonly · b3ad9b9b
      Daniel P. Berrange 提交于
      A container should not be allowed to modify stuff in /sys
      or /proc/sys so make them readonly. Make /selinux readonly
      so that containers think that selinux is disabled.
      
      Honour the readonly flag when mounting container filesystems
      from the guest XML config
      
      * src/lxc/lxc_container.c: Support readonly mounts
      b3ad9b9b
    • D
      Refactor mounting of special filesystems · 6d37888e
      Daniel P. Berrange 提交于
      Even in non-virtual root filesystem mode we should be mounting
      more than just a new /proc. Refactor lxcContainerMountBasicFS
      so that it does everything except for /dev and /dev/pts moving
      that into lxcContainerMountDevFS. Pass in a source prefix
      to lxcContainerMountBasicFS() so it can be used in both shared
      root and private root modes.
      
      * src/lxc/lxc_container.c: Unify mounting code for special
        filesystems
      6d37888e
    • D
      Pull code for doing a bind mount into separate method · 66a00e61
      Daniel P. Berrange 提交于
      The bind mount setup is about to get more complicated.
      To avoid having to deal with several copies, pull it
      out into a separate lxcContainerMountFSBind method.
      
      Also pull out the iteration over container filesystems,
      so that it will be easier to drop in support for non-bind
      mount filesystems
      
      * src/lxc/lxc_container.c: Pull bind mount code out into
        lxcContainerMountFSBind
      66a00e61
    • D
      Allow certificate sanity checking to be disabled · 07f9b6f0
      Daniel P. Berrange 提交于
      When libvirtd starts it it will sanity check its own certs,
      and before libvirt clients connect to a remote server they
      will sanity check their own certs. This patch allows such
      sanity checking to be skipped. There is no strong reason to
      need to do this, other than to bypass possible libvirt bugs
      in sanity checking, or for testing purposes.
      
      libvirt.conf gains tls_no_sanity_certificate parameter to
      go along with tls_no_verify_certificate. The remote driver
      client URIs gain a no_sanity URI parameter
      
      * daemon/test_libvirtd.aug, daemon/libvirtd.conf,
        daemon/libvirtd.c, daemon/libvirtd.aug: Add parameter to
        allow cert sanity checks to be skipped
      * src/remote/remote_driver.c: Add no_sanity parameter to
        skip cert checks
      * src/rpc/virnettlscontext.c, src/rpc/virnettlscontext.h:
        Add new parameter for skipping sanity checks independantly
        of skipping session cert validation checks
      07f9b6f0
    • M
      build: Use $(PYTHON) instead of python for the keycode map generator · 1a80a4e0
      Matthias Bolte 提交于
      Also prepend $(AM_V_GEN) to the command line, mark virkeycode-mapgen.py
      as executable and switch the shebang line from /bin/python to the
      commonly use /usr/bin/python.
      1a80a4e0
    • M
      xenapi: Fix double-freeing the session in xenapiClose · 379efa10
      Matthias Bolte 提交于
      xen_session_logout already frees the whole session object.
      Don't call xenSessionFree on a freed session object.
      
      Reported by Sharmila Radhakrishnan.
      379efa10
    • O
      remote/ssh: optional "keyfile" parameter. · 6b01c83a
      Oskari Saarenmaa 提交于
      New optional parameter "keyfile" for ssh transport allows the user to select
      the private key to be used to authenticate to the remote host.
      6b01c83a
    • L
      util: make interface.c functions consistently return < 0 on error · f7e18208
      Laine Stump 提交于
      All of the functions in util/interface.c were returning 0 on success,
      but some returned -1 on error, and some returned a positive value
      (usually the value of errno, but sometimes just 1). Libvirt's standard
      is to return < 0 on error (in the case of functions that need to
      return errno, -errno is returned.
      
      This patch modifies all functions in interface.c to consistently
      return < 0 on error, and makes changes to callers of those functions
      where necessary.
      f7e18208
    • D
      Refactor the certification validation code · 637711cb
      Daniel P. Berrange 提交于
      There is some commonality between the code for sanity checking
      certs when initializing libvirt and the code for validating
      certs during a live TLS session handshake. This patchset splits
      up the sanity checking function into several smaller functions
      each doing a specific type of check. The cert validation code
      is then updated to also call into these functions
      
      * src/rpc/virnettlscontext.c: Refactor cert validation code
      637711cb
    • D
      Remove call to deprecated gnutls_certificate_type_set_priority (again) · 3b8061c7
      Daniel P. Berrange 提交于
      The gnutls_certificate_type_set_priority method is deprecated.
      Since we already set the default gnutls priority, it was not
      serving any useful purpose and can be removed
      
      * src/rpc/virnettlscontext.c: Remove gnutls_certificate_type_set_priority
        call
      3b8061c7
    • D
      Ensure that libvirtd shuts down if initialization fails · 92509413
      Daniel P. Berrange 提交于
      If the virStateInitialize call fails we must shutdown libvirtd
      since drivers will not be available. Just free'ing the virNetServer
      is not sufficient, we must send a SIGTERM to ourselves so that
      we interrupt the event loop and trigger a orderly shutdown
      
      * daemon/libvirtd.c: Kill ourselves if state init fails
      * src/rpc/virnetserver.c: Add some debugging to event loop
      92509413