1. 10 5月, 2013 1 次提交
  2. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  3. 23 2月, 2013 1 次提交
    • S
      storage: use f_frsize, not f_bsize, for calculating available space · c2092abf
      Sage Weil 提交于
      The bfree and blocks fields are supposed to be in units of frsize.  We were
      calculating capacity correctly using those units, but the available
      calculation was using bsize instead.  Most file systems report these as the
      same value specifically because many programs are buggy, but that is no
      reason to rely on that behavior, or to behave inconsistently.
      
      This bug has been present since e266ded2 (2008) and aa296e6c, when the code
      was originally introduced (the latter via cut and paste).
      Signed-off-by: NSage Weil <sage@newdream.net>
      c2092abf
  4. 24 1月, 2013 1 次提交
  5. 14 1月, 2013 1 次提交
  6. 21 12月, 2012 6 次提交
  7. 07 12月, 2012 1 次提交
    • J
      storage: allow metadata preallocation when creating qcow2 images · 1c9a2fb1
      Ján Tomko 提交于
      Add VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA flag to virStorageVolCreateXML
      and virStorageVolCreateXMLFrom. This flag requests metadata
      preallocation when creating/cloning qcow2 images, resulting in creating
      a sparse file with qcow2 metadata. It has only slightly larger disk usage
      compared to new image with no allocation, but offers higher performance.
      1c9a2fb1
  8. 06 12月, 2012 1 次提交
  9. 22 11月, 2012 2 次提交
  10. 02 11月, 2012 1 次提交
  11. 22 10月, 2012 1 次提交
    • E
      storage: let format probing work on root-squash NFS · d9d77bfa
      Eric Blake 提交于
      Yet another instance of where using plain open() mishandles files
      that live on root-squash NFS, and where improving the API can
      improve the chance of a successful probe.
      
      * src/util/storage_file.h (virStorageFileProbeFormat): Alter
      signature.
      * src/util/storage_file.c (virStorageFileProbeFormat): Use better
      method for opening file.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Update caller.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      d9d77bfa
  12. 20 10月, 2012 2 次提交
    • E
      storage: don't require caller to pre-allocate metadata struct · 1fc95932
      Eric Blake 提交于
      Requiring pre-allocation was an unusual idiom.  It allowed iteration
      over the backing chain to use fewer mallocs, but made one-shot
      clients harder to read.  Also, this makes it easier for a future
      patch to move away from opening fds on every iteration over the chain.
      
      * src/util/storage_file.h (virStorageFileGetMetadataFromFD): Alter
      signature.
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD): Allocate
      return value.
       (virStorageFileGetMetadata): Update clients.
      * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      1fc95932
    • E
      storage: don't probe non-files · eac74c1f
      Eric Blake 提交于
      Backing chains can end on a network protocol, such as nbd:xxx; we
      should not attempt to probe the file system in this case.
      
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Only probe files.
      eac74c1f
  13. 21 9月, 2012 1 次提交
  14. 02 8月, 2012 1 次提交
    • G
      storage: netfs and iscsi need option srcSpec for resource discovery · 40570488
      Guannan Ren 提交于
      The option 'srcSpec' to virsh command find-storage-pool-sources
      is optional for logical type of storage pool, but mandatory for
      netfs and iscsi type.
      When missing the option for netfs and iscsi, libvirt reports XML
      parsing error due to null string option srcSpec.
      
      before
      error: Failed to find any netfs pool sources
      error: (storage_source_specification):1: Document is empty
      (null)
      
      after:
      error: pool type 'iscsi' requires option --srcSpec for source discovery
      40570488
  15. 27 7月, 2012 1 次提交
    • E
      maint: don't permit format strings without % · 768007ae
      Eric Blake 提交于
      Any time we have a string with no % passed through gettext, a
      translator can inject a % to cause a stack overread.  When there
      is nothing to format, it's easier to ask for a string that cannot
      be used as a formatter, by using a trivial "%s" format instead.
      
      In the past, we have used --disable-nls to catch some of the
      offenders, but that doesn't get run very often, and many more
      uses have crept in.  Syntax check to the rescue!
      
      The syntax check can catch uses such as
      virReportError(code,
                     _("split "
                       "string"));
      by using a sed script to fold context lines into one pattern
      space before checking for a string without %.
      
      This patch is just mechanical insertion of %s; there are probably
      several messages touched by this patch where we would be better
      off giving the user more information than a fixed string.
      
      * cfg.mk (sc_prohibit_diagnostic_without_format): New rule.
      * src/datatypes.c (virUnrefConnect, virGetDomain)
      (virUnrefDomain, virGetNetwork, virUnrefNetwork, virGetInterface)
      (virUnrefInterface, virGetStoragePool, virUnrefStoragePool)
      (virGetStorageVol, virUnrefStorageVol, virGetNodeDevice)
      (virGetSecret, virUnrefSecret, virGetNWFilter, virUnrefNWFilter)
      (virGetDomainSnapshot, virUnrefDomainSnapshot): Add %s wrapper.
      * src/lxc/lxc_driver.c (lxcDomainSetBlkioParameters)
      (lxcDomainGetBlkioParameters): Likewise.
      * src/conf/domain_conf.c (virSecurityDeviceLabelDefParseXML)
      (virDomainDiskDefParseXML, virDomainGraphicsDefParseXML):
      Likewise.
      * src/conf/network_conf.c (virNetworkDNSHostsDefParseXML)
      (virNetworkDefParseXML): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterIsValidChainName):
      Likewise.
      * src/conf/nwfilter_params.c (virNWFilterVarValueCreateSimple)
      (virNWFilterVarAccessParse): Likewise.
      * src/libvirt.c (virDomainSave, virDomainSaveFlags)
      (virDomainRestore, virDomainRestoreFlags)
      (virDomainSaveImageGetXMLDesc, virDomainSaveImageDefineXML)
      (virDomainCoreDump, virDomainGetXMLDesc)
      (virDomainMigrateVersion1, virDomainMigrateVersion2)
      (virDomainMigrateVersion3, virDomainMigrate, virDomainMigrate2)
      (virStreamSendAll, virStreamRecvAll)
      (virDomainSnapshotGetXMLDesc): Likewise.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopReqLeaseDel)
      (virNWFilterDHCPSnoopReq): Likewise.
      * src/openvz/openvz_driver.c (openvzUpdateDevice): Likewise.
      * src/openvz/openvz_util.c (openvzKBPerPages): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupCgroup): Likewise.
      * src/qemu/qemu_command.c (qemuBuildHubDevStr, qemuBuildChrChardevStr)
      (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/rpc/virnetsaslcontext.c (virNetSASLSessionGetIdentity):
      Likewise.
      * src/rpc/virnetsocket.c (virNetSocketNewConnectUNIX)
      (virNetSocketSendFD, virNetSocketRecvFD): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskBuildPool): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemProbe)
      (virStorageBackendFileSystemBuild): Likewise.
      * src/storage/storage_backend_rbd.c
      (virStorageBackendRBDOpenRADOSConn): Likewise.
      * src/storage/storage_driver.c (storageVolumeResize): Likewise.
      * src/test/test_driver.c (testInterfaceChangeBegin)
      (testInterfaceChangeCommit, testInterfaceChangeRollback):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxListAllDomains): Likewise.
      * src/xenxs/xen_sxpr.c (xenFormatSxprDisk, xenFormatSxpr):
      Likewise.
      * src/xenxs/xen_xm.c (xenXMConfigGetUUID, xenFormatXMDisk)
      (xenFormatXM): Likewise.
      768007ae
  16. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  17. 19 7月, 2012 1 次提交
  18. 12 7月, 2012 1 次提交
  19. 11 7月, 2012 1 次提交
    • S
      Fix directory removal in filesystem storage driver · 5079a7b3
      Sascha Peilicke 提交于
      Fix the virStorageBackendFileSystemVolDelete method to not use
      unlink() unconditionally. It must use rmdir() for volumes which
      are directories. It should also raise an error if given a volume
      which has the network/block type.
      5079a7b3
  20. 10 7月, 2012 1 次提交
  21. 09 7月, 2012 3 次提交
  22. 28 6月, 2012 1 次提交
  23. 21 6月, 2012 1 次提交
    • O
      storage: Set the perms if the pool target already exists for fs pools · e4cfe5f6
      Osier Yang 提交于
      The comment says:
      
      /* Now create the final dir in the path with the uid/gid/mode
       * requested in the config. If the dir already exists, just set
       * the perms.
       */
      
      However, virDirCreate is only invoked if the target path doesn't
      exist yet (which is opposite with the comment), or the uid from
      the config is not -1 (I don't understand why, think it's just
      another mistake). And the result is the perms of the pool won't
      be changed if one tries to build the pool with different perms
      again.
      
      Besides these logic error fix, if no uid and gid are specified in
      the config, the practical used uid, gid are reflected.
      e4cfe5f6
  24. 30 4月, 2012 1 次提交
  25. 01 2月, 2012 1 次提交
  26. 04 12月, 2011 1 次提交
    • E
      maint: fix improper use of 'an' · 3a9ce767
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a
      misuse of 'an' where 'a' is proper; that has since been fixed,
      but a search found other problems (some were a spelling error for
      'and', while most were fixed by 'a').
      
      * daemon/stream.c: Fix grammar.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_vi.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * src/rpc/virnetserverprogram.c: Likewise.
      * src/storage/storage_backend_fs.c: Likewise.
      * src/util/conf.c: Likewise.
      * src/util/dnsmasq.c: Likewise.
      * src/util/iptables.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      3a9ce767
  27. 02 12月, 2011 1 次提交
    • E
      maint: typo fixes · a6997934
      Eric Blake 提交于
      Many of these were mentioned by Yuri Chornoivan in:
      https://bugzilla.redhat.com/show_bug.cgi?id=669506
      
      * src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
      * src/conf/netdev_vport_profile_conf.c
      (virNetDevVPortProfileParse): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
      * src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemBuild): Likewise.
      * daemon/libvirtd.conf: Likewise.
      * src/util/logging.c (virLogMessage): Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
      * src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
      a6997934
  28. 25 10月, 2011 1 次提交
    • E
      storage: make previous leak less likely to regress · b1836a25
      Eric Blake 提交于
      Splitting into two functions allows the user to call the right
      function, rather than having to remember that a *Free function is
      an exception to the rule.
      
      * src/conf/storage_conf.h (virStoragePoolSourceClear): New function.
      * src/libvirt_private.syms (storage_conf.h): Export it.
      * src/conf/storage_conf.c (virStoragePoolSourceFree): Split...
      (virStoragePoolSourceClear): ...into new function.
      (virStoragePoolDefFree, virStoragePoolDefParseSourceString):
      Update callers.
      * src/test/test_driver.c (testStorageFindPoolSources): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSourcesFunc)
      (virStorageBackendFileSystemNetFindPoolSources): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalFindPoolSources): Likewise.
      b1836a25
  29. 01 10月, 2011 1 次提交
    • S
      lvm storage backend: handle command_names=1 in lvm.conf · 30f555c6
      Serge E. Hallyn 提交于
      If the regexes supported (?:pvs)?, then we could handle this by
      optionally matching but not returning the initial command name.  But it
      doesn't.  So add a new char* argument to
      virStorageBackendRunProgRegex().  If that argument is NULL then we act
      as usual.  Otherwise, if the string at that argument is found at the
      start of a returned line, we drop that before running the regex.
      
      With this patch, virt-manager shows me lvs with command_names 1 or 0.
      
      The definitions of PVS_BASE etc may want to be moved into the configure
      scripts (though given how PVS is found, IIUC that could only happen if
      pvs was a link to pvs_real), but in any case no sense dealing with that
      until we're sure this is an ok way to handle it.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      30f555c6
  30. 16 9月, 2011 1 次提交
  31. 02 9月, 2011 1 次提交
    • O
      storage: Add fs pool formatting · 27758859
      Osier Yang 提交于
      This patch adds the ability to make the filesystem for a filesystem
      pool during a pool build.
      
      The patch adds two new flags, no overwrite and overwrite, to control
      when mkfs gets executed.  By default, the patch preserves the
      current behavior, i.e., if no flags are specified, pool build on a
      filesystem pool only makes the directory on which the filesystem
      will be mounted.
      
      If the no overwrite flag is specified, the target device is checked
      to determine if a filesystem of the type specified in the pool is
      present.  If a filesystem of that type is already present, mkfs is
      not executed and the build call returns an error.  Otherwise, mkfs
      is executed and any data present on the device is overwritten.
      
      If the overwrite flag is specified, mkfs is always executed, and any
      existing data on the target device is overwritten unconditionally.
      27758859