1. 14 10月, 2013 1 次提交
  2. 11 10月, 2013 17 次提交
    • H
      nwfilter: fix a typo in nwfilter_gentech_driver.c · 3a49c34a
      Hongwei Bi 提交于
      s/occcurred/occurred
      3a49c34a
    • D
      rpc: Fix getsockopt on Snow Leopard and lower · 2f776d49
      Doug Goldstein 提交于
      Since 5a468b38 we use SOL_LOCAL for the 2nd argument of getsockopt()
      however Lion added the define SOL_LOCAL set to 0, which is the value to
      the 2nd argument of getsockopt() for Unix sockets on Mac OS X. So
      instead of using the define just pass 0 so we restore compatibility
      with Snow Leopard and Leopard.
      
      Reported at https://github.com/mxcl/homebrew/pull/23141
      2f776d49
    • D
      VMware: Do version detection earlier · fa23f9fc
      Doug Goldstein 提交于
      Do VMware version detection earlier as future patches will need the
      version information to populate capabilities correctly.
      fa23f9fc
    • D
      VMware: Simplify array walk for driver type · 9e7cfcb7
      Doug Goldstein 提交于
      Rather than walking the possible driver backends by handle, use a helper
      function. Additionally I've done a bit of refactoring in the code over
      the past few commits so add myself to the copyright line.
      9e7cfcb7
    • M
      qemu: Include listenAddress in debug prints · be651860
      Michal Privoznik 提交于
      After my patches, some functions gained one more argument
      (@listenAddress) which wasn't included in debug printing of
      arguments they were called with. Functions in question are:
      qemuMigrationPrepareDirect and qemuMigrationPerform.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      be651860
    • M
      qemu_migration: Avoid crashing if domain dies too quickly · c7ac2519
      Michal Privoznik 提交于
      I've noticed a SIGSEGV-ing libvirtd on the destination when the qemu
      died too quickly = in Prepare phase. What is happening here is:
      
      1) [Thread 3493] We are in qemuMigrationPrepareAny() and calling
      qemuProcessStart() which subsequently calls qemuProcessWaitForMonitor()
      and qemuConnectMonitor(). So far so good. The qemuMonitorOpen()
      succeeds, however switching monitor to QMP mode fails as qemu died
      meanwhile. That is qemuMonitorSetCapabilities() returns -1.
      
      2013-10-08 15:54:10.629+0000: 3493: debug : qemuMonitorSetCapabilities:1356 : mon=0x14a53da0
      2013-10-08 15:54:10.630+0000: 3493: debug : qemuMonitorJSONCommandWithFd:262 : Send command '{"execute":"qmp_capabilities","id":"libvirt-1"}' for write with FD -1
      2013-10-08 15:54:10.630+0000: 3493: debug : virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=17 events=13
      ...
      2013-10-08 15:54:10.631+0000: 3493: debug : qemuMonitorSend:956 : QEMU_MONITOR_SEND_MSG: mon=0x14a53da0 msg={"execute":"qmp_capabilities","id":"libvirt-1"}
       fd=-1
      2013-10-08 15:54:10.631+0000: 3262: debug : virEventPollRunOnce:641 : Poll got 1 event(s)
      
      2) [Thread 3262] The event loop is trying to do the talking to monitor.
      However, qemu is dead already, remember?
      
      2013-10-08 15:54:13.436+0000: 3262: error : qemuMonitorIORead:551 : Unable to read from monitor: Connection reset by peer
      2013-10-08 15:54:13.516+0000: 3262: debug : virFileClose:90 : Closed fd 25
      ...
      2013-10-08 15:54:13.533+0000: 3493: debug : qemuMonitorSend:968 : Send command resulted in error internal error: early end of file from monitor: possible problem:
      
      3) [Thread 3493] qemuProcessStart() failed. No big deal. Go to the
      'endjob' label and subsequently to the 'cleanup'. Since the domain is
      not persistent and ret is -1, the qemuDomainRemoveInactive() is called.
      This has an (unpleasant) effect of virObjectUnref()-in the @vm object.
      Unpleasant because the event loop which is about to trigger EOF callback
      still holds a pointer to the @vm (not the reference). See the valgrind
      output below.
      
      4) [Thread 3262] So the event loop starts triggering EOF:
      
      2013-10-08 15:54:13.542+0000: 3262: debug : qemuMonitorIO:729 : Triggering EOF callback
      2013-10-08 15:54:13.543+0000: 3262: debug : qemuProcessHandleMonitorEOF:294 : Received EOF on 0x14549110 'migt10'
      
      And the monitor is cleaned up. This results in calling
      qemuProcessHandleMonitorEOF with the @vm pointer passed. The pointer is
      kept in qemuMonitor struct.
      
      ==3262== Thread 1:
      ==3262== Invalid read of size 4
      ==3262==    at 0x77ECCAA: pthread_mutex_lock (in /lib64/libpthread-2.15.so)
      ==3262==    by 0x52FAA06: virMutexLock (virthreadpthread.c:85)
      ==3262==    by 0x52E3891: virObjectLock (virobject.c:320)
      ==3262==    by 0x11626743: qemuProcessHandleMonitorEOF (qemu_process.c:296)
      ==3262==    by 0x11642593: qemuMonitorIO (qemu_monitor.c:730)
      ==3262==    by 0x52BD526: virEventPollDispatchHandles (vireventpoll.c:501)
      ==3262==    by 0x52BDD49: virEventPollRunOnce (vireventpoll.c:648)
      ==3262==    by 0x52BBC68: virEventRunDefaultImpl (virevent.c:274)
      ==3262==    by 0x542D3D9: virNetServerRun (virnetserver.c:1112)
      ==3262==    by 0x11F368: main (libvirtd.c:1513)
      ==3262==  Address 0x14549128 is 24 bytes inside a block of size 136 free'd
      ==3262==    at 0x4C2AF5C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==3262==    by 0x529B1FF: virFree (viralloc.c:580)
      ==3262==    by 0x52E3703: virObjectUnref (virobject.c:270)
      ==3262==    by 0x531557E: virDomainObjListRemove (domain_conf.c:2355)
      ==3262==    by 0x1160E899: qemuDomainRemoveInactive (qemu_domain.c:2061)
      ==3262==    by 0x1163A0C6: qemuMigrationPrepareAny (qemu_migration.c:2450)
      ==3262==    by 0x1163A923: qemuMigrationPrepareDirect (qemu_migration.c:2626)
      ==3262==    by 0x11682D71: qemuDomainMigratePrepare3Params (qemu_driver.c:10309)
      ==3262==    by 0x53B0976: virDomainMigratePrepare3Params (libvirt.c:7266)
      ==3262==    by 0x1502D3: remoteDispatchDomainMigratePrepare3Params (remote.c:4797)
      ==3262==    by 0x12DECA: remoteDispatchDomainMigratePrepare3ParamsHelper (remote_dispatch.h:5741)
      ==3262==    by 0x54322EB: virNetServerProgramDispatchCall (virnetserverprogram.c:435)
      
      The mon->vm is set in qemuMonitorOpenInternal() which is the correct
      place to increase @vm ref counter. The correct place to decrease the ref
      counter is then qemuMonitorDispose().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c7ac2519
    • B
      util: fix two virCompareLimitUlong bugs · 19e7c04d
      Bing Bu Cao 提交于
      The helper function virCompareLimitUlong compares limit values,
      where value of 0 is equal to unlimited. If the latter parameter is 0,
      it should return -1 instead of 1, hence the user can only set hard_limit when
      swap_hard_limit currently is unlimited.
      
      Worse, all callers pass 2 64-bit values, but on 32-bit platforms,
      the second argument was silently truncated to 32 bits, which
      could lead to incorrect computations.
      Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      19e7c04d
    • D
      Move virNetDevVPort enum impl into virnetdevvportprofile.c · 1fb4d892
      Daniel P. Berrange 提交于
      The enum for virNetDevVPort is declared in the header file
      virnetdevvportprofile.h, but for some reason the impl is
      in netdev_vport_profile_conf.c.
      
      This causes a dep from src/util onto src/conf which is not
      allowed. Move the enum impl into virnetdevvportprofile.c
      to break the circle.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1fb4d892
    • M
      qemu_conf: Introduce "migration_address" · 1606d89c
      Michal Privoznik 提交于
      This configuration knob is there to override default listen address for
      -incoming for all qemu domains.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1606d89c
    • M
    • M
      virsocket: Introduce virSocketAddrIsWildcard · 1f9546e3
      Michal Privoznik 提交于
      This function takes exactly one argument: an address to check.
      It returns true, if the address is an IPv4 or IPv6 address in numeric
      format, false otherwise (e.g. for "examplehost").
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1f9546e3
    • M
      Migration: Introduce VIR_MIGRATE_PARAM_LISTEN_ADDRESS · 72aafe9c
      Michal Privoznik 提交于
      The parameter allows overriding default listen address for '-incoming'
      cmd line argument on destination.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      72aafe9c
    • M
      qemu: Introduce qemuDomainDefCheckABIStability · 7d704812
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=994364
      
      Whenever we check for ABI stability, we have new xml (e.g. provided by
      user, or obtained from snapshot, whatever) which we compare to old xml
      and see if ABI won't break. However, if the new xml was produced via
      virDomainGetXMLDesc(..., VIR_DOMAIN_XML_MIGRATABLE) it lacks some
      devices, e.g. 'pci-root' controller. Hence, the ABI stability check
      fails even though it is stable. Moreover, we can't simply fix
      virDomainDefCheckABIStability because removing the correct devices is
      task for the driver. For instance, qemu driver wants to remove the usb
      controller too, while LXC driver doesn't. That's why we need special
      qemu wrapper over virDomainDefCheckABIStability which removes the
      correct devices from domain XML, produces MIGRATABLE xml and calls the
      check ABI stability function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7d704812
    • M
      c643b64e
    • M
      370a7a79
    • M
      ec7005d3
    • M
      qemumonitorjsontest: Extend the test for yet another monitor commands · fbc3adc9
      Michal Privoznik 提交于
      So far, we're unit testing some basic functions and some (so called)
      simple functions (e.g. "qmp_capabilities", "system_powerdown"). However,
      there are more functions which expect simple "{'return': {}}" reply, but
      takes more args to construct the command (for instance "set_link"). This
      patch aims on such functions.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      fbc3adc9
  3. 10 10月, 2013 7 次提交
    • J
      storage_backend: Fix issue with allocation of 0 length volume · 77fb4c4f
      John Ferlan 提交于
      Commit id '532fef36' added a call to fallocate() and some error
      handling based on whether or not the function existed. This new
      call resulted in libvirt-cim/cimtest failures when attempting to
      create a volume with "0" (zero) allocation value. The failure is
      logged as:
      
      Oct  9 07:51:33 localhost libvirtd[8030]: cannot allocate 0 bytes in
      file '/var/lib/libvirt/images/cimtest-vol.img': Invalid argument
      
      This can also be seen with virsh vol-create-as:
      
      error: Failed to create vol test
      error: cannot allocate 0 bytes in file '/home/vm-images/test': Invalid
      argument
      
      error: Failed to create vol test
      error: cannot allocate 0 bytes in file '/home/vm-images/test': Invalid
      argument
      
      It turns out fallocate() will return EINVAL when the incoming 'len'
      (or allocation) value is 0 (or less).
      77fb4c4f
    • M
      qemu: Init @pcidevs in qemuPrepareHostdevPCIDevices · 9c228e08
      Michal Privoznik 提交于
      At the beginning of the function qemuPrepareHostdevPCICheckSupport() is
      called. After that @pcidevs is initialized. However, if the very first
      command fails, we go to 'cleanup' label where virObjectUnref(pcidevs) is
      called. Obviously, it is called before @pcidevs was able to get
      initialized. Compiler warns about it:
      
        CC       qemu/libvirt_driver_qemu_impl_la-qemu_hostdev.lo
      qemu/qemu_hostdev.c: In function 'qemuPrepareHostdevPCIDevices':
      qemu/qemu_hostdev.c:824:19: error: 'pcidevs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
           virObjectUnref(pcidevs);
                         ^
      cc1: all warnings being treated as errors
      9c228e08
    • P
      qemu: Prefer VFIO for PCI device passthrough · f094aaac
      Peter Krempa 提交于
      Prefer using VFIO (if available) to the legacy KVM device passthrough.
      
      With this patch a PCI passthrough device without the driver configured
      will be started with VFIO if it's available on the host. If not legacy
      KVM passthrough is checked and error is reported if it's not available.
      f094aaac
    • P
      qemu: hostdev: Add checks if PCI passthrough is available in the host · 467b561a
      Peter Krempa 提交于
      Add code to check availability of PCI passhthrough using VFIO and the
      legacy KVM passthrough and use it when starting VMs and hotplugging
      devices to live machine.
      467b561a
    • P
      f24150b1
    • P
      qemu: refactor qemuCompressProgramAvailable() · a863b890
      Peter Krempa 提交于
      a863b890
    • P
      qemu: Fix coding style in qemuDomainSaveFlags() · f2b0a533
      Peter Krempa 提交于
      Avoid mixed brace style in an if statement and fix formatting of error
      messages.
      f2b0a533
  4. 09 10月, 2013 5 次提交
    • J
      LXC: Fix handling of RAM filesystem size units · 3f029fb5
      Ján Tomko 提交于
      Since 76b644c3 when the support for RAM filesystems was introduced,
      libvirt accepted the following XML:
      <source usage='1024' unit='KiB'/>
      
      This was parsed correctly and internally stored in bytes, but it
      was formatted as (with an extra 's'):
      <source usage='1024' units='KiB'/>
      When read again, this was treated as if the units were missing,
      meaning libvirt was unable to parse its own XML correctly.
      
      The usage attribute was documented as being in KiB, but it was not
      scaled if the unit was missing. Transient domains still worked,
      because this was balanced by an extra 'k' in the mount options.
      
      This patch:
      Changes the parser to use 'units' instead of 'unit', as the latter
      was never documented (fixing persistent domains) and some programs
      (libvirt-glib, libvirt-sandbox) already parse the 'units' attribute.
      
      Removes the extra 'k' from the tmpfs mount options, which is needed
      because now we parse our own XML correctly.
      
      Changes the default input unit to KiB to match documentation, fixing:
      https://bugzilla.redhat.com/show_bug.cgi?id=1015689
      3f029fb5
    • C
      cgroup: fix a comment typo in vircgroup.c · fc9a416d
      Chen Hanxiao 提交于
      s/shoule/should
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      fc9a416d
    • J
      storage: Use bool instead of int · 63b6e59f
      Ján Tomko 提交于
      Commit 532fef36 added two-state 'need_alloc' and exposed
      'want_sparse' which also only has two states.
      
      Change their type from int to bool.
      63b6e59f
    • C
      tests: Add qemu test for multiple timers · 039eb532
      Cole Robinson 提交于
      The following XML is the recommended default clock configuration for
      qemu:
      
        <clock offset='utc'>
          <timer name='rtc' tickpolicy='catchup'/>
          <timer name='pit' tickpolicy='delay'/>
          <timer name='hpet' present='no'/>
        </clock>
      
      However we weren't testing any of those timer elements.
      039eb532
    • G
      build: fix linker error on FreeBSD · a90b9778
      Giuseppe Scrivano 提交于
      Commit 2d74822a renamed
      "freebsdNodeGetCPUCount" to "appleFreebsdNodeGetCPUCount", leaving one
      call to "freebsdNodeGetCPUCount".  Fix this other case.
      Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a90b9778
  5. 08 10月, 2013 6 次提交
  6. 07 10月, 2013 4 次提交
    • G
    • E
      build: add configure --without-readline · e5f46105
      Eric Blake 提交于
      Make it much easier to test a configuration built without readline
      support, by reusing our existing library probe machinery.  It gets
      a bit tricky with readline, which does not provide a pkg-config
      snippet, and which on some platforms requires one of several
      terminal libraries as a prerequiste, but the end result should be
      the same default behavior but now with the option to disable things.
      
      * m4/virt-readline.m4 (LIBVIRT_CHECK_READLINE): Simplify by using
      LIBVIRT_CHECK_LIB.
      * tools/virsh.c: Convert USE_READLINE to WITH_READLINE.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e5f46105
    • E
      build: move readline check into its own macro · d6eac3f3
      Eric Blake 提交于
      A future patch will allow disabling readline; doing this in an
      isolated file instead of configure.ac will make the task easier.
      
      * configure.ac: Move readline code...
      * m4/virt-readline.m4: ...here.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d6eac3f3
    • E
      build: kill maintainer mode, always rebuild by default · 3fde7ad8
      Eric Blake 提交于
      The automake manual recommends against the use of disabling
      maintainer mode by default:
      
      https://www.gnu.org/software/automake/manual/automake.html#maintainer_002dmode
      
      because when it is disabled, the user gets no indication if they
      touch a file that would normally require a rebuild.  Automake
      1.11 changed things so that AM_MAINTAINER_MODE([enable]) will set
      the mode to enabled by default; but RHEL 5 still uses automake 1.9,
      where AM_MAINTAINER_MODE did not recognize an argument, and
      therefore disables maintainer mode by default.  Having the default
      be different according to which version of automake built the
      project is annoying, and I _have_ been bitten on RHEL 5 rebuilds
      where the default disabled mode led to silently incorrect builds.
      
      The automake manual admits that being able to disable maintainer
      mode still makes sense for projects that still store generated
      files from the autotools in version control; but we have dropped
      that for several years now.  As such, it's finally time to just
      ditch the whole idea of maintainer mode, and unconditionally
      rebuild autotools files if a dependency changes, without offering
      a configure option to disable that mode.
      
      * configure.ac (AM_MAINTAINER_MODE): Drop.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3fde7ad8