1. 01 8月, 2016 3 次提交
    • N
      0e8083da
    • S
      qemu: fix domain id after domainCreateWithFlags() · a5c42047
      Sascha Silbe 提交于
      Ever since virDomainCreateWithFlags() was introduced by de3aadaa
      [drivers: add virDomainCreateWithFlags if virDomainCreate exists], the
      domain ID retrieved with virDomainGetID() was incorrect for several
      drivers after virDomainCreateWithFlags() was called. The API consumer
      had to look up the domain anew to retrieve the correct ID.
      
      For the ESX driver, this was fixed in 6139b274 [esx: Update ID after
      starting a domain]. For the openvz driver, it was fixed in fd81a097
      [openvzDomainCreateWithFlags: set domain id to the correct value]. The
      test driver, the OpenNebula driver (removed in the meantime) and the
      vbox driver were already updating the domain ID correctly in
      domainCreate().
      
      Copy over the ID in qemuDomainCreateWithFlags() to fix this for the qemu
      driver, too.
      
      Fixes: de3aadaa ("drivers: add virDomainCreateWithFlags if virDomainCreate exists")
      Reported-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Tested-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      a5c42047
    • P
      tests: qemu: Don't leak security manager object · 71d341e7
      Peter Krempa 提交于
      ==2064442== 200 (88 direct, 112 indirect) bytes in 1 blocks are definitely lost in loss record 54 of 73
      ==2064442==    at 0x4C2E0F0: calloc (vg_replace_malloc.c:711)
      ==2064442==    by 0x18E75B80: virAllocVar (viralloc.c:560)
      ==2064442==    by 0x18EC43B0: virObjectNew (virobject.c:193)
      ==2064442==    by 0x18EC476E: virObjectLockableNew (virobject.c:219)
      ==2064442==    by 0x1906BC73: virSecurityManagerNewDriver (security_manager.c:93)
      ==2064442==    by 0x1906C076: virSecurityManagerNewStack (security_manager.c:115)
      ==2064442==    by 0x43CC39: qemuTestDriverInit (testutilsqemu.c:548)
      ==2064442==    by 0x4337ED: mymain (qemumonitorjsontest.c:2440)
      ==2064442==    by 0x43BABE: virTestMain (testutils.c:982)
      ==2064442==    by 0x43A490: main (qemumonitorjsontest.c:2558)
      71d341e7
  2. 29 7月, 2016 2 次提交
    • M
      conf: Catch invalid memory model earlier · 1e058463
      Michal Privoznik 提交于
      Consider the following XML snippet:
      
          <memory model=''>
            <target>
              <size unit='KiB'>523264</size>
              <node>0</node>
            </target>
          </memory>
      
      Whats wrong you ask? The @model attribute. This should result in
      an error thrown into users faces during virDomainDefine phase.
      Except it doesn't. The XML validation catches this error, but if
      users chose to ignore that, they will end up with invalid XML.
      Well, they won't be able to start the machine - that's when error
      is produced currently. But it would be nice if we could catch the
      error like this earlier.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1e058463
    • E
      admin: Fix default uri config option name s/admin_uri_default/uri_default · f5f32bcd
      Erik Skultety 提交于
      The original name 'admin_uri_default' was introduced to our code by commit
      dbecb87f. However, at that time we already had a separate config file for
      admin library but the commit mentioned above didn't properly adjust the
      config's option name. The result is that when we're loading the config, we
      check a non-existent config option (there's not much to do with the URIs
      anyway, since we only allow local connection). Additionally, virt-admin's man
      page documents, that the default URI can be altered by setting
      admin_uri_default option. So the fix proposed by this patch leaves the
      libvirt-admin.conf as is and adjusts the naming in the code as well as in the
      virt-admin's man page.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      f5f32bcd
  3. 28 7月, 2016 13 次提交
    • M
      wireshark: Adapt to dissector function header change · 98aefa81
      Michal Privoznik 提交于
      In wireshark commit bbdd89b9 (contained in 2.1.0 release) they
      have changed prototype of dissector function. Now it returns
      number of bytes consumed by the dissector, and can get a pointer
      to user specified data (which we don't use).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      98aefa81
    • J
      qemu: Need to free fileprops in error path · 8ad7eceb
      John Ferlan 提交于
      The virJSONValueObjectCreate only consumes the object on success, so on
      failure we must free - from commit id 'f4441017' (found by Coverity).
      8ad7eceb
    • J
      iscsi: Establish connection to target via static target login · 5d8c31c6
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1356436
      
      Commit id '56057900' altered the discovery of iSCSI node targets by
      using the "--op nonpersistent". This caused issues for clean environments
      or if by chance a "-m node -o delete" was executed.
      
      Since each iSCSI Storage Pool has the required iSCSI target path, use
      that and the virISCSINodeNew API in order to generate the iSCSI node record.
      5d8c31c6
    • 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
    • E
      tools: Make use of the correct environment variables · d02ef334
      Erik Skultety 提交于
      Since commit 834c5720 which extracted the generic functionality out of virsh
      and made it available for other clients like virt-admin to make use of it, it
      also introduced a bug when it renamed the original VIRSH_ environment variables
      to VSH_ variables. Virt-admin of course suffers from the same bug, so this
      patch modifies the generic module vsh.c to construct the correct name for
      environment variables of each client from information it has.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357363Signed-off-by: NErik Skultety <eskultet@redhat.com>
      d02ef334
    • E
      vsh: Make vshInitDebug return int instead of void · 0ef07e19
      Erik Skultety 提交于
      Well, the reason behind this change is that if the function is extended in some
      way that e.g. would involve allocation we do not have a way of telling it to
      the caller. More specifically, vshInitDebug only relies on some hardcoded
      environment variables (by a mistake) that aren't documented anywhere so neither
      virsh's nor virt-admin's documented environment variables take effect. One
      possible solution would be duplicate the code for each CLI client or leave the
      method be generic and provide means that it could figure out, which client
      called it, thus initializing the proper environment variables but that could
      involve operations that might as well fail in certain circumstances and the
      caller should know that an error occurred.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      0ef07e19
    • D
      Refresh translations from zanata · 1db6908a
      Daniel P. Berrange 提交于
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1db6908a
    • M
      vshReadlineParse: Drop some unused variables · ea2ad171
      Michal Privoznik 提交于
      My compiler identified some variables that were set, but never
      actually used. For instance, opts_required, and data_acomplete.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ea2ad171
    • M
      vshCmddefGetOption: Change type of opt_index · 2bc97f27
      Michal Privoznik 提交于
      This function tries to look up desired option for a given parsed
      command. Upon successful return it also stores option position
      into passed *opt_index. Now, this variable is type of int, even
      though it is never ever used to store negative value. Moreover,
      the variable is set from a local variable which is type of
      size_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2bc97f27
    • D
    • D
      Fix RPM spec for wireshark on Fedora < 24 · 8035bf71
      Daniel P. Berrange 提交于
      This previous commit
      
        commit cd9fcc8b
        Author: Michal Privoznik <mprivozn@redhat.com>
        Date:   Wed Jul 27 16:58:32 2016 +0200
      
          libvirt.spec.in: Adapt to newest wireshark plugindir
      
      Adapted the libvirt spec for wireshark >= 2.1.0 but
      this ignored the fact that we enable wireshark from
      Fedora 21 and 2.1.0 was only added in Fedora 24
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8035bf71
    • 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
  4. 27 7月, 2016 22 次提交