1. 03 9月, 2016 3 次提交
  2. 02 9月, 2016 1 次提交
  3. 25 8月, 2016 1 次提交
  4. 20 8月, 2016 1 次提交
    • J
      qemu: Fix crash hot plugging luks volume · b4478c16
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1367259
      
      Crash occurs because 'secrets' is being dereferenced in call:
      
              if (qemuDomainSecretSetup(conn, priv, secinfo, disk->info.alias,
                                        VIR_SECRET_USAGE_TYPE_VOLUME, NULL,
                                        &src->encryption->secrets[0]->seclookupdef,
                                        true) < 0)
      
      (gdb) p *src->encryption
      $1 = {format = 2, nsecrets = 0, secrets = 0x0, encinfo = {cipher_size = 0,
          cipher_name = 0x0, cipher_mode = 0x0, cipher_hash = 0x0, ivgen_name = 0x0,
          ivgen_hash = 0x0}}
      (gdb) bt
          priv=priv@entry=0x7fffc03be160, disk=disk@entry=0x7fffb4002ae0)
          at qemu/qemu_domain.c:1087
          disk=0x7fffb4002ae0, vm=0x7fffc03a2580, driver=0x7fffc02ca390,
          conn=0x7fffb00009a0) at qemu/qemu_hotplug.c:355
      
      Upon entry to qemuDomainAttachVirtioDiskDevice, src->encryption points
      at a valid 'secret' buffer w/ nsecrets == 1; however, the call to
      qemuDomainDetermineDiskChain will call virStorageFileGetMetadata
      and eventually virStorageFileGetMetadataInternal where the src->encryption
      was overwritten when probing the volume.
      
      Commit id 'a48c7141' added code to virStorageFileGetMetadataInternal
      to determine if the disk/volume would use/need encryption and allocated
      a meta->encryption. This overwrote an existing encryption buffer
      already provided by the XML
      
      This patch adds a check for meta->encryption already present before
      just allocating and overwriting an existing buffer. It then checks the
      existing encryption data to ensure the XML provided format for the
      disk matches the expected format read from the disk and errors if there
      is a mismatch.
      b4478c16
  5. 17 8月, 2016 1 次提交
    • A
      util: Make virStringArrayHasString() const-correct · 3edcf834
      Andrea Bolognani 提交于
      The first argument should be const char ** instead of
      char **, because this is a search function and as such it
      doesn't, and shouldn't, alter the haystack in any way.
      
      This change means we no longer have to cast arrays of
      immutable strings to arrays of mutable strings; we still
      have to do the opposite, though, but that's reasonable.
      3edcf834
  6. 16 8月, 2016 1 次提交
  7. 10 8月, 2016 3 次提交
  8. 08 8月, 2016 1 次提交
  9. 04 8月, 2016 1 次提交
  10. 02 8月, 2016 1 次提交
  11. 28 7月, 2016 3 次提交
    • J
      util: Introduce virISCSINodeNew · ae65c908
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1356436
      
      According to RFC 3721 (https://www.ietf.org/rfc/rfc3721.txt), there are
      two ways to "discover" targets in/for the iSCSI environment. Discovery
      is the process which allows the initiator to find the targets to which
      it has access and at least one address at which each target may be
      accessed.
      
      The method currently implemented in libvirt using the virISCSIScanTargets
      API is known as "SendTargets" discovery. This method is more useful when
      the target IP Address and TCP port information are available, e.g. in
      libvirt terms the "portal". It returns a list of targets for the portal.
      From that list, the target can be found. This operation can also fill an
      iSCSI node table into which iSCSI logins may occur. Commit id '56057900'
      altered that filling by adding the "--op nonpersistent" since it was
      not necessarily desired to perform that for non libvirt related targets.
      
      The second method is "Static Configuration". This method not only needs
      the IP Address and TCP port (e.g. portal), but also the iSCSI target name.
      In libvirt terms this would be the device path field from the iSCSI pool
      <source> XML. This patch implements the second methodology using that
      required device path as the targetname.
      ae65c908
    • D
      storage: remove "luks" storage volume type · a48c7141
      Daniel P. Berrange 提交于
      The current LUKS support has a "luks" volume type which has
      a "luks" encryption format.
      
      This partially makes sense if you consider the QEMU shorthand
      syntax only requires you to specify a format=luks, and it'll
      automagically uses "raw" as the next level driver. QEMU will
      however let you override the "raw" with any other driver it
      supports (vmdk, qcow, rbd, iscsi, etc, etc)
      
      IOW the intention though is that the "luks" encryption format
      is applied to all disk formats (whether raw, qcow2, rbd, gluster
      or whatever). As such it doesn't make much sense for libvirt
      to say the volume type is "luks" - we should be saying that it
      is a "raw" file, but with "luks" encryption applied.
      
      IOW, when creating a storage volume we should use this XML
      
        <volume>
          <name>demo.raw</name>
          <capacity>5368709120</capacity>
          <target>
            <format type='raw'/>
            <encryption format='luks'>
              <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
            </encryption>
          </target>
        </volume>
      
      and when configuring a guest disk we should use
      
        <disk type='file' device='disk'>
          <driver name='qemu' type='raw'/>
          <source file='/home/berrange/VirtualMachines/demo.raw'/>
          <target dev='sda' bus='scsi'/>
          <encryption format='luks'>
            <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
          </encryption>
        </disk>
      
      This commit thus removes the "luks" storage volume type added
      in
      
        commit 318ebb36
        Author: John Ferlan <jferlan@redhat.com>
        Date:   Tue Jun 21 12:59:54 2016 -0400
      
          util: Add 'luks' to the FileTypeInfo
      
      The storage file probing code is modified so that it can probe
      the actual encryption formats explicitly, rather than merely
      probing existance of encryption and letting the storage driver
      guess the format.
      
      The rest of the code is then adapted to deal with
      VIR_STORAGE_FILE_RAW w/ VIR_STORAGE_ENCRYPTION_FORMAT_LUKS
      instead of just VIR_STORAGE_FILE_LUKS.
      
      The commit mentioned above was included in libvirt v2.0.0.
      So when querying volume XML this will be a change in behaviour
      vs the 2.0.0 release - it'll report 'raw' instead of 'luks'
      for the volume format, but still report 'luks' for encryption
      format.  I think this change is OK because the storage driver
      did not include any support for creating volumes, nor starting
      guets with luks volumes in v2.0.0 - that only since then.
      Clearly if we change this we must do it before v2.1.0 though.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a48c7141
    • D
      virstoragefile: refactor virStorageFileMatchesNNN methods · 970f42ab
      Daniel P. Berrange 提交于
      Refactor the virStorageFileMatchesNNN methods so that
      they don't take a struct FileFormatInfo parameter, but
      instead get the actual raw dat items they needs. This
      will facilitate reuse in other contexts.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      970f42ab
  12. 27 7月, 2016 21 次提交
  13. 26 7月, 2016 2 次提交