1. 14 9月, 2010 3 次提交
    • J
      virsh: Use virBuffer for generating XML · fc3247f2
      Jiri Denemark 提交于
      cmdAttachInterface and cmdAttachDisk still used vshRealloc and sprintf
      for generating XML, which is hardly maintainable. Let's get rid of this
      old code.
      fc3247f2
    • E
      build: use portable sed expressions · 249a5b35
      Eric Blake 提交于
      * src/Makefile.am (libvirt.def, libvirt_qemu.def): '\}' and '\t'
      are not required by POSIX.  Use '}' and literal tab instead.
      (install-data-local): Avoid sed -i.
      * tests/read-bufsiz: Likewise.
      Reported by Mitchell Hashimoto.
      249a5b35
    • J
      docs: improve wording for the dev guide · 3b167dfa
      Justin Clift 提交于
      Wording tweak suggested by David Jorm, author of the libvirt App Dev Guide.
      3b167dfa
  2. 13 9月, 2010 1 次提交
  3. 10 9月, 2010 13 次提交
    • J
      docs: add the app dev guide · 7ebe2149
      Justin Clift 提交于
      Added a workable initial page for the libvirt Application
      Development Guide, giving the online viewable options +
      the available download ones (pdf, epub, srpm).
      
      Added a link to the PDF to the main Downloads page, plus
      neatened the html tags throughout the page as they
      were a bit of a mess.
      
      Added --enable-compile-warnings=error to the autogen line,
      as suggested by Eric Blake.
      7ebe2149
    • D
      Libvirt release 0.8.4 · 9a8e152f
      Daniel Veillard 提交于
      update news, spec and french localizaton
      9a8e152f
    • C
      buf: Fix possible infinite loop in EscapeString, VSnprintf · 18af6f4e
      Cole Robinson 提交于
      The current code will go into an infinite loop if the printf generated
      string is >= 1000, AND exactly 1 character smaller than the amount of free
      space in the buffer. When this happens, we are dropped into the loop body,
      but nothing will actually change, because count == (buf->size - buf->use - 1),
      and virBufferGrow returns unchanged if count < (buf->size - buf->use)
      
      Fix this by removing the '- 1' bit from 'size'. The *nprintf functions handle
      the NULL byte for us anyways, so we shouldn't need to manually accommodate
      for it.
      
      Here's a bug where we are actually hitting this issue:
      https://bugzilla.redhat.com/show_bug.cgi?id=602772
      
      v2: Eric's improvements: while -> if (), remove extra va_list variable,
          make sure we report buffer error if snprintf fails
      
      v3: Add tests/virbuftest which reproduces the infinite loop before this
          patch, works correctly after
      18af6f4e
    • G
      Fix block statistics with newer versions of Xen · 8a70113a
      Guido Günther 提交于
      Apparently the xen block device statistics moved from
      "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s"
      to
      "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s"
      
      * src/xen/block_stats.c: try the extra path in case of failure to
        find the statistics in /sys
      8a70113a
    • J
      virsh: Option for overriding disk type in attach-disk · dfec22cc
      Jiri Denemark 提交于
      Unless --driver tap|file option was given to attach-disk, virsh would
      generate <disk type='block'> XML which might be fine for Xen but not for
      other hypervisors. This patch introduces a new option --sourcetype which
      can be used to explicitly set the type of disk source. The option
      accepts either "file" or "block" types.
      dfec22cc
    • D
      Fix dependancies for remote generated files · 690583f7
      Daniel P. Berrange 提交于
      Very occasionally during a parallel make, dispatch.c would
      be compiled before the generated remote headers had been
      fully written. This would cause it to compile an empty
      union, and result in really wierd runtime bugs that are
      near impossible to diagnose.
      
      * daemon/Makefile.am: Fix remote build deps
      690583f7
    • D
      Ensure remote daemon unions are always non-zero length · 7bdb05ea
      Daniel P. Berrange 提交于
      If the remote daemon args/ret unions ever become zero length
      (due to a build / Makefile bug) then bad stuff happens at
      runtime. Add a compile time assertion to check for this kind
      of problem
      
      * daemon/remote.h: Ensure non-zero length unions
      7bdb05ea
    • D
      Fix off-by-1 in QEMU boot arg array handling · 48ab2099
      Daniel P. Berrange 提交于
      A QEMU guest can have upto VIR_DOMAIN_BOOT_LAST boot entries
      defined. When building the QEMU arg, each entry takes a
      single byte. This means the array must be declared to be
      VIR_DOMAIN_BOOT_LAST+1 bytes in length to allow for the
      trailing null
      
      * src/qemu/qemu_conf.c: Fix off-by-1 boot arg array size
      48ab2099
    • J
      bridge: Fix static-only DHCP configuration · df990b44
      Jiri Denemark 提交于
      For static-only DHCP, i.e. with no <range> but at least one <host>
      element within <dhcp> element, we have to add "--dhcp-range IP,static"
      option to dnsmasq to actually enable the service. Without this option,
      dnsmasq will not respond to DHCP requests.
      df990b44
    • L
      qemu: qemuMonitorJSONEjectMedia(): Fix arguments' type · e70880c5
      Luiz Capitulino 提交于
      QMP in QEMU 0.13 has been fixed to enforce type correctness,
      this means that boolean types must be true or false, not
      integers.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      e70880c5
    • L
      qemu: qemuMonitorJSONMigrate(): Fix arguments' type · ffefe5fb
      Luiz Capitulino 提交于
      QMP in QEMU 0.13 has been fixed to enforce type correctness,
      this means that boolean types must be true or false, not
      integers.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      ffefe5fb
    • S
      Add nwfilter support to UML driver · f68fd147
      Soren Hansen 提交于
      Extend user-mode-linux driver to support nwfilter.
      Signed-off-by: NSoren Hansen <soren@linux2go.dk>
      f68fd147
    • M
      test: Don't overwrite storage volume target path and key · 8eac2621
      Matthias Bolte 提交于
      Only generate target path and key when they are not defined
      in the XML config.
      8eac2621
  4. 09 9月, 2010 1 次提交
  5. 08 9月, 2010 4 次提交
  6. 07 9月, 2010 1 次提交
  7. 05 9月, 2010 1 次提交
  8. 04 9月, 2010 3 次提交
  9. 03 9月, 2010 4 次提交
    • E
      build: avoid uninitialized variable warning · 2ce55fe7
      Eric Blake 提交于
      * src/vbox/vbox_tmpl.c (vboxAttachDrives): Capture return value.
      2ce55fe7
    • M
      esx: Rework datastore path parsing and handling · 84768912
      Matthias Bolte 提交于
      Instead of splitting the path part of a datastore path into
      directory and file name, keep this in one piece. An example:
      
        "[datastore] directory/file"
      
      was split into this before:
      
        datastoreName = "datastore"
        directoryName = "directory"
        fileName = "file"
      
      Now it's split into this:
      
        datastoreName = "datastore"
        directoryName = "directory"
        directoryAndFileName = "directory/file"
      
      This simplifies code using esxUtil_ParseDatastorePath, because
      directoryAndFileName is used more often than fileName. Also the
      old approach expected the datastore path to reference an actual
      file, but this isn't always correct, especially when listing
      volumes. In that case esxUtil_ParseDatastorePath is used to parse
      a path that references a directory. This fails for a vpx://
      connection because the vCenter returns directory paths with a
      trailing '/'. The new approach is robust against this and the
      actual decision if the datastore path should reference a file or
      a directory is up to the caller of esxUtil_ParseDatastorePath.
      
      Update the tests accordingly.
      84768912
    • E
      vbox: factor a large function · 2af93cd4
      Eric Blake 提交于
      * src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Split...
      (vboxSetBootDeviceOrder, vboxAttachDrives, vboxAttachSound)
      (vboxAttachNetwork, vboxAttachSerial, vboxAttachParallel)
      (vboxAttachVideo, vboxAttachDisplay, vboxAttachUSB): ...into new
      helper functions.
      2af93cd4
    • E
      lxc: avoid large stacks with veth creation · f694036f
      Eric Blake 提交于
      * src/lxc/veth.h (vethCreate): Change prototype.
      * src/lxc/veth.c (vethCreate): Always malloc veth2, and allocate
      veth1 if needed.
      (getFreeVethName): Adjust signature, and use virAsprintf.
      * src/lxc/lxc_driver.c (lxcSetupInterfaces): Adjust caller.
      f694036f
  10. 02 9月, 2010 5 次提交
    • M
      esx: Fix generator for string return values · 1504cc4f
      Matthias Bolte 提交于
      Distinguish between strings as parameters (const char *)
      and strings as return values (char **).
      1504cc4f
    • E
      openvz: use virAsprintf to avoid large stacks · a9afbf4f
      Eric Blake 提交于
      * src/openvz/openvz_conf.c (openvzLocateConfFile): Alter
      signature.
      (openvzGetVPSUUID, openvzSetDefinedUUID)
      (openvzWriteVPSConfigParam, openvzReadVPSConfigParam)
      (openvzCopyDefaultConfig): Adjust callers.
      a9afbf4f
    • E
      openvz: formatting cleanups · c6e8e26e
      Eric Blake 提交于
      * src/openvz/openvz_conf.c: Whitespace fixes.
      * src/openvz/openvz_driver.c: Likewise.
      c6e8e26e
    • E
      network: use virAsprintf when appropriate · ff829416
      Eric Blake 提交于
      * src/conf/network_conf.c (virNetworkAllocateBridge): Avoid
      limited buffer from snprintf.
      ff829416
    • E
      build: add some modules · ff578973
      Eric Blake 提交于
      snprintf is currently implicitly picked up by getaddrinfo, but we
      might as well make it explicit so that mingw doesn't break if
      getaddrinfo changes to drop the dependency.
      
      func doesn't matter for gcc compilation, but may help other compilers
      cope with our use of __func__.
      
      * bootstrap.conf (gnulib_modules): Add snprintf and func.
      ff578973
  11. 01 9月, 2010 4 次提交
    • R
      virsh: remove driver check from attach-disk command · 12a41822
      Ryan Harper 提交于
      Virsh shouldn't check for driver support but rather let the backend handled this.
      After removing the check, I can successfully attach file-based images to a qemu
      VM with attach-disk.
      
      % virsh attach-disk vm2 /images/test02.img vdc --driver qemu --type disk --subdriver raw
      Disk attached successfully
      
      This command generates the following XML:
      
      <disk type='block' device='disk'>
            <driver name='qemu' type='raw'/>
            <source dev='/images/test02.img'/>
            <target dev='vdc' bus='virtio'/>
            <alias name='virtio-disk2'/>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
      </disk>
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      12a41822
    • S
      Use global directory as UML's monitorDir for privileged connections · 9c4f62ae
      Soren Hansen 提交于
      For privileged UML connections (uml:///system), we shouldn't use root's
      home dir, but rather somewhere in /var/run/libvirt/uml-guest.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=499536Signed-off-by: NSoren Hansen <soren@linux2go.dk>
      9c4f62ae
    • S
      Explicitly pass uml_dir argument to user-mode-linux · 0a58eed3
      Soren Hansen 提交于
      uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
      for a couple of different reasons:
      
      libvirt expects this to default to virGetUserDirectory(geteuid()) +
      '/.uml'. However, user-mode-linux actually uses the HOME environment
      variable to determine where to look for the uml sockets, but if running
      libvirtd under sudo (which I routinely do during development), $HOME is
      pointing at my user's homedir, while my euid is 0, so libvirt looks in
      /root.
      
      Also (and this was my actual motivation for this patch), if HOME isn't
      set at all, user-mode-linux utterly fails. Looking at the code, it seems
      it's meant to emit a warning, but alas, it doesn't for some reason.
      If running libvirtd from upstart, HOME is not set, so any system using
      upstart will need this change.
      Signed-off-by: NSoren Hansen <soren@linux2go.dk>
      0a58eed3
    • E
      maint: track moved file · deaa9e3e
      Eric Blake 提交于
      * daemon/.gitignore: Move libvirt-guests.init...
      * tools/.gitignore: ...to its new location.
      deaa9e3e