1. 26 4月, 2013 1 次提交
    • E
      build: avoid unsafe functions in libgen.h · 1fbf1905
      Eric Blake 提交于
      POSIX says that both basename() and dirname() may return static
      storage (aka they need not be thread-safe); and that they may but
      not must modify their input argument.  Furthermore, <libgen.h>
      is not available on all platforms.  For these reasons, you should
      never use these functions in a multi-threaded library.
      
      Gnulib instead recommends a way to avoid the portability nightmare:
      gnulib's "dirname.h" provides useful thread-safe counterparts.  The
      obvious dir_name() and base_name() are GPL (because they malloc(),
      but call exit() on failure) so we can't use them; but the LGPL
      variants mdir_name() (malloc's or returns NULL) and last_component
      (always points into the incoming string without modifying it,
      differing from basename semantics only on corner cases like the
      empty string that we shouldn't be hitting in the first place) are
      already in use in libvirt.  This finishes the swap over to the safe
      functions.
      
      * cfg.mk (sc_prohibit_libgen): New rule.
      * src/util/vircgroup.c: Fix offenders.
      * src/parallels/parallels_storage.c (parallelsPoolAddByDomain):
      Likewise.
      * src/parallels/parallels_network.c (parallelsGetBridgedNetInfo):
      Likewise.
      * src/node_device/node_device_udev.c (udevProcessSCSIHost)
      (udevProcessSCSIDevice): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskDeleteVol): Likewise.
      * src/util/virpci.c (virPCIGetDeviceAddressFromSysfsLink):
      Likewise.
      * src/util/virstoragefile.h (_virStorageFileMetadata): Avoid false
      positive.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1fbf1905
  2. 24 4月, 2013 3 次提交
  3. 27 2月, 2013 1 次提交
  4. 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
  5. 05 2月, 2013 2 次提交
  6. 15 1月, 2013 1 次提交
  7. 04 1月, 2013 1 次提交
  8. 21 12月, 2012 3 次提交
  9. 11 12月, 2012 7 次提交
  10. 30 11月, 2012 1 次提交
  11. 26 11月, 2012 1 次提交
    • A
      Add private data pointer to virStoragePool and virStorageVol · 2b121dbc
      Ata E Husain Bohra 提交于
      This will simplify the refactoring of the ESX storage driver to support
      a VMFS and an iSCSI backend.
      
      One of the tasks the storage driver needs to do is to decide which backend
      driver needs to be invoked for a given request. This approach extends
      virStoragePool and virStorageVol to store extra parameters:
      
      1. privateData: stores pointer to respective backend storage driver.
      2. privateDataFreeFunc: stores cleanup function pointer.
      
      virGetStoragePool and virGetStorageVol are modfied to accept these extra
      parameters as user params. virStoragePoolDispose and virStorageVolDispose
      checks for cleanup operation if available.
      
      The private data pointer allows the ESX storage driver to store a pointer
      to the used backend with each storage pool and volume. This avoids the need
      to detect the correct backend in each storage driver function call.
      2b121dbc
  12. 29 10月, 2012 1 次提交
    • J
      xml: print uuids in the warning · 0b121614
      Ján Tomko 提交于
      In the XML warning, we print a virsh command line that can be used to
      edit that XML. This patch prints UUIDs if the entity name contains
      special characters (like shell metacharacters, or "--" that would break
      parsing of the XML comment). If the entity doesn't have a UUID, just
      print the virsh command that can be used to edit it.
      0b121614
  13. 27 10月, 2012 1 次提交
    • L
      parallels: fix build for some older compilers · 73ebd86d
      Laine Stump 提交于
      Found this when building on RHEL5:
      
      parallels/parallels_storage.c: In function 'parallelsStorageOpen':
      parallels/parallels_storage.c:180: error: 'for' loop initial declaration used outside C99 mode
      
      (and similar error in parallels_driver.c). This was in spite of
      configuring with "-Wno-error".
      73ebd86d
  14. 21 9月, 2012 1 次提交
  15. 01 8月, 2012 2 次提交
    • D
      parallels: implement VM creation · 7024ddfc
      Dmitry Guryanov 提交于
      To create a new VM in Parallels Clud Server we should issue
      "prlctl create" command, and give path to the directory,
      where VM should be created. VM's storage will be in that
      directory later. So in this first version find out location
      of first VM's hard disk and create VM there.
      Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
      7024ddfc
    • D
      parallels: add storage driver · aa296e6c
      Dmitry Guryanov 提交于
      Parallels Cloud Server has one serious discrepancy with libvirt:
      libvirt stores domain configuration files in one place, and storage
      files in other places (with the API of storage pools and storage volumes).
      Parallels Cloud Server stores all domain data in a single directory,
      for example, you may have domain with name fedora-15, which will be
      located in '/var/parallels/fedora-15.pvm', and it's hard disk image will be
      in '/var/parallels/fedora-15.pvm/harddisk1.hdd'.
      
      I've decided to create storage driver, which produces pseudo-volumes
      (xml files with volume description), and they will be 'converted' to
      real disk images after attaching to a VM.
      
      So if someone creates VM with one hard disk using virt-manager,
      at first virt-manager creates a new volume, and then defines a
      domain. We can lookup a volume by path in XML domain definition
      and find out location of new domain and size of its hard disk.
      Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
      aa296e6c