1. 22 7月, 2014 2 次提交
  2. 21 7月, 2014 4 次提交
  3. 19 7月, 2014 1 次提交
    • R
      bhyve: reconnect to domains after libvirtd restart · 29e45ea1
      Roman Bogorodskiy 提交于
      Try to reconnect to the running domains after libvirtd restart. To
      achieve that, do:
      
       * Save domain state
        - Modify virBhyveProcessStart() to save domain state to the state
          dir
        - Modify virBhyveProcessStop() to cleanup the pidfile and the state
      
       * Detect if the state information loaded from the driver's state
         dir matches the actual state. Consider domain active if:
          - PID it points to exist
          - Process title of this PID matches the expected one with the
            domain name
      
         Otherwise, mark the domain as shut off.
      
      Note: earlier development bhyve versions before FreeBSD 10.0-RELEASE
      didn't set proctitle we expect, so the current code will not detect
      it. I don't plan adding support for this unless somebody requests
      this.
      29e45ea1
  4. 18 7月, 2014 8 次提交
  5. 17 7月, 2014 21 次提交
  6. 16 7月, 2014 4 次提交
    • E
      blockjob: wait for pivot to complete · 97c59b9c
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1119173 documents that
      commit eaba79d2 was flawed in the implementation of the
      VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC flag when it comes to completing
      a blockcopy.  Basically, the qemu pivot action is async (the QMP
      command returns immediately, but the user must wait for the
      BLOCK_JOB_COMPLETE event to know that all I/O related to the job
      has finally been flushed), but the libvirt command was documented
      as synchronous by default.  As active block commit will also be
      using this code, it is worth fixing now.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Don't skip wait
      loop after pivot.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      97c59b9c
    • E
      util: forbid freeing const pointers · a0b5ace2
      Eric Blake 提交于
      Now that we've finally fixed all the violators, it's time to
      enforce that any pointer to a const object is never freed (it
      is aliasing some other memory, where the non-const original
      should be freed instead).  Alas, the code still needs a normal
      vs. Coverity version, but at least we are still guaranteeing
      that the macro call evaluates its argument exactly once.
      
      I verified that we still get the following compiler warnings,
      which in turn halts the build thanks to -Werror on gcc (hmm,
      gcc 4.8.3's placement of the ^ for ?: type mismatch is a bit
      off, but that's not our problem):
      
          int oops1 = 0;
          VIR_FREE(oops1);
          const char *oops2 = NULL;
          VIR_FREE(oops2);
          struct blah { int dummy; } oops3;
          VIR_FREE(oops3);
      
      util/virauthconfig.c:159:35: error: pointer/integer type mismatch in conditional expression [-Werror]
           VIR_FREE(oops1);
                                         ^
      util/virauthconfig.c:161:5: error: passing argument 1 of 'virFree' discards 'const' qualifier from pointer target type [-Werror]
           VIR_FREE(oops2);
           ^
      In file included from util/virauthconfig.c:28:0:
      util/viralloc.h:79:6: note: expected 'void *' but argument is of type 'const void *'
       void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
            ^
      util/virauthconfig.c:163:35: error: type mismatch in conditional expression
           VIR_FREE(oops3);
                                         ^
      
      * src/util/viralloc.h (VIR_FREE): No longer cast away const.
      * src/xenapi/xenapi_utils.c (xenSessionFree): Work around bogus
      header.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a0b5ace2
    • C
      storagevol: add nocow to vol xml · a9fd30e6
      Chunyan Liu 提交于
      Add 'nocow' to storage volume xml so that user can have an option
      to set NOCOW flag to the newly created volume. It's useful on btrfs
      file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this
      bad performance is to turn off COW attributes on VM files. Generally, there
      are two ways to turn off COW on btrfs: a) by mounting fs with nodatacow,
      then all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to 'nocow' option, it could set
      NOCOW flag per file:
      for raw file images, handle 'nocow' in libvirt code; for non-raw file images,
      pass 'nocow=on' option to qemu-img, and let qemu-img to handle that (requires
      qemu-img version >= 2.1).
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      a9fd30e6
    • M
      Fix const correctness · 607806f8
      Michal Privoznik 提交于
      In many places we define a variable as a 'const char *' when in fact
      we modify it just a few lines below. Or even free it. We should not do
      that.
      
      There's one exception though, in xenSessionFree() xenapi_utils.c. We
      are freeing the xen_session structure which is defined in
      xen/api/xen_common.h public header. The structure contains session_id
      which is type of 'const char *' when in fact it should have been just
      'char *'. So I'm leaving this unmodified, just noticing the fact in
      comment.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      607806f8