1. 03 4月, 2015 2 次提交
    • E
      conf: Introduce virStoragePoolSaveState · 39b183b4
      Erik Skultety 提交于
      Introduce virStoragePoolSaveState to properly format the state XML in
      the same manner as virStoragePoolDefFormat, except for adding a
      <poolstate> ... </poolstate> around the definition. This is similar to
      virNetworkObjFormat used to save the live/active network information.
      39b183b4
    • E
      conf: Introduce virStoragePoolDefFormatBuf · 6ae11909
      Erik Skultety 提交于
      When modifying config/status XML, it might be handy to include some
      additional XML elements (e.g. <poolstate>). In order to do so,
      introduce new formatting function virStoragePoolDefFormatBuf and make
      virStoragePoolDefFormat call it.
      6ae11909
  2. 02 4月, 2015 28 次提交
  3. 31 3月, 2015 3 次提交
    • P
      qemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT · 630ee5ac
      Peter Krempa 提交于
      When the synchronous pivot option is selected, libvirt would not update
      the backing chain until the job was exitted. Some applications then
      received invalid data as their job serialized first.
      
      This patch removes polling to wait for the ABORT/PIVOT job completion
      and replaces it with a condition. If a synchronous operation is
      requested the update of the XML is executed in the job of the caller of
      the synchronous request. Otherwise the monitor event callback uses a
      separate worker to update the backing chain with a new job.
      
      This is a regression since 1a92c719
      
      When the ABORT job is finished synchronously you get the following call
      stack:
       #0  qemuBlockJobEventProcess
       #1  qemuDomainBlockJobImpl
       #2  qemuDomainBlockJobAbort
       #3  virDomainBlockJobAbort
      
      While previously or while using the _ASYNC flag you'd get:
       #0  qemuBlockJobEventProcess
       #1  processBlockJobEvent
       #2  qemuProcessEventHandler
       #3  virThreadPoolWorker
      630ee5ac
    • P
      qemu: Extract internals of processBlockJobEvent into a helper · 0c4474df
      Peter Krempa 提交于
      Later on I'll be adding a condition that will allow to synchronise a
      SYNC block job abort. The approach will require this code to be called
      from two different places so it has to be extracted into a helper.
      0c4474df
    • P
      qemu: processBlockJob: Don't unlock @vm twice · 6b6c4ab8
      Peter Krempa 提交于
      Commit 1a92c719 moved code to handle block job events to a different
      function that is executed in a separate thread. The caller of
      processBlockJob handles locking and unlocking of @vm, so the we should
      not do it in the function itself.
      6b6c4ab8
  4. 30 3月, 2015 5 次提交
    • P
      qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase · 3c6a72d5
      Peter Krempa 提交于
      The block copy API takes the speed in bytes/s rather than MiB/s that was
      the prior approach in virDomainBlockRebase. We correctly converted the
      speed to bytes/s in the old API but we still called the common helper
      virDomainBlockCopyCommon with the unadjusted variable.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1207122
      3c6a72d5
    • M
      qemuDomainGetNumaParameters: Check for the correct CGroup controller · 53eae3e7
      Michal Privoznik 提交于
      When getting info on NUMA parameters for domain,
      virCgroupGetCpusetMems() may be called. However, as of 43b67f2e
      the call is guarded by check if memory controller is present.
      Even though it may be not obvious instantly, NUMA parameters are
      stored under cpuset controller. Therefore the check needs to look
      like this:
      
        if (!virCgroupHasController(priv->cgroup,
                                    VIR_CGROUP_CONTROLLER_CPUSET) ||
            virCgroupGetCpusetMems(priv->cgroup, &nodeset) < 0) {
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      53eae3e7
    • M
      virCgroupController: Check the enum fits into 'int' · 771e6e5a
      Michal Privoznik 提交于
      Throughout our code, the virCgroupController enum is used in two ways.
      First as an index to an array of cgroup controllers:
      
      struct virCgroup {
          char *path;
      
          struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
      };
      
      Second way is that when calling virCgroupNew() a bitmask of the enum
      items can be passed to selectively detect only some controllers. For
      instance:
      
      int
      virCgroupNewVcpu(virCgroupPtr domain,
                       int vcpuid,
                       bool create,
                       virCgroupPtr *group)
      {
          ...
          controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) |
                         (1 << VIR_CGROUP_CONTROLLER_CPUACCT) |
                         (1 << VIR_CGROUP_CONTROLLER_CPUSET));
      
          if (virCgroupNew(-1, name, domain, controllers, group) < 0)
              goto cleanup;
      }
      
      Even though it's highly unlikely that so many new controllers will be
      invented so that we would overflow when constructing the bitmask, it
      doesn't hurt to check at compile time either.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      771e6e5a
    • M
      virCgroupNew: Enhance debug message · 149a62bc
      Michal Privoznik 提交于
      When creating new internal representation of cgroups, all passed
      arguments are logged. Well, except for two: pid and pointer for
      return value. Lets log them too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      149a62bc
    • M
      virCgroupNewPartition: Fix comment · 0a09bcdc
      Michal Privoznik 提交于
      The function has no argument named @name rather than @path
      instead.  The comment is, however, referring to @name while it
      should have been referring to @path really.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0a09bcdc
  5. 28 3月, 2015 2 次提交