1. 22 9月, 2015 15 次提交
    • P
      conf: Don't always recalculate initial memory size from NUMA size totals · 0fed5a7b
      Peter Krempa 提交于
      When implementing memory hotplug I've opted to recalculate the initial
      memory size (contents of the <memory> element) as a sum of the sizes of
      NUMA nodes when NUMA was enabled. This was based on an assumption that
      qemu did not allow starting when the NUMA node size total didn't equal
      to the initial memory size. Unfortunately the check was introduced to
      qemu just lately.
      
      This patch uses the new XML parser flag to decide whether it's safe to
      update the memory size total from the NUMA cell sizes or not.
      
      As an additional improvement we now report an error in case when the
      size of hotplug memory would exceed the total memory size.
      
      The rest of the changes assures that the function is called with correct
      flags.
      0fed5a7b
    • P
      conf: Pre-calculate initial memory size instead of always calculating it · 403e8606
      Peter Krempa 提交于
      Add 'initial_memory' member to struct virDomainMemtune so that the
      memory size can be pre-calculated once instead of inferring it always
      again and again.
      
      Separating of the fields will also allow finer granularity of decisions
      in later patches where it will allow to keep the old initial memory
      value in cases where we are handling incomming migration from older
      versions that did not always update the size from NUMA as the code did
      previously.
      
      The change also requires modification of the qemu memory alignment
      function since at the point where we are modifying the size of NUMA
      nodes the total size needs to be recalculated too.
      
      The refactoring done in this patch also fixes a crash in the hyperv
      driver that did not properly initialize def->numa and thus
      virDomainNumaGetMemorySize(def->numa) crashed.
      
      In summary this patch should have no functional impact at this point.
      403e8606
    • P
      conf: Rename max_balloon to total_memory · 8059a990
      Peter Krempa 提交于
      The name of the variable was misleading. Rename it and it's setting
      accessor before other fixes.
      8059a990
    • P
      conf: Split memory related post parse stuff into separate function · 849b5fc4
      Peter Krempa 提交于
      The post parse func is growing rather large. Since later patches will
      introduce more logic in the memory post parse code, split it into a
      separate handler.
      849b5fc4
    • P
      conf: Add XML parser flag that will allow us to do incompatible updates · 59173c3d
      Peter Krempa 提交于
      Add a new parser flag that will mark code paths that parse XML files
      wich will not be used with existing VM state so that post parse
      callbacks can possibly do ABI incompatible changes if needed.
      59173c3d
    • P
      conf: Document all VIR_DOMAIN_DEF_PARSE_* flags · 24e3b0ed
      Peter Krempa 提交于
      24e3b0ed
    • P
      conf: Drop VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST flag · ed94ad9e
      Peter Krempa 提交于
      The flag was used only for formatting the XML and once the parser and
      formatter flags were split in 0ecd6851
      it doesn't make sense any more to have it.
      ed94ad9e
    • P
      qemu: Make memory alignment helper more universal · 3fb08198
      Peter Krempa 提交于
      Extract the size determination into a separate function and reuse it
      across the memory device alignment functions. Since later we will need
      to decide the alignment size according to architecture let's pass def to
      the functions.
      3fb08198
    • P
      conf: Add helper to determine whether memory hotplug is enabled for a vm · 1891cad5
      Peter Krempa 提交于
      Add a simple helper so that the code doesn't have to rewrite the same
      condition multiple times.
      1891cad5
    • P
      libxl: vz: Use accessor instead of direct access for max_balloon · 5dd61a16
      Peter Krempa 提交于
      Commits 45697fe5 and f863ac80 used direct access to the variable instead
      of the preferred accessor method.
      5dd61a16
    • P
      Removed unneeded check · e2863e77
      Pavel Fedin 提交于
      Since test suite now correctly creates capabilities cache, the hack is not
      needed any more.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      e2863e77
    • P
      tests: use mockup cache · 0636c4a8
      Pavel Fedin 提交于
      Use the new API in order to correctly add capability sets to the cache
      before parsing XML files
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      0636c4a8
    • P
      Implement infrastracture for mocking up QEMU capabilities cache · f7dd3357
      Pavel Fedin 提交于
      The main purpose of this patch is to introduce test mode to
      virQEMUCapsCacheLookup(). This is done by adding a global variable, which
      effectively overrides binary name. This variable is supposed to be set by
      test suite.
      
      The second addition is qemuTestCapsCacheInsert() function which allows the
      test suite to actually populate the cache.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      f7dd3357
    • P
      tests: split out common qemu driver initialization · 5b7bf208
      Pavel Fedin 提交于
      Two utility functions are introduced for proper initialization and
      cleanup of the driver.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5b7bf208
    • D
      test driver: don't unlock pool after freeing it · 03cf57a3
      David Mansfield 提交于
       Invalid read of size 4
          at 0x945CA30: __pthread_mutex_unlock_full (in /lib64/libpthread-2.20.so)
          by 0x4F0404B: virMutexUnlock (virthread.c:94)
          by 0x4F7161B: virStoragePoolObjUnlock (storage_conf.c:2603)
          by 0x4FE0476: testStoragePoolUndefine (test_driver.c:4328)
          by 0x4FCF086: virStoragePoolUndefine (libvirt-storage.c:656)
          by 0x15A7F5: cmdPoolUndefine (virsh-pool.c:1721)
          by 0x12F48D: vshCommandRun (vsh.c:1212)
          by 0x132AA7: main (virsh.c:943)
        Address 0xfda56a0 is 16 bytes inside a block of size 104 free'd
          at 0x4C2BA6C: free (vg_replace_malloc.c:473)
          by 0x4EA5C96: virFree (viralloc.c:582)
          by 0x4F70B69: virStoragePoolObjFree (storage_conf.c:412)
          by 0x4F7167B: virStoragePoolObjRemove (storage_conf.c:437)
          by 0x4FE0468: testStoragePoolUndefine (test_driver.c:4323)
          by 0x4FCF086: virStoragePoolUndefine (libvirt-storage.c:656)
          by 0x15A7F5: cmdPoolUndefine (virsh-pool.c:1721)
          by 0x12F48D: vshCommandRun (vsh.c:1212)
          by 0x132AA7: main (virsh.c:943)
      03cf57a3
  2. 21 9月, 2015 6 次提交
  3. 18 9月, 2015 14 次提交
  4. 17 9月, 2015 2 次提交
    • C
      libxl: fix AttachDeviceConfig on hostdev type · 56945e13
      Chunyan Liu 提交于
      After attach-device a <hostdev> with --config, new device doesn't
      show up in dumpxml and in guest.
      
      To fix that, set dev->data.hostdev = NULL after work so that the
      pointer is not freed, since vmdef has the pointer and still need it.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      56945e13
    • M
      vmx: Expose datacenter path in domain XML · 636a9905
      Matthias Bolte 提交于
      Tool such as libguestfs need the datacenter path to get access to disk
      images. The ESX driver knows the correct datacenter path, but this
      information cannot be accessed using libvirt API yet. Also, it cannot
      be deduced from the connection URI in a robust way.
      
      Expose the datacenter path in the domain XML as <vmware:datacenterpath>
      node similar to the way the <qemu:commandline> node works. The new node
      is ignored while parsing the domain XML. In contrast to <qemu:commandline>
      it is output only.
      636a9905
  5. 16 9月, 2015 3 次提交
    • J
      virfile: Check for existence of dir in virFileDeleteTree · b421a708
      John Ferlan 提交于
      Commit id 'f1f68ca3' added code to remove the directory paths for
      auto-generated sockets, but that code could be called before the
      paths were created resulting in generating error messages from
      virFileDeleteTree indicating that the file doesn't exist.
      
      Rather than "enforce" all callers to make the non-NULL and existence
      checks, modify the virFileDeleteTree API to silently ignore NULL on
      input and non-existent directory trees.
      b421a708
    • M
      virsh: Teach attach-interface to --print-xml · 41d4104d
      Michal Privoznik 提交于
      We have the same argument to many other commands that produce an
      XML based on what user typed. But unfortunately attach-interface
      was missing it. Maybe nobody had needed it yet. Well, I did
      just now.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      41d4104d
    • A
      qemu: Fix using guest architecture as lookup key · eb36666d
      Andrea Bolognani 提交于
      When looking for a QEMU binary suitable for running ppc64le guests
      we have to take into account the fact that we use the QEMU target
      as key for the hash, so direct comparison is not good enough.
      
      Factor out the logic from virQEMUCapsFindBinaryForArch() to a new
      virQEMUCapsFindTarget() function and use that both when looking
      for QEMU binaries available on the system and when looking up
      QEMU capabilities later.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260753
      eb36666d