1. 28 4月, 2011 2 次提交
    • K
      libvirt/qemu - support persistent modification of devices · da1eba6b
      KAMEZAWA Hiroyuki 提交于
      This patch adds functions for modify domain's persistent definition.
      To do error recovery in easy way, we use a copy of vmdef and update it.
      
      The whole sequence will be:
      
        make a copy of domain definition.
      
        if (flags & MODIFY_CONFIG)
            update copied domain definition
        if (flags & MODIF_LIVE)
            do hotplug.
        if (no error)
            save copied one to the file and update cached definition.
        else
            discard copied definition.
      
      This patch is mixuture of Eric Blake's work and mine.
      From: Eric Blake <eblake@redhat.com>
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      
      (virDomainObjCopyPersistentDef): make a copy of persistent vm definition
      (qemuDomainAttach/Detach/UpdateDeviceConfig) : callbacks. now empty
      (qemuDomainModifyDeviceFlags): add support for MODIFY_CONFIG and MODIFY_CURRENT
      da1eba6b
    • E
      build: fix 32-bit test failure · 8a6e30f1
      Eric Blake 提交于
      Same fix as commit 1fc288e1.
      
      * tests/hashtest.c (testHashRemoveForEach): Use correct format.
      8a6e30f1
  2. 27 4月, 2011 9 次提交
    • J
      util: Simplify hash implementation · 1671d1dc
      Jiri Denemark 提交于
      So far first entries for each hash key are stored directly in the hash
      table while other entries mapped to the same key are linked through
      pointers. As a result of that, the code is cluttered with special
      handling for the first items.
      
      This patch makes all entries (even the first ones) linked through
      pointers, which significantly simplifies the code and makes it more
      maintainable.
      1671d1dc
    • J
      tests: More unit tests for internal hash APIs · 91e12a50
      Jiri Denemark 提交于
      This adds several tests for remaining hash APIs (custom
      hasher/comparator functions are not covered yet, though).
      
      All tests pass both before and after the "Simplify hash implementation".
      91e12a50
    • O
      build: Fix problem of building Python bindings · 53cb23f4
      Osier Yang 提交于
      If one specify "--with-python=yes" but no python-devel package
      is installed, we ignore it with just a notice message, which
      doesn't give clear guide to user.
      53cb23f4
    • W
      release PCI address only when we have ensured it successfully · 968fd011
      Wen Congyang 提交于
      Steps to reproduce this bug:
      1. # cat net.xml # 00:03.0 has been used
          <interface type='network'>
            <mac address='52:54:00:04:72:f3'/>
            <source network='default'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
          </interface>
      
      2. # virsh attach-device vm1 net.xml
         error: Failed to attach device from net.xml
         error: internal error unable to reserve PCI address 0:0:3
      
      3. # virsh attach-device vm1 net.xml
         error: Failed to attach device from net.xml
         error: internal error unable to execute QEMU command 'device_add': Device 'rtl8139' could not be initialized
      
      The reason of this bug is that: we can not reserve PCI address 0:0:3 because it has
      been used, but we release PCI address when we reserve it failed.
      968fd011
    • H
      free memory properly in cleanup patch · 3c132638
      Hu Tao 提交于
      virsh schedinfo inactive-domain will trigger the problem.
      3c132638
    • W
      free buf->content when vsnprintf() failed · 6fee3da2
      Wen Congyang 提交于
      When buf->error is 1, we do not return buf->content in the function
      virBufferContentAndReset(). So we should free buf->content when
      vsnprintf() failed.
      6fee3da2
    • M
      esx: Fix dynamic dispatch for CastFromAnyType functions · 4a9019af
      Matthias Bolte 提交于
      This was broken by the refactoring in ac1e6586. It resulted in a
      segfault for 'virsh vol-dumpxml' and related volume functions.
      
      Before the refactoring all users of the ESX_VI__TEMPLATE__DISPATCH
      macro dispatched on the item type, as the item is the input to all those
      functions.
      
      Commit ac1e6586 made the dynamically dispatched CastFromAnyType
      functions use this macro too, but this functions dispatched on the
      actual type of the AnyType object. The item is the output of the
      CastFromAnyType functions.
      
      This difference was missed in the refactoring, making CastFromAnyType
      functions dereferencing the item pointer that is NULL at the time of
      the dispatch.
      4a9019af
    • M
      Move call to virReportOOMError into virFileBuildPath · 3ba5d77f
      Matthias Bolte 提交于
      Suggested by Daniel P. Berrange
      3ba5d77f
    • E
      build: use gnulib passfd for simpler SCM_RIGHTS code · 59a5981d
      Eric Blake 提交于
      * .gnulib: Update to latest for passfd fixes.
      * bootstrap.conf (gnulib_modules): Add passfd.
      * src/util/util.c (virFileOpenAs): Simplify.
      59a5981d
  3. 26 4月, 2011 6 次提交
    • J
      qemu: Add flags checking in DomainCoreDump · 1c842378
      Jiri Denemark 提交于
      1c842378
    • M
      Make crash and live flags mutually exclusive in virDomainCoreDump · d9b46a0d
      Mark Wu 提交于
      They don't make any sense when used together.
      d9b46a0d
    • G
      Make sure DNSMASQ_STATE_DIR exists · bf5e3f65
      Guido Günther 提交于
      otherwise the directory returned by networkDnsmasqLeaseFileName will not
      be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv.
      bf5e3f65
    • M
      Fix small memory leaks in config parsing related functions · bf130d2c
      Matthias Bolte 提交于
      Found by 'make -C tests valgrind'.
      
      xen_xm.c: Dummy allocation via virDomainChrDefNew is directly
      overwritten and lost. Free 'script' in success path too.
      
      vmx.c: Free virtualDev_string in success path too.
      
      domain_conf.c: Free compression in success path too.
      bf130d2c
    • M
      Add virDomainEventRebootNew · 14a961ca
      Matthias Bolte 提交于
      This will be used in the ESX driver event handling.
      14a961ca
    • E
      build: make VIR_FREE do some type checking · 90d761ee
      Eric Blake 提交于
      We can exploit the fact that gcc warns about int-to-pointer conversion
      in ternary cond?(void*):(int) in order to prevent future mistakes of
      calling VIR_FREE on a scalar lvalue.  For example, between commits
      158ba873 and 802e2df9, we would have had this warning:
      
      cc1: warnings being treated as errors
      remote.c: In function 'remoteDispatchListNetworks':
      remote.c:3684:70: error: pointer/integer type mismatch in conditional expression
      
      There are still a number of places that malloc into a const char*;
      while it would probably be worth scrubbing them to use char*
      instead, that is a separate patch, so we have to cast away const
      in VIR_FREE for now.
      
      * src/util/memory.h (VIR_FREE): Make gcc warn about integers.
      Iteratively developed from a patch by Christophe Fergeau.
      90d761ee
  4. 25 4月, 2011 1 次提交
    • E
      threads: add one-time initialization support · 99de5990
      Eric Blake 提交于
      mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the
      best we can do is portably expose once-only runtime initialization.
      
      * src/util/threads.h (virOnceControlPtr): New opaque type.
      (virOnceFunc): New callback type.
      (virOnce): New prototype.
      * src/util/threads-pthread.h (virOnceControl): Declare.
      (VIR_ONCE_CONTROL_INITIALIZER): Define.
      * src/util/threads-win32.h (virOnceControl)
      (VIR_ONCE_CONTROL_INITIALIZER): Likewise.
      * src/util/threads-pthread.c (virOnce): Implement in pthreads.
      * src/util/threads-win32.c (virOnce): Implement in WIN32.
      * src/libvirt_private.syms: Export it.
      99de5990
  5. 24 4月, 2011 2 次提交
  6. 23 4月, 2011 2 次提交
  7. 22 4月, 2011 5 次提交
    • K
      libvirt/qemu - clean up UpdateDevice for consolidation. · 9b8543b6
      KAMEZAWA Hiroyuki 提交于
      This patch strips reusable part of qemuDomainUpdateDeviceFlags()
      and consolidate it to qemuDomainModifyDeviceFlags().
      No functional changes.
      
      * src/qemu/qemu_driver.c
      (qemuDomainChangeDiskMediaLive) : pulled out code for updating disks.
      (qemuDomainUpdateDeviceLive) : core of UpdateDevice, extracted from
      UpdateDeviceFlags()
      (qemuDomainModifyDeviceFlags): add support for updating device in live domain.
      (qemuDomainUpdateDeviceFlags): reworked as a wrapper function of
      qemuDomainModifyDeviceFlags()
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9b8543b6
    • K
      libvirt/qemu - clean up At(De)tachDeviceFlags() for consolidation. · 19ad136f
      KAMEZAWA Hiroyuki 提交于
      clean up At(De)tachDeviceFlags() for consolidation.
      
      qemuDomainAttachDeviceFlags()/qemuDomainDetachFlags()/
      qemuDomainUpdateDeviceFlags() has similar logics and copied codes.
      
      This patch series tries to unify them to use shared code when it can.
      At first, clean up At(De)tachDeviceFlags() and devide it into functions.
      
      By this, this patch pulls out shared components between functions.
      Based on patch series by Eric Blake, I added some modification as
      switch-case with QEMU_DEVICE_ATTACH, QEMU_DEVICE_DETACH, QEMU_DEVICE_UPDATE
      
      * src/qemu/qemu_driver.c
      (qemuDomainAt(De)tachDeviceFlags) : pulled out to qemuDomainModifyDeviceFlags()
      (qemuDomainModifyDeviceFlags) : implements generic code for modifying domain.
      (qemuDomainAt(De)tachDeviceFlagsLive) : code for at(de)taching devices to
      domain in line. no changes in logic from old code.
      (qemuDomainAt(De)tachDeviceDiskLive) : for at(de)taching Disks.
      (qemuDomainAt(De)tachDeviceControllerLive) : for at(de)taching Controllers
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      19ad136f
    • K
      libvirt/qemu - Centralize device modification in the more flexible APIs · 2160116f
      KAMEZAWA Hiroyuki 提交于
      Centralize device modification in the more flexible APIs, to allow future
      honoring of additional flags.  Explicitly reject the
      VIR_DOMAIN_DEVICE_MODIFY_FORCE flag on attach/detach.
      
      Based on Eric Blake<eblake@redhat.com>'s work.
      
      * src/qemu/qemu_driver.c
      (qemudDomainAttachDevice)(qemudDomainAttachDeviceFlags): Swap bodies,rename...
      (qemudDomainDetachDevice, qemudDomainDetachDeviceFlags): Likewise.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2160116f
    • M
      Add support for s390(x) cpu options parsing · eb954ede
      Michal Privoznik 提交于
      Up to now we missed parser for cpuinfo on x390(x) machines. Those machines
      have only 1 thread, core, socket. What is missing is information about
      CPU frequency.
      eb954ede
    • D
      Fix QEMU tunnelled migration FD handling · 29fca785
      Daniel P. Berrange 提交于
      The two ends of the pipe used for feeding QEMU tunnelled
      migration data were interchanged, so QEMU got given the
      "write" end instead of the "read" end.
      
      The qemuMigrationPrepareTunnel method was also immediately
      closing the "write" end of the pipe, so the stream failed
      to actually write anything.
      
      * src/qemu/qemu_migration.c: Swap tunnelled migration
        pipe FDs & don't close pipe given to stream
      29fca785
  8. 21 4月, 2011 4 次提交
  9. 20 4月, 2011 2 次提交
  10. 19 4月, 2011 5 次提交
    • E
      virsh: nuke use of TRUE and FALSE · b56fa5bb
      Eric Blake 提交于
      Gnulib already guarantees <stdbool.h>, so it is easier to just
      use the standardized spellings.
      
      * tools/virsh.c (vshCmdDef): Change callback to return real bool.
      (__vshControl): Change several fields to bool.
      (vshCommandOptBool): Change return type.
      All callers updated.
      * tools/Makefile.am (virsh-net-edit.c, virsh-pool-edit.c):
      Likewise.
      b56fa5bb
    • W
      qemu: fix the check of virDomainObjUnref()'s return value · d2fd997e
      Wen Congyang 提交于
      If vm is unlocked in virDomainObjUnref(), the return value is 0, not less
      than 0.
      d2fd997e
    • M
      Add cputune support to libxl driver · 68c5b6fb
      Markus Groß 提交于
      Here is a new version of this patch:
      https://www.redhat.com/archives/libvir-list/2011-April/msg00337.html
      
      v2:
        - store the cputune info for the whole runtime of the domain
        - remove cputune info when domain is destroyed
      
      The nodeGetInfo code had to be moved into a helper
      function to reuse it without a virConnectPtr.
      68c5b6fb
    • M
      Update and sort msg_gen_function list and mark unmarked messages · 78ef49ea
      Matthias Bolte 提交于
      Inspired by Eric Blake
      78ef49ea
    • E
      phyp: another simplification · a35af32c
      Eric Blake 提交于
      Rather than copying and pasting lots of code, factor it into a
      single helper function.
      
      This commit adds a warning if tighter integer parsing would fail
      due to any stray bytes after the number, but should not change
      any behavior other than the bug fix for phypNumDomainsGeneric
      looking only at numeric lines.
      
      * src/phyp/phyp_driver.c (phypExecInt): New function.
      (phypGetVIOSPartitionID, phypNumDomainsGeneric, phypGetLparID)
      (phypGetLparMem, phypGetLparCPUGeneric, phypGetRemoteSlot)
      (phypGetVIOSNextSlotNumber, phypAttachDevice)
      (phypGetStoragePoolSize, phypStoragePoolNumOfVolumes)
      (phypNumOfStoragePools, phypInterfaceDestroy)
      (phypInterfaceDefineXML, phypInterfaceLookupByName)
      (phypInterfaceIsActive, phypNumOfInterfaces): Use it.
      (phypNumDomainsGeneric): Correctly find numeric line.
      a35af32c
  11. 18 4月, 2011 2 次提交
    • E
      maint: ignore built file · d80740b3
      Eric Blake 提交于
      * .gitignore: Add exemption for hashtest.
      d80740b3
    • D
      build: fix qemu build failure in previous patch · ce3ae1b0
      Daniel P. Berrange 提交于
      This last minute addition caused a build failure
      
      cc1: warnings being treated as errors
      qemu/qemu_process.c: In function 'qemuProcessHandleWatchdog':
      qemu/qemu_process.c:436:34: error: ignoring return value of 'virDomainObjUnref', declared with attribute warn_unused_result [-Wunused-result]
      make[3]: *** [libvirt_driver_qemu_la-qemu_process.lo] Error 1
      ce3ae1b0