1. 21 6月, 2013 3 次提交
    • J
      storage: add support for creating qcow2 images with extensions · 6298f74d
      Ján Tomko 提交于
      Add -o compat= and -o lazy_refcounts options for qemu-img.
      6298f74d
    • J
      conf: add features to volume target XML · 31d42506
      Ján Tomko 提交于
      Add <features> and <compat> elements to volume target XML.
      
      <compat> is a string which for qcow2 represents the QEMU version
      it should be compatible with. Valid values are 0.10 and 1.1.
      1.1 is implicit if the <features> element is present, otherwise
      qemu-img default is used. 0.10 can be specified to explicitly
      create older images after the qemu-img default changes.
      
      <features> contains optional features, so far
      <lazy_refcounts/> is available, which enables caching of reference
      counters, improving performance for snapshots.
      31d42506
    • J
      qemu: add hv_vapic and hv_spinlocks support · 19f75d5e
      Ján Tomko 提交于
      XML:
      <features>
        <hyperv>
          <vapic state='on'/>
          <spinlocks state='on' retries='4096'/>
        </hyperv>
      </features>
      
      results in the following QEMU command line:
      qemu -cpu <cpu_model>,hv_vapic,hv_spinlocks=0x1000
      
      https://bugzilla.redhat.com/show_bug.cgi?id=784836
      19f75d5e
  2. 19 6月, 2013 1 次提交
    • J
      util: switch virBufferTrim to void · d0d0413e
      Ján Tomko 提交于
      We don't care whether the trim was succesful or not anywhere
      except the tests.
      
      Switch it to void and set the buffer error on wrong usage.
      d0d0413e
  3. 11 6月, 2013 1 次提交
  4. 07 6月, 2013 1 次提交
  5. 06 6月, 2013 3 次提交
    • J
      qemu: change two-state int parameters to bool · 5debc722
      Ján Tomko 提交于
      5debc722
    • J
      Replace two-state local integers with bool · e557766c
      Ján Tomko 提交于
      Found with 'git grep "= 1"'.
      e557766c
    • M
      qemu: Reformat listen address prior to checking · e5fa9db1
      Michal Privoznik 提交于
      Currently, a listen address for a SPICE server can be specified. Later,
      when the domain is migrated, we need to relocate the graphics which
      involves telling new destination to the SPICE server. However, we can't
      just assume the listen address is the new location, because the listen
      address can be ANYCAST (0.0.0.0 for IPv4, :: for IPv6). In which case,
      we want to pass the remote hostname. But there are some troubles with
      ANYCAST. In both IPv4 and IPv6 it has many ways for specifying such
      address. For instance, in IPv4: 0, 0.0, 0.0.0, 0.0.0.0.  The number of
      variations gets bigger in IPv6 world. Hence, in order to check for
      ANYCAST address sanely, we should take the provided listen address,
      parse it and format back in it's full form. Which is exactly what this
      patch does.
      e5fa9db1
  6. 05 6月, 2013 1 次提交
  7. 04 6月, 2013 1 次提交
  8. 03 6月, 2013 1 次提交
  9. 01 6月, 2013 3 次提交
    • O
      conf: Generate address for scsi host device automatically · cdb97895
      Osier Yang 提交于
      With unknown good reasons, the attribute "bus" of scsi device
      address is always set to 0, same for attribute "target". (See
      virDomainDiskDefAssignAddress).
      
      Though we might need to change the algorithm to honor "bus"
      and "target" too, that's a different issue. The address generator
      for scsi host device in this patch just follows the unknown
      good reasons, only considering the "controller" and "unit".
      It walks through all scsi controllers and their units, to see
      if the address $controller:0:0:$unit can be used (if not used
      by any disk or scsi host device yet), if found one, it sits on
      it, otherwise, it creates a new controller (actually the controller
      is implicitly created by someone else), and sits on
      $new_controller:0:0:0 instead.
      cdb97895
    • E
      build: skip qemu in tests when !WITH_QEMU · 3d2b9715
      Eric Blake 提交于
      A mingw build (where the qemu driver is not built, so WITH_QEMU
      is undefined) failed with:
      
      In file included from ../../src/qemu/qemu_command.h:30:0,
                       from ../../tests/testutilsqemu.h:4,
                       from ../../tests/networkxml2xmltest.c:14:
      ../../src/qemu/qemu_conf.h:53:4: error: #error "Port me"
      
      But since testutilsqemu.c is already conditional, the header
      should be likewise.
      
      * tests/testutilsqemu.h: Make content conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3d2b9715
    • D
      Introduce virFilePrintf() as a portable fprintf() · a2619962
      Daniel P. Berrange 提交于
      We can't use GNULIB's fprintf-posix due to licensing
      incompatibilities. We do already have a portable
      formatting via virAsprintf() which we got from GNULIB
      though. We can use to create a virFilePrintf() function.
      
      But really gnulib could just provide a 'fprintf'
      module, that depended on just its 'asprintf' module.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a2619962
  10. 24 5月, 2013 2 次提交
    • M
      virStrndup: Accept negative values as string length · c9357196
      Michal Privoznik 提交于
      It may shorten the code a bit as the following pattern:
      
        VIR_STRNDUP(dst, src, cond ? n : strlen(src))
      
      is used on several places among our code. However, we can
      move the strlen into virStrndup and thus write just:
      
        VIR_STRNDUP(dst, src, cond ? n : -1)
      c9357196
    • V
      cgroups: Do not enforce nonexistent controllers · eb21408f
      Viktor Mihajlovski 提交于
      Currently, the controllers argument to virCgroupDetect acts both as
      a result filter and a required controller specification, which is
      a bit overloaded. If both functionalities are needed, it would be
      better to have them seperated into a filter and a requirement mask.
      The only situation where it is used today is to ensure that only
      CPU related controllers are used for the VCPU directories. But here
      we clearly do not want to enforce the existence of cpu, cpuacct and
      specifically not cpuset at the same time.
      This commit changes the semantics of controllers to "filter only".
      Should a required mask ever be needed, more work will have to be done.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      eb21408f
  11. 22 5月, 2013 3 次提交
  12. 21 5月, 2013 4 次提交
    • O
      tests/: Remove the whitespace before ";" · bb3ea841
      Osier Yang 提交于
      bb3ea841
    • J
      shunloadtest: Resolve Coverity CHECKED_RETURN error · 995bf76d
      John Ferlan 提交于
      The shunloadStart function didn't check the status of virInitialize which
      was flagged by Coverity.  Adjust the function and shunloadtest in order
      to handle the situation.
      995bf76d
    • J
      xencapstest: Resolve Coverity CHECKED_RETURN error · 01757a46
      John Ferlan 提交于
      The return from virInitialize() needs to be checked.
      01757a46
    • E
      maint: use LGPL correctly · d7f53c7b
      Eric Blake 提交于
      Several files called out COPYING or COPYING.LIB instead of using
      the normal boilerplate.  It's especially important that we don't
      call out COPYING from an LGPL file, since COPYING is traditionally
      used for the GPL.  A few files were lacking copyright altogether.
      
      * src/rpc/gendispatch.pl: Add missing copyright.
      * Makefile.nonreentrant: Likewise.
      * src/check-symfile.pl: Likewise.
      * src/check-symsorting.pl: Likewise.
      * src/driver.h: Likewise.
      * src/internal.h: Likewise.
      * tools/libvirt-guests.sh.in: Likewise.
      * tools/virt-pki-validate.in: Mention copyright in comment, not just code.
      * tools/virt-sanlock-cleanup.in: Likewise.
      * src/rpc/genprotocol.pl: Spell out license terms.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * Makefile.am: Likewise.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * docs/schemas/Makefile.am: Likewise.
      * examples/apparmor/Makefile.am: Likewise.
      * examples/domain-events/events-c/Makefile.am: Likewise.
      * examples/dominfo/Makefile.am: Likewise.
      * examples/domsuspend/Makefile.am: Likewise.
      * examples/hellolibvirt/Makefile.am: Likewise.
      * examples/openauth/Makefile.am: Likewise.
      * examples/python/Makefile.am: Likewise.
      * examples/systemtap/Makefile.am: Likewise.
      * examples/xml/nwfilter/Makefile.am: Likewise.
      * gnulib/lib/Makefile.am: Likewise.
      * gnulib/tests/Makefile.am: Likewise.
      * include/Makefile.am: Likewise.
      * include/libvirt/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * python/tests/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      * configure.ac: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d7f53c7b
  13. 20 5月, 2013 1 次提交
    • O
      qemu: Add callback struct for qemuBuildCommandLine · 3a6204cb
      Osier Yang 提交于
      Since 0d70656a, it starts to access the sysfs files to build
      the qemu command line (by virSCSIDeviceGetSgName, which is to find
      out the scsi generic device name by adpater:bus:target:unit), there
      is no way to work around, qemu wants to see the scsi generic device
      like "/dev/sg6" anyway.
      
      And there might be other places which need to access sysfs files
      when building qemu command line in future.
      
      Instead of increasing the arguments of qemuBuildCommandLine, this
      introduces a new callback for qemuBuildCommandLine, and thus tests
      can register their own callbacks for sysfs test input files accessing.
      
      * src/qemu/qemu_command.h: (New callback struct
                                  qemuBuildCommandLineCallbacks;
                                  extern buildCommandLineCallbacks)
      * src/qemu/qemu_command.c: (wire up the callback struct)
      * src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
      * src/qemu/qemu_hotplug.c: Likewise
      * src/qemu/qemu_process.c: Likewise
      * tests/testutilsqemu.[ch]: (Helper testSCSIDeviceGetSgName;
                                   callback struct testCallbacks;)
      * tests/qemuxml2argvtest.c: (Use testCallbacks)
      * src/tests/qemuxmlnstest.c: (Like above)
      3a6204cb
  14. 17 5月, 2013 6 次提交
  15. 16 5月, 2013 5 次提交
    • O
      conf: Introduce <shareable> for hostdev · f2c1d9a8
      Osier Yang 提交于
      Unlike disk device, the scsi-generic always writethrough the data,
      so no need to introduce a "cache" tag, and set "cache=off".
      f2c1d9a8
    • O
      conf: Fix the bug of disk->copy_on_read formating · e3b40bec
      Osier Yang 提交于
      The reason for it's not exposed for such long time is that the
      enums for VirtioEventIdx and CopyOnReadType have same enum values
      and Correspondingstrings. This fixes the bug and adds test.
      e3b40bec
    • E
      string: test VIR_STRDUP · 504b4a8d
      Eric Blake 提交于
      The surest way to avoid regressions is to test documented behavior :)
      
      * tests/virstringtest.c (testStrdup): New test case.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      504b4a8d
    • J
      Adjust improperly formatted <sysinfo> uuid · a2c37618
      John Ferlan 提交于
      If the <sysinfo> system table 'uuid' field is improperly formatted,
      then qemu will fail to start the guest with the error:
      
      virsh start dom
      error: Failed to start domain dom
      error: internal error process exited while connecting to monitor: Invalid SMBIOS UUID string
      
      This was because the parsing rules were lax with respect to allowing extraneous
      spaces and dashes in the provided UUID.  As long as there were 32 hexavalues
      that matched the UUID for the domain the string was accepted. However startup
      failed because the string format wasn't correct. This patch will adjust the
      string format so that when it's presented to the driver it's in the expected
      format.
      
      Added a test for uuid comparison within sysinfo.
      a2c37618
    • J
      Validate the bios_date format for <sysinfo> · 21540f5e
      John Ferlan 提交于
      Add incorrectly formatted bios_date validation test
      21540f5e
  16. 15 5月, 2013 4 次提交
    • O
      qemu: Support discard for disk · a7c4202c
      Osier Yang 提交于
      QEMU introduced "discard" option for drive since commit a9384aff53,
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      
      This patch exposes the support in libvirt.
      
      QEMU supported "discard" for "-drive" since v1.5.0-rc0:
      
      % git tag --contains a9384aff53
      contains
      v1.5.0-rc0
      v1.5.0-rc1
      
      So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
      a7c4202c
    • M
      qemu: Add VNC WebSocket support · 85ec7ff6
      Martin Kletzander 提交于
      Adding a VNC WebSocket support for QEMU driver.  This functionality is
      in upstream qemu from commit described as v1.3.0-982-g7536ee4, so the
      capability is being recognized based on QEMU version for now.
      85ec7ff6
    • O
      tests: Sort the EXTRA_DIST list · 5606c7a8
      Osier Yang 提交于
      Commit 1cc8259b fixes the build failure, but forgot to keep the
      list alphanumeric sorted.
      5606c7a8
    • O
      qemu: New XML to disable memory merge at guest startup · 77b54b96
      Osier Yang 提交于
      QEMU introduced command line "-mem-merge=on|off" (defaults to on) to
      enable/disable the memory merge (KSM) at guest startup. This exposes
      it by new XML:
        <memoryBacking>
          <nosharepages/>
        </memoryBacking>
      
      The XML tag is same with what we used internally for old RHEL.
      77b54b96