1. 24 7月, 2014 18 次提交
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSIHost · 42957661
      John Ferlan 提交于
      Split virDomainHostdevSubsysSCSI further. In preparation for having
      either SCSI or iSCSI data, create a union in virDomainHostdevSubsysSCSI
      to contain just a virDomainHostdevSubsysSCSIHost to describe the
      'scsi_host' host device
      42957661
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSI · 5805621c
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing SCSI
      Then adjust the code to use the new pointer
      5805621c
    • J
      hostdev: Introduce virDomainHostdevSubsysPCI · 1c8da0d4
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing PCI.
      Then adjust the code to use the new pointer
      1c8da0d4
    • J
      hostdev: Introduce virDomainHostdevSubsysUSB · 7540d07f
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing USB.
      Then adjust the code to use the new pointer
      7540d07f
    • P
      qemu: snapshot: Use storage driver to pre-create snapshot file · 185e07a5
      Peter Krempa 提交于
      Move the last operation done on local files to the storage driver API.
      185e07a5
    • P
      storage: Implement virStorageFileCreate for local and gluster files · a2a67eff
      Peter Krempa 提交于
      Add backends for this frontend function so that we can use it in the
      snapshot creation code.
      a2a67eff
    • P
      qemu: Implement DAC driver chown callback to co-operate with storage drv · 24e5cafb
      Peter Krempa 提交于
      Use the storage driver to chown remote images.
      24e5cafb
    • P
      security: DAC: Plumb usage of chown callback · 0a515a3b
      Peter Krempa 提交于
      Use the callback to set disk and storage image labels by modifying the
      existing functions and adding wrappers to avoid refactoring a lot of the
      code.
      0a515a3b
    • P
      security: DAC: Introduce callback to perform image chown · 7490a6d2
      Peter Krempa 提交于
      To integrate the security driver with the storage driver we need to
      pass a callback for a function that will chown storage volumes.
      
      Introduce and document the callback prototype.
      7490a6d2
    • P
      security: DAC: Remove superfluous link resolution · 9f28599d
      Peter Krempa 提交于
      When restoring security labels in the dac driver the code would resolve
      the file path and use the resolved one to be chown-ed. The setting code
      doesn't do that. Remove the unnecessary code.
      9f28599d
    • P
      storage: Add witness for checking storage volume use in security driver · 222860cd
      Peter Krempa 提交于
      With my intended use of storage driver assist to chown files on remote
      storage we will need a witness that will tell us whether the given
      storage volume supports operations needed by the storage driver.
      222860cd
    • P
      storage: Implement storage driver helper to chown disk images · 50f09651
      Peter Krempa 提交于
      Gluster storage works on a similar principle to NFS where it takes the
      uid and gid of the actual process and uses it to access the storage
      volume on the remote server. This introduces a need to chown storage
      files on gluster via native API.
      50f09651
    • M
      qemuConnectGetDomainCapabilities: Use wiser defaults · 12926a7c
      Michal Privoznik 提交于
      Up to now, users have to pass two arguments at least: domain virt type
      ('qemu' vs 'kvm') and one of emulatorbin or architecture. This is not
      much user friendly. Nowadays users mostly use KVM and share the host
      architecture with the guest. So now, the API (and subsequently virsh
      command) can be called with all NULLs  (without any arguments).
      
      Before this patch:
       # virsh domcapabilities
       error: failed to get emulator capabilities
       error: virttype_str in qemuConnectGetDomainCapabilities must not be NULL
      
       # virsh domcapabilities kvm
       error: failed to get emulator capabilities
       error: invalid argument: at least one of emulatorbin or architecture fields must be present
      
      After:
      
       # virsh domcapabilities
       <domainCapabilities>
         <path>/usr/bin/qemu-system-x86_64</path>
         <domain>kvm</domain>
         <machine>pc-i440fx-2.1</machine>
         <arch>x86_64</arch>
         <vcpu max='255'/>
       </domainCapabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      12926a7c
    • M
      numatune: finish the split from domain_conf and remove all dependencies · dc8b7ce7
      Martin Kletzander 提交于
      This patch adds back the virDomainDef typedef into domain_conf and
      makes all the numatune_conf functions independent of any virDomainDef
      definitions.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      dc8b7ce7
    • N
      leaseshelper: avoid mem leak after storing lease entries · 6675a0ab
      Nehal J Wani 提交于
      Contents of existing lease file were being stored in a variable
      which was never freed.
      6675a0ab
    • E
      conf: avoid memory leaks while parsing seclabel · 55d54dd9
      Eric Blake 提交于
      Our seclabel parsing was repeatedly assigning malloc'd data into a
      temporary variable, without first freeing the previous use.  Among
      other leaks flagged by valgrind:
      
      ==9312== 8 bytes in 1 blocks are definitely lost in loss record 88 of 821
      ==9312==    at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==9312==    by 0x8C40369: strdup (strdup.c:42)
      ==9312==    by 0x50EA799: virStrdup (virstring.c:676)
      ==9312==    by 0x50FAEB9: virXPathString (virxml.c:90)
      ==9312==    by 0x50FAF1E: virXPathStringLimit (virxml.c:112)
      ==9312==    by 0x510F516: virSecurityLabelDefParseXML (domain_conf.c:4571)
      ==9312==    by 0x510FB20: virSecurityLabelDefsParseXML (domain_conf.c:4720)
      
      While it was multiple problems, it looks like commit da78351b (thankfully
      unreleased) was to blame for all of them.
      
      * src/conf/domain_conf.c (virSecurityLabelDefParseXML): Plug leaks
      detected by valgrind.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      55d54dd9
    • E
      nwfilter: plug memory leak with firewall · ee70839b
      Eric Blake 提交于
      Introduced in commit 70571ccc (v1.2.4). Caught by valgrind:
      
      ==9816== 170 (32 direct, 138 indirect) bytes in 1 blocks are definitely lost in loss record 646 of 821
      ==9816==    at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==9816==    by 0x50836FB: virAlloc (viralloc.c:144)
      ==9816==    by 0x50AEC2B: virFirewallNew (virfirewall.c:204)
      ==9816==    by 0x1E2308ED: ebiptablesDriverProbeStateMatch (nwfilter_ebiptables_driver.c:3715)
      ==9816==    by 0x1E2309AD: ebiptablesDriverInit (nwfilter_ebiptables_driver.c:3742)
      
      * src/nwfilter/nwfilter_ebiptables_driver.c
      (ebiptablesDriverProbeStateMatch): Properly clean up.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ee70839b
    • E
      metadata: track title edits across libvirtd restart · 60e49440
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1122205
      
      Although the edits were changing in-memory XML, it was not flushed
      to disk; so unless some other action changes XML, a libvirtd restart
      would lose the changed information.
      
      * src/conf/domain_conf.c (virDomainObjSetMetadata): Add parameter,
      to save live status across restarts.
      (virDomainSaveXML): Allow for test driver.
      * src/conf/domain_conf.h (virDomainObjSetMetadata): Adjust
      signature.
      * src/bhyve/bhyve_driver.c (bhyveDomainSetMetadata): Adjust caller.
      * src/lxc/lxc_driver.c (lxcDomainSetMetadata): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSetMetadata): Likewise.
      * src/test/test_driver.c (testDomainSetMetadata): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      60e49440
  2. 23 7月, 2014 8 次提交
  3. 22 7月, 2014 13 次提交
    • P
      qemu: snapshot: Forbid taking/reverting snapshots in PMSUSPENDED state · 1e833899
      Peter Krempa 提交于
      Qemu doesn't currently support them and behaves strangely. Just forbid
      them.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1079162
      1e833899
    • P
      qemu: snapshot: Forbid taking snapshot in invalid state · c71045a9
      Peter Krempa 提交于
      Similarly to 49a3a649 forbid creating
      snapshots in domain states impossible to reach in qemu.
      c71045a9
    • E
      build: fix build without numactl · 72823b44
      Eric Blake 提交于
      Under ./configure --without-numactl but with numactl-devel installed,
      the build fails with:
      
      ../../src/util/virnuma.c: In function 'virNumaNodeIsAvailable':
      ../../src/util/virnuma.c:407:5: error: implicit declaration of function 'numa_bitmask_isbitset' [-Werror=implicit-function-declaration]
           return numa_bitmask_isbitset(numa_nodes_ptr, node);
           ^
      
      and other failures, all because the configure results for particular
      functions were used without regard to whether libnuma was even being
      linked in.
      
      * src/util/virnuma.c (virNumaGetPages): Fix message typo.
      (virNumaNodeIsAvailable): Correct build when not using numactl.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      72823b44
    • R
      storage: logical: drop useless if · 53939d58
      Roman Bogorodskiy 提交于
      virStorageBackendLogicalCreateVol contains a piece like:
      
          if (vol->target.path != NULL) {
              /* A target path passed to CreateVol has no meaning */
              VIR_FREE(vol->target.path);
          }
      
      The 'if' is useless here, but 'syntax-check' doesn't catch that
      because of the comment, so drop the 'if'.
      53939d58
    • R
      Fix build on non-Linux platforms · b5f57be2
      Roman Bogorodskiy 提交于
      Commit ef48a1b6 introduced virFindSCSIHostByPCI for Linux and
      a stub for other platforms that returns -1 while the function
      should return 'char *', so use 'return NULL' instead.
      
      Commit fbd91d49 introduced virReadSCSIUniqueId with the third
      argument 'int *result', however the stub for non-Linux patform
      uses 'unsigned int *result', so change it to 'int *result'.
      
      Pushed under the build breaker rule.
      b5f57be2
    • J
      getAdapterName: Lookup stable scsi_host · ea37fb34
      John Ferlan 提交于
      If a parentaddr was provided in the XML, have getAdapterName lookup
      the stable address.  This allows virStorageBackendSCSICheckPool() and
      virStorageBackendSCSIRefreshPool() to automagically find the scsi_host
      by its PCI address and unique_id
      ea37fb34
    • J
      scsi_host: Introduce virFindSCSIHostByPCI · ef48a1b6
      John Ferlan 提交于
      Introduce a new function to parse the provided scsi_host parent address
      and unique_id value in order to find the /sys/class/scsi_host directory
      which will allow a stable SCSI host address
      
      Add a test to scsihosttest to lookup the host# name by using the PCI address
      and unique_id value
      ef48a1b6
    • J
      Add unique_id to nodedev output · f3271f4c
      John Ferlan 提交于
      Add an optional unique_id parameter to nodedev.  Allows for easier lookup
      and display of the unique_id value in order to document for use with
      scsi_host code.
      f3271f4c
    • J
      virutil: Introduce virReadSCSIUniqueId · fbd91d49
      John Ferlan 提交于
      Introduce a new function to read the current scsi_host entry and return
      the value found in the 'unique_id' file.
      
      Add a 'scsihosttest' test (similar to the fchosttest, but incorporating some
      of the concepts of the mocked pci test library) in order to read the
      unique_id file like would be found in the /sys/class/scsi_host tree.
      fbd91d49
    • J
      scsi_backend: Use existing LINUX_SYSFS_SCSI_HOST_PREFIX definition · aa9dac09
      John Ferlan 提交于
      Rather than supplying the path again in the formatting of the sysfs
      scsi_host directory.
      aa9dac09
    • O
      storage: Introduce parentaddr into virStoragePoolSourceAdapter · a4bd62ad
      Osier Yang 提交于
      Between reboots and kernel reloads, the SCSI host number used for SCSI
      storage pools may change requiring modification to the storage pool XML
      in order to use a specific SCSI host adapter.
      
      This patch introduces the "parentaddr" element and "unique_id" attribute
      for the SCSI host adapter in order to uniquely identify the adapter
      between reboots and kernel reloads. For now the goal is to only parse
      and format the XML. Both will be required to be provided in order to
      uniquely identify the desired SCSI host.
      
      The new XML is expected to be as follows:
      
        <adapter type='scsi_host'>
          <parentaddr unique_id='3'>
            <address domain='0x0000' bus='0x00' slot='0x1f' func='0x2'/>
          </parentaddr>
        </adapter>
      
      where "parentaddr" is the parent device of the SCSI host using the PCI
      address on which the device resides and the value from the unique_id file
      for the device. Both the PCI address and unique_id values will be used
      to traverse the /sys/class/scsi_host/ directories looking at each link
      to match the PCI address reformatted to the directory link format where
      "domain:bus:slot:function" is found.  Then for each matching directory
      the unique_id file for the scsi_host will be used to match the unique_id
      value in the xml.
      
      For a PCI address listed above, this will be formatted to "0000:00:1f.2"
      and the links in /sys/class/scsi_host will be used to find the host#
      to be used for the 'scsi_host' device. Each entry is a link to the
      /sys/bus/pci/devices directories, e.g.:
      
      %  ls -al /sys/class/scsi_host/host2
      lrwxrwxrwx. 1 root root 0 Jun  1 00:22 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2
      
      % cat /sys/class/scsi_host/host2/unique_id
      3
      
      The "parentaddr" and "name" attributes are mutually exclusive to identify
      the SCSI host number. Use of the "parentaddr" element will be the preferred
      mechanism.
      
      This patch only supports to parse and format the XMLs. Later patches will
      add code to find out the scsi host number.
      a4bd62ad
    • O
      virStoragePoolSourceAdapter: Refine the SCSI_HOST adapter name · 53f62056
      Osier Yang 提交于
      Preparation for future patches by creating a scsi_host union. For now,
      just the 'name' will be present.
      53f62056
    • J
      getAdapterName: check for SCSI_HOST · 8d854e5b
      John Ferlan 提交于
      Rather than assume that NOT FC_HOST is SCSI_HOST, let's call them out
      specifically. Makes it easier to find SCSI_HOST code/structs and ensures
      something isn't missed in the future
      8d854e5b
  4. 21 7月, 2014 1 次提交