1. 22 2月, 2011 14 次提交
    • M
      Renamed functions in xenxs · 3e53c7f9
      Markus Groß 提交于
      3e53c7f9
    • M
      Moved XM formatting functions to xenxs · 2e69e66e
      Markus Groß 提交于
      2e69e66e
    • M
      Moved XM parsing functions to xenxs · 1556ced2
      Markus Groß 提交于
      1556ced2
    • M
      Moved SEXPR formatting functions to xenxs · 2f2a88b9
      Markus Groß 提交于
      2f2a88b9
    • M
      Moved SEXPR parsing functions to xenxs · 07129039
      Markus Groß 提交于
      07129039
    • M
      Moved some SEXPR functions from xen-unified · c71328b9
      Markus Groß 提交于
      c71328b9
    • M
      Moved SEXPR unit to utils · 8606ca0d
      Markus Groß 提交于
      8606ca0d
    • W
      protect the scsi controller to be deleted when it is in use · cf61114c
      Wen Congyang 提交于
      Steps to reproduce this bug:
      1. virsh attach-disk domain --source imagefile --target sdb --sourcetype file --driver qemu --subdriver raw
      2. virsh detach-device controller.xml # remove scsi controller 0
      3. virsh detach-disk domain sdb
         error: Failed to detach disk
         error: operation failed: detaching scsi0-0-1 device failed: Device 'scsi0-0-1' not found
      
      I think we should not detach a controller when it is used by some other device.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      cf61114c
    • E
      maint: fix grammar in error message · f409661e
      Eric Blake 提交于
      * python/tests/create.py: Use correct wording.
      f409661e
    • D
      virt-*-validate.in: quote all variable references · b3ff07a0
      Dan Kenigsberg 提交于
      Alas, the shell is not a real programming language.
      
      Patch generated by manual confirmation of vim's
      s/[^"]\@<=\$\S\+\s\@=/"&"/gc
      and
      s/\(echo \)\@<=[^"].*\$.*$/"&"/c matches.
      
      This patch generate a lot of noise and carries little benefits, as
      I do not really expect $PKI to contain spaces or backticks. I'm just
      fuming, and would not really mind if this patch is ignored
      b3ff07a0
    • D
      virt-pki-validate: behave when CERTTOOL is missing · 9b479159
      Dan Kenigsberg 提交于
      9b479159
    • E
      autobuild.sh: use VPATH build · ec28eb29
      Eric Blake 提交于
      Try to avoid future regressions on the VPATH front.
      
      * autobuild.sh: Uncomment VPATH use.
      * .gitignore: Exclude build directory.
      ec28eb29
    • E
      maint: fix 'make dist' in VPATH build · 7e1dd7e0
      Eric Blake 提交于
      A diff of 'make dist' from in-tree vs. a VPATH build showed
      that we were missing docs/api_extension/*.patch files, but
      shipping other files that we didn't need.
      
      * bootstrap.conf (gnulib_extra_files): Don't distribute files we
      don't care about.
      * docs/Makefile.am (patches): Perform wildcard correctly.
      7e1dd7e0
    • E
      build: don't require pod2man for tarball builds · 6db98a2d
      Eric Blake 提交于
      Right now, 'man libvirtd' includes information that depends on
      configure results, so it must be generated on the fly and live
      in $(builddir); however, requiring pod2man on all end user
      machines is overkill.  Meanwhile, 'man virsh' doesn't mention
      any configure results, so it can be built at 'make dist' time.
      If that situation changes in the future, we can generate virsh.1
      in the same way that we generate libvirtd.8.
      
      * daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in
      advance of distribution.
      (libvirtd.8): Use only sed from tarball.
      (EXTRA_DIST): Ship new file.
      (libvirtd.pod): Delete unused rule.
      (man8_MANS): Let automake know which section to use.
      (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files.
      * tools/Makefile.am (dist_man1_MANS): Distribute pre-built man
      pages, fine since they don't require any substitution.
      (virt-xml-validate.1, virt-pki-validate.1): Change input source.
      (virsh.1): Build into srcdir.
      (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style.
      * daemon/.gitignore: Update.
      Reported by Diego Elio Pettenò.
      6db98a2d
  2. 21 2月, 2011 4 次提交
    • E
      maint: kill all remaining uses of old DEBUG macro · 994e7567
      Eric Blake 提交于
      Done mechanically with:
      $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
      
      followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
      with a single 'make syntax-check' fallout in the same file, and the
      actual deletion in src/util/logging.h.
      
      * src/util/logging.h (DEBUG, DEBUG0): Delete.
      * daemon/libvirtd.h (qemudDebug): Likewise.
      * global: Change remaining clients over to VIR_DEBUG counterpart.
      994e7567
    • E
      hash: make virHashFree more free-like · 03ba07cb
      Eric Blake 提交于
      Two-argument free functions are uncommon; match the style elsewhere
      by caching the callback at creation.
      
      * src/util/hash.h (virHashCreate, virHashFree): Move deallocator
      argument to creation.
      * cfg.mk (useless_free_options): Add virHashFree.
      * src/util/hash.c (_virHashTable): Track deallocator.
      (virHashCreate, virHashFree): Update to new signature.
      * src/conf/domain_conf.c (virDomainObjListDeinit)
      (virDomainObjListInit, virDomainDiskDefForeachPath)
      (virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
      Update callers.
      * src/conf/nwfilter_params.c (virNWFilterHashTableFree)
      (virNWFilterHashTableCreate): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
      Likewise.
      * src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
      Likewise.
      * src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
      (virNWFilterLearnShutdown): Likewise.
      * src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
      (qemuDomainPCIAddressSetFree): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      03ba07cb
    • J
      build: Fix API docs generation in VPATH build · 6e9f3dfa
      Jiri Denemark 提交于
      XSLT allows for two ways of generating the output of transformation.
      Either implicit, which xsltproc prints to stdout and can be redirected
      to a file using -o file. Or explicit, which means the stylesheet
      contains <xsl:document> element which specifies where the output should
      be saved. This can be used for generating more files by a single run of
      xsltproc and -o directory/ can change the directory where the output
      files will be stored.
      
      devhelp.xsl is special in that it combines both options in one
      stylesheet, which doesn't work well with -o:
      
      xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml
      
      Outputs 4 *.html files into ./devhelp but then tries to write to
      ./devhelp/ as a file (hence the I/O error) rather than writing output to
      the fifth file devhelp/libvirt.devhelp.
      
      This patch modifies devhelp.xsl so that all files are generated using
      <xsl:document> element and -o directory/ can be used to override output
      directory where those files are saved.
      6e9f3dfa
    • D
      Remove all object hashtable caches from virConnectPtr · 2ff4c137
      Daniel P. Berrange 提交于
      The virConnectPtr struct will cache instances of all other
      objects. APIs like virDomainLookupByUUID will return a
      cached object, so if you do virDomainLookupByUUID twice in
      a row, you'll get the same exact virDomainPtr instance.
      
      This does not have any performance benefit, since the actual
      logic in virDomainLookupByUUID (and other APIs returning
      virDomainPtr, etc instances) is not short-circuited. All
      it does is to ensure there is only one single virDomainPtr
      in existance for any given UUID.
      
      The caching has a number of downsides though, all relating
      to stale data. If APIs aren't careful to always overwrite
      the 'id' field in virDomainPtr it may become out of data.
      Likewise for the name field, if a guest is renamed, or if
      a guest is deleted, and then a new one created with the
      same UUID but different name.
      
      This has been an ongoing, endless source of bugs for all
      applications using libvirt from languages with garbage
      collection, causing them to get virDomainPtr instances
      from long ago with stale data.
      
      The caching is also a waste of memory resources, since
      both applications, and language bindings often maintain
      their own hashtable caches of object instances.
      
      This patch removes all the hash table caching, so all
      APIs return brand new virDomainPtr (etc) object instances.
      
      * src/datatypes.h: Delete all hash tables.
      * src/datatypes.c: Remove all object caching code
      2ff4c137
  3. 19 2月, 2011 6 次提交
    • S
      nwfilter: enable rejection of packets · 912d170f
      Stefan Berger 提交于
      This patch adds the possibility to not just drop packets, but to also have them rejected where iptables at least sends an ICMP msg back to the originator. On ebtables this again maps into dropping packets since rejecting is not supported.
      
      I am adding 'since 0.8.9' to the docs assuming this will be the next version of libvirt.
      912d170f
    • G
      Drop empty argument from dnsmasq call · acab8a97
      Guido Günther 提交于
      since dnsmasq >= 2.56 now bails out with empty arguments. See
          http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613944
      for the Debian bug and
          http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589885
      for the upstream reasoning.
      acab8a97
    • E
      build: fix broken mingw cross-compilation · 7b6286b7
      Eric Blake 提交于
      Two regressions:
      Commit df1011ca broke builds for systems that lack devmapper
      (non-Linux, as well as Linux with ./autogen.sh --without-libvirtd
      and without the libraries present).
      Commit ce6fd650 broke cross-compilation, due to a gnulib bug.
      
      * .gnulib: Update to latest, for cross-compilation fix.
      * src/util/util.c (virIsDevMapperDevice): Provide stub for
      platforms not using storage driver.
      * configure.ac (devmapper): Arrange to define HAVE_LIBDEVMAPPER_H.
      devmapper issue reported by Wen Congyang.
      7b6286b7
    • M
      esx: Ignore malformed host UUID from BIOS · 791da4e7
      Matthias Bolte 提交于
      Etienne Gosset reported that libvirt fails to connect to his ESX
      server because it failed to parse its malformed host UUID, that
      contains an additional space and lacks one hexdigit in the last
      group:
      
      xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxx
      
      Don't treat this as a fatal error, just ignore it.
      791da4e7
    • M
      virsh: freecell --all getting wrong NUMA nodes count · 595174ae
      Michal Privoznik 提交于
      Virsh freecell --all was not only getting wrong NUMA nodes count, but
      even the NUMA nodes IDs. They doesn't have to be continuous, as I've
      found out during testing this. Therefore a modification of
      nodeGetCellsFreeMemory() error message.
      595174ae
    • E
      build: speed up non-maintainer builds · 1c072334
      Eric Blake 提交于
      * configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Use to reduce
      time spent in configure.
      1c072334
  4. 18 2月, 2011 16 次提交
    • E
      build: recompute symbols after changing configure options · 053013b0
      Eric Blake 提交于
      $ ./configure
      ...
      $ make
      ...
        GEN    libvirt.syms
      ...
      $ ./configure --with-driver-modules
      ...
      $ make
      ...
      
      libvirt.syms doesn't get regenerated but it should as it should
      contain virDriverLoadModule now.
      
      * src/Makefile.am (libvirt.syms): Depend on configure changes.
      Reported by Matthias Bolte.
      053013b0
    • J
      maint: Expand tabs in python code · 15285754
      Jiri Denemark 提交于
      Also cfg.mk is tweaked to force this for all future changes to *.py
      files.
      15285754
    • O
      Requires gettext for client package · 39164c11
      Osier Yang 提交于
      libvirt-guests invokes functions in gettext.sh, so we need to
      require gettext package in spec file.
      
      Demo with the fix:
      % rpm -q gettext
      package gettext is not installed
      
      % rpm -ivh libvirt-client-0.8.8-1.fc14.x86_64.rpm
      error: Failed dependencies:
      	gettext is needed by libvirt-client-0.8.8-1.fc14.x86_64
      
      * libvirt.spec.in
      39164c11
    • J
      Do not add drive 'boot=on' param when a kernel is specified · efc2594b
      Jim Fehlig 提交于
      libvirt-tck was failing several domain tests [1] with qemu 0.14, which
      is now less tolerable of specifying 2 bootroms with the same boot index [2].
      
      Drop the 'boot=on' param if kernel has been specfied.
      
      [1] https://www.redhat.com/archives/libvir-list/2011-February/msg00559.html
      [2] http://lists.nongnu.org/archive/html/qemu-devel/2011-02/msg01892.html
      efc2594b
    • C
      remove duplicated call to reportOOMError · 50daaa0a
      Christophe Fergeau 提交于
      50daaa0a
    • C
      remove space between function name and ( · 787e3889
      Christophe Fergeau 提交于
      There were several occurrences of an extra space inserted between
      a function name and the ( opening the argument list in
      datatypes.c. This is not consistent with the coding style used in
      the rest of this file so removing this extra space makes the
      code slightly more readable.
      787e3889
    • C
      don't check for NULL before calling virHashFree · 7b9a5099
      Christophe Fergeau 提交于
      virHashFree follows the convention described in HACKING that
      XXXFree() functions can be called with a NULL argument.
      7b9a5099
    • C
      remove no longer needed calls to virReportOOMError · 9905c69e
      Christophe Fergeau 提交于
      Now that the virHash handling functions call virReportOOMError by
      themselves when needed, users of the virHash API no longer need to
      do it by themselves. Since users of the virHash API were not
      consistently calling virReportOOMError after memory failures from
      the virHash code, this has the added benefit of making OOM
      reporting from this code more consistent and reliable.
      9905c69e
    • C
      factor common code in virHashAddEntry and virHashUpdateEntry · 7f1c65e5
      Christophe Fergeau 提交于
      The only difference between these 2 functions is that one errors
      out when the entry is already present while the other modifies
      the existing entry. Add an helper function with a boolean argument
      indicating whether existing entries should be updated or not, and
      use this helper in both functions.
      7f1c65e5
    • C
      add hash table rebalancing in virHashUpdateEntry · 5c5880e0
      Christophe Fergeau 提交于
      The code in virHashUpdateEntry and virHashAddEntry is really
      similar. However, the latter rebalances the hash table when
      one of its buckets contains too many elements while the former
      does not. Fix this discrepancy.
      5c5880e0
    • E
      hash: modernize debug code · aebe04d7
      Eric Blake 提交于
      * src/util/hash.c (virHashGrow) [DEBUG_GROW]: Use modern logging.
      Reported by Christophe Fergeau.
      aebe04d7
    • E
      build: improve 'make install' for VPATH builds · 31d094ca
      Eric Blake 提交于
      This still doesn't fix {html,devhelp}/libvirt-{libvirt-virterror}.html,
      but it's progress in the right direction.
      
      * docs/Makefile.am (%.html): Build into srcdir.
      31d094ca
    • W
      check more error info about whether drive_add failed · 34c13d0d
      Wen Congyang 提交于
      When we attach a disk, but we specify a wrong format of disk image,
      qemu monitor command drive_add will fail, but libvirt does not detect
      this error.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      34c13d0d
    • E
      logging: make VIR_ERROR and friends preserve errno · bb904f45
      Eric Blake 提交于
      Followup to commit 17e19add, and would have prevented the bug
      independently fixed in commit 76c57a7c.
      
      * src/util/logging.c (virLogMessage): Preserve errno, since
      logging should be as unintrusive as possible.
      bb904f45
    • E
      maint: avoid 'make syntax-check' from tarball · ce6fd650
      Eric Blake 提交于
      * .gnulib: update to latest gnulib for maint.mk fixes
      ce6fd650
    • L
      Give each virtual network bridge its own fixed MAC address · 5754dbd5
      Laine Stump 提交于
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=609463
      
      The problem was that, since a bridge always acquires the MAC address
      of the connected interface with the numerically lowest MAC, as guests
      are started and stopped, it was possible for the MAC address to change
      over time, and this change in the network was being detected by
      Windows 7 (it sees the MAC of the default route change), so on each
      reboot it would bring up a dialog box asking about this "new network".
      
      The solution is to create a dummy tap interface with a MAC guaranteed
      to be lower than any guest interface's MAC, and attach that tap to the
      bridge as soon as it's created. Since all guest MAC addresses start
      with 0xFE, we can just generate a MAC with the standard "0x52, 0x54,
      0" prefix, and it's guaranteed to always win (physical interfaces are
      never connected to these bridges, so we don't need to worry about
      competing numerically with them).
      
      Note that the dummy tap is never set to IFF_UP state - that's not
      necessary in order for the bridge to take its MAC, and not setting it
      to UP eliminates the clutter of having an (eg) "virbr0-nic" displayed
      in the output of the ifconfig command.
      
      I chose to not auto-generate the MAC address in the network XML
      parser, as there are likely to be consumers of that API that don't
      need or want to have a MAC address associated with the
      bridge.
      
      Instead, in bridge_driver.c when the network is being defined, if
      there is no MAC, one is generated. To account for virtual network
      configs that already exist when upgrading from an older version of
      libvirt, I've added a %post script to the specfile that searches for
      all network definitions in both the config directory
      (/etc/libvirt/qemu/networks) and the state directory
      (/var/lib/libvirt/network) that are missing a mac address, generates a
      random address, and adds it to the config (and a matching address to
      the state file, if there is one).
      
      docs/formatnetwork.html.in: document <mac address.../>
      docs/schemas/network.rng: add nac address to schema
      libvirt.spec.in: %post script to update existing networks
      src/conf/network_conf.[ch]: parse and format <mac address.../>
      src/libvirt_private.syms: export a couple private symbols we need
      src/network/bridge_driver.c:
          auto-generate mac address when needed,
          create dummy interface if mac address is present.
      tests/networkxml2xmlin/isolated-network.xml
      tests/networkxml2xmlin/routed-network.xml
      tests/networkxml2xmlout/isolated-network.xml
      tests/networkxml2xmlout/routed-network.xml: add mac address to some tests
      5754dbd5