1. 09 3月, 2013 2 次提交
    • D
      capabilities: add NUMA memory information · d3092c60
      Dusty Mabe 提交于
      'virsh capabilities' will now include a new <memory> element
      per <cell> of the topology, as in:
      
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>12572412</memory>
                <cpus num='12'>
                ...
              </cell>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d3092c60
    • G
      lxc: include sys/stat.h · c8871d8f
      Guido Günther 提交于
      This fixes the build on Debian Wheezy which otherwise fails with:
      
        CC     libvirt_driver_lxc_impl_la-lxc_process.lo
        lxc/lxc_process.c: In function 'virLXCProcessGetNsInode':
        lxc/lxc_process.c:648:5: error: implicit declaration of function 'stat' [-Werror=implicit-function-declaration]
        lxc/lxc_process.c:648:5: error: nested extern declaration of 'stat' [-Werror=nested-externs]
        cc1: all warnings being treated as errors
      c8871d8f
  2. 08 3月, 2013 14 次提交
  3. 07 3月, 2013 4 次提交
    • E
      viralloc: use consistent naming · 2e6322a7
      Eric Blake 提交于
      Commit 0df3e896 only touched the header, but the .c file had the
      same shadowing potential.
      
      * src/util/viralloc.c (virDeleteElementsN): s/remove/toremove/ to
      match the header.
      2e6322a7
    • E
      build: avoid shadowing a function name · 0df3e896
      Eric Blake 提交于
      Make the same fix as in commit de53effe.
      
      * src/util/viralloc.h (virDeleteElementsN): Cater to old glibc.
      0df3e896
    • D
      Fix crash parsing RNG device specification · 75e656a3
      Daniel P. Berrange 提交于
      Code that validates the whitelist for the RNG device filename
      didn't account for fact that filename may be NULL. This led
      to a NULL reference crash. This wasn't caught since the test
      suite was not covering this XML syntax
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      75e656a3
    • J
      Resolve valgrind error · 1cf4ef1f
      John Ferlan 提交于
      Resolves the following valgrind error from qemuxml2argvtest:
      
      ==20393== 5 bytes in 1 blocks are definitely lost in loss record 2 of 60
      ==20393==    at 0x4A0883C: malloc (vg_replace_malloc.c:270)
      ==20393==    by 0x38D690A167: __vasprintf_chk (in /usr/lib64/libc-2.16.so)
      ==20393==    by 0x4CB0D97: virVasprintf (stdio2.h:210)
      ==20393==    by 0x4CB0E53: virAsprintf (virutil.c:2017)
      ==20393==    by 0x428DC5: qemuAssignDeviceAliases (qemu_command.c:791)
      ==20393==    by 0x41DF93: testCompareXMLToArgvHelper (qemuxml2argvtest.c:151)
      ==20393==    by 0x41F53F: virtTestRun (testutils.c:157)
      ==20393==    by 0x41DA9B: mymain (qemuxml2argvtest.c:885)
      ==20393==    by 0x41FB7A: virtTestMain (testutils.c:719)
      ==20393==    by 0x38D6821A04: (below main) (in /usr/lib64/libc-2.16.so)
      ==20393==
      
      From qemu_command.c/line 791:
      
          if (def->rng) {
              if (virAsprintf(&def->rng->info.alias, "rng%d", 0) < 0)
                  goto no_memory;
          }
      1cf4ef1f
  4. 06 3月, 2013 6 次提交
    • J
      storage: Cleanup logical volume creation code · 4b0cb4a7
      Jiri Denemark 提交于
      This patch plugs two memory leaks, removes some useless and confusing
      constructs and renames renames "cleanup" label as "error" since it is
      only used for error path rather then being common for both success and
      error paths.
      4b0cb4a7
    • J
      sheepdog: Adjust logic to break while loop to avoid Coverity error · 80e524de
      John Ferlan 提交于
      Change the various "return -1" to "break".  Avoids Coverity error and
      perhaps other/future analyzer issues.
      80e524de
    • J
      libxl_driver: Resolve Coverity errors · 40e90449
      John Ferlan 提交于
      1. The virObjectLock() call was unconditional, but Unlock was conditional
         on vm being valid.  Removed the check
      
      2. A call to virDomainEventNewFromObj() isn't guaranteed to return an
         event - that check needs to be made prior to libxlDomainEventQueue()
         of the event. Did not add libxlDriverLock/Unlock around the call since
         some callers already have lock taken
      
      3. Need to initialize fd = -1 in libxlDoDomainSave() since we can jump
         to cleanup before it's set.
      
      4. Missing break;'s in libxlDomainModifyDeviceFlags() for case
         LIBXL_DEVICE_UPDATE.  The default: case would report an error
      40e90449
    • J
      50de0e08
    • G
      qemu: update domain live xml for virsh memtune with --live flag · 0047d5d6
      Guannan Ren 提交于
      virsh subcommand memtune forgot updating domain live xml
      after setting cgroup value.
      0047d5d6
    • G
      util: fix a integer boundary error · b38a040a
      Guannan Ren 提交于
      A value which is equal to a integer maximum such as LLONG_MAX is
      a valid integer value.
      
      The patch fix the following error:
      1, virsh memtune vm --swap-hard-limit -1
      2, virsh start vm
      In debug mode, it shows error like:
      virScaleInteger:1813 : numerical overflow:\
                             value too large: 9007199254740991KiB
      b38a040a
  5. 05 3月, 2013 6 次提交
    • P
      conf: Report errors on cputune parameter parsing · 7fc4864a
      Peter Krempa 提交于
      This patch adds proper error reporting if parsing of cputune parameters
      fails due to incorrect values provided by the user. Previously no errors
      were reported in such a case and the failure was silently ignored.
      7fc4864a
    • P
      conf: Make virDomainDeviceInfoIterate usable without os type · 5d9169e4
      Peter Krempa 提交于
      Make the iterator function usable in the next patches. Also refactor
      some parts to avoid strcmp if not necessary.
      
      This commit tweaks and shadows the change that was done in commit
      babe7dad and was needed after the
      support for multiple console devices was added. Historically the first
      <console> element is alias for the <serial> device.
      5d9169e4
    • P
      conf: whitespace cleanups and refactors with no semantic impact · bb98ba5d
      Peter Krempa 提交于
      This patch changes many unrelated places to simplify the code or update
      code style. This patch should not have any semantic impact on the code.
      bb98ba5d
    • E
      rng: restrict passthrough names to known-good files · 4932ef45
      Eric Blake 提交于
      There is some controversy[1] on the qemu list on whether qemu should
      have ever allowed arbitrary file name passthrough, or whether it
      should be restricted to JUST /dev/random and /dev/hwrng.  It is
      always easier to add support for additional filenames than it is
      to remove support for something once released, so this patch
      restricts libvirt 1.0.3 (where the virtio-random backend was first
      supported) to just the two uncontroversial names, letting us defer
      to a later date any decision on whether supporting arbitrary files
      makes sense. Additionally, since qemu 1.4 does NOT support
      /dev/fdset/nnn fd passthrough for the backend, limiting to just
      two known names means that we don't get tempted to try fd
      passthrough where it won't work.
      
      [1]https://lists.gnu.org/archive/html/qemu-devel/2013-03/threads.html#00023
      
      * src/conf/domain_conf.c (virDomainRNGDefParseXML): Only allow
      /dev/random and /dev/hwrng.
      * docs/schemas/domaincommon.rng: Flag invalid files.
      * docs/formatdomain.html.in (elementsRng): Document this.
      * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args:
      Update test to match.
      * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml:
      Likewise.
      4932ef45
    • J
      libvirt: Update headers for doc · f7e74294
      John Ferlan 提交于
      Update the function prototypes to include a message about the client needing
      to free() returned name fields.  Fix the all domains example flags values.
      f7e74294
    • S
      qemu: fix wrong evaluation in qemuDomainSetMemoryParameters · 464ad16f
      Satoru Moriya 提交于
      19c6ad9a (qemu: Refactor qemuDomainSetMemoryParameters) introduced
      a new macro, VIR_GET_LIMIT_PARAMETER(PARAM, VALUE). But if statement
      in the macro is not correct and so set_XXXX flags are set to false
      in the wrong. As a result, libvirt ignores all memtune parameters.
      This patch fixes the conditional expression to work correctly.
      Signed-off-by: NSatoru Moriya <satoru.moriya@hds.com>
      464ad16f
  6. 04 3月, 2013 3 次提交
    • G
      util: use string libvirt to prefix error message instead of libvir · b95c13cd
      Guannan Ren 提交于
      BZ:https://bugzilla.redhat.com/show_bug.cgi?id=912021
      Without error handler set, virDefaultErrorFunc will be called, the
      error message is prefixed with "libvir:". It become a little better
      by using prefix "libvirt:" when working with upper application.
      
      For example:
      1, stop libvirtd daemon
      2, run virt-top.
      libvir: XML-RPC error : Failed to connect \
              socket to '/var/run/libvirt/libvirt-sock-ro': \
              No such file or directory
      libvirt: VIR_ERR_SYSTEM_ERROR: VIR_FROM_RPC: \
              Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': \
              No such file or directory
      b95c13cd
    • P
      qemu: Remove managed save flag from VM when starting with --force-boot · 9933a6b2
      Peter Krempa 提交于
      At the start of the guest after the image is unlinked the state wasn't
      touched up to match the state on disk.
      9933a6b2
    • C
      qemu: Use -1 as unpriviledged uid/gid · aff6942c
      Christophe Fergeau 提交于
      Commit f506a4c1 changed virSetUIDGID() to be a noop
      when uid/gid are -1, while it used to be a noop when
      they are <= 0.
      
      The changes in this commit broke creating new VMs in GNOME Boxes
      as qemuDomainCheckDiskPresence gets called during domain creation/startup,
      which in turn calls virFileAccessibleAs which fails after calling
      virSetUIDGID(0, 0) (Boxes uses session libvirtd). virSetUIDGID is called with
      (0, 0) as these are the default user/group values in virQEMUDriverConfig
      for session libvirtd.
      
      This commit changes virQEMUDriverConfigNew to use -1 as the unpriviledged
      uid/gid. I've also looked at the various places where cfg->user is used,
      and they all seem to handle -1 correctly.
      aff6942c
  7. 01 3月, 2013 5 次提交
    • M
      virnetdevmacvlan.c: Introduce mutex for macvlan creation · 1cf97c87
      Michal Privoznik 提交于
      Currently, after we removed the qemu driver lock, it may happen
      that two or more threads will start up a machine with macvlan and
      race over virNetDevMacVLanCreateWithVPortProfile(). However,
      there's a racy section in which we are generating a sequence of
      possible device names and detecting if they exits. If we found
      one which doesn't we try to create a device with that name.
      However, the other thread is doing just the same. Assume it will
      succeed and we must therefore fail. If this happens more than 5
      times (which in massive parallel startup surely will) we return
      -1 without any error reported. This patch is a simple hack to
      both of these problems. It introduces a mutex, so only one thread
      will enter the section, and if it runs out of possibilities,
      error is reported. Moreover, the number of retries is raised to 20.
      1cf97c87
    • D
      Revert hack for autodestroy in qemuProcessStop · 9c4ecb3e
      Daniel P. Berrange 提交于
      This reverts the hack done in
      
      commit 568a6cda
      Author: Jiri Denemark <jdenemar@redhat.com>
      Date:   Fri Feb 15 15:11:47 2013 +0100
      
          qemu: Avoid deadlock in autodestroy
      
      since we now have a fix which avoids the deadlock scenario
      entirely
      9c4ecb3e
    • D
      Fix deadlock in QEMU close callback APIs · 96b893f0
      Daniel P. Berrange 提交于
      There is a lock ordering problem in the QEMU close callback
      APIs.
      
      When starting a guest we have a lock on the VM. We then
      set a autodestroy callback, which acquires a lock on the
      close callbacks.
      
      When running auto-destroy, we obtain a lock on the close
      callbacks, then run each callbacks - which obtains a lock
      on the VM.
      
      This causes deadlock if anyone tries to start a VM, while
      autodestroy is taking place.
      
      The fix is to do autodestroy in 2 phases. First obtain
      all the callbacks and remove them from the list under
      the close callback lock. Then invoke each callback
      from outside the close callback lock.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      96b893f0
    • D
      Fix crash in QEMU auto-destroy with transient guests · 7ccad0b1
      Daniel P. Berrange 提交于
      When the auto-destroy callback runs it is supposed to return
      NULL if the virDomainObjPtr is no longer valid. It was not
      doing this for transient guests, so we tried to virObjectUnlock
      a mutex which had been freed. This often led to a crash.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7ccad0b1
    • J
      qemu: Make sure qemuProcessStart is run within a job · e4e28220
      Jiri Denemark 提交于
      qemuProcessStart expects to be run with a job already set and every
      caller except for qemuMigrationPrepareAny use it correctly. This bug can
      be observed in libvirtd logs during incoming migration as
      
          warning : qemuDomainObjEnterMonitorInternal:979 : This thread seems
          to be the async job owner; entering monitor without asking for a
          nested job is dangerous
      e4e28220