1. 04 2月, 2015 6 次提交
  2. 03 2月, 2015 4 次提交
    • P
      virutil: fix MinGW build · 47dd6c43
      Pavel Hrdina 提交于
      Commit b38da584 introduced two new functions to get a page size but it
      won't work on Windows. We should take care of this.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      47dd6c43
    • P
      virnetdev: fix some issues found by coverity and mingw builds · 8bda9035
      Pavel Hrdina 提交于
      Commit e562a61a introduced new function to get/set interface state but
      there was misuse of ATTRIBUTE_NONNULL on non-pointer attributes and also
      we need to wrap that functions by #ifdef to not break mingw build.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      8bda9035
    • D
      Make tests independant of system page size · b38da584
      Daniel P. Berrange 提交于
      Some code paths have special logic depending on the page size
      reported by sysconf, which in turn affects the test results.
      We must mock this so tests always have a consistent page size.
      b38da584
    • L
      util: make virNetDev(Get|Set)IFFlags() static · df2cc650
      Laine Stump 提交于
      e562a61a added these two new helper functions and only used them
      within virnetdev.c, but declared them in the .h file. If some
      currently unsupported interface flags need to be accessed in the
      future, it will make more sense to write the appropriate higher level
      function rather than require us to artificially define IFF_* on some
      mythical platform that doesn't have SIOC[SG]IFFLAGS (and therefore
      doesn't have IFF_*) just so we can call virNetDevSetIFFFlags() to
      return an error.
      
      To help someone in not going down the wrong road, this patch makes the
      two helper functions static, hopefully making it less likely that
      someone will want to use them outside of virnetdev.c.
      df2cc650
  3. 31 1月, 2015 14 次提交
  4. 30 1月, 2015 7 次提交
    • M
      xend: Don't crash in virDomainXMLDevID · cd7702d4
      Michal Privoznik 提交于
      The function is called from all {Attach,Update,Detach}Device APIs to
      create config strings that are later passed to the xend to perform the
      desired action. The function is intended to handle all supported
      devices. However, as of 5b05358a we
      are trying to get disk driver of the device without checking if the
      device really is a disk. This leads to an segmentation fault:
      
        #0 0x00007ffff7571815 in virDomainDiskGetDriver () from /usr/lib/libvirt.so.0
        #1 0x00007fffeb9ad471 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #2 0x00007fffeb9b1062 in xenDaemonAttachDeviceFlags () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #3 0x00007fffeb9a8a86 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #4 0x00007ffff7609266 in virDomainAttachDevice () from /usr/lib/libvirt.so.0
        #5 0x0000555555593c9d in ?? ()
        #6 0x00007ffff76743c9 in virNetServerProgramDispatch () from /usr/lib/libvirt.so.0
        #7 0x00005555555a678d in ?? ()
        #8 0x00007ffff755460e in ?? () from /usr/lib/libvirt.so.0
        #9 0x00007ffff7553b06 in ?? () from /usr/lib/libvirt.so.0
        #10 0x00007ffff4998b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
        #11 0x00007ffff46e30ed in clone () from /lib/x86_64-linux-gnu/libc.so.6
        #12 0x0000000000000000 in ?? ()
      Reported-by: NXiaolin Su <linxxnil@126.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cd7702d4
    • M
      conf: Don't mangle vcpu placement randomly · bbd3eb50
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1170492
      
      In one of our previous commits (dc8b7ce7) we've done a functional
      change even though it was intended as pure refactor. The problem is,
      that the following XML:
      
       <vcpu placement='static' current='2'>6</vcpu>
       <cputune>
         <emulatorpin cpuset='1-3'/>
       </cputune>
       <numatune>
         <memory mode='strict' placement='auto'/>
       </numatune>
      
      gets translated into this one:
      
       <vcpu placement='auto' current='2'>6</vcpu>
       <cputune>
         <emulatorpin cpuset='1-3'/>
       </cputune>
       <numatune>
         <memory mode='strict' placement='auto'/>
       </numatune>
      
      We should not change the vcpu placement mode. Moreover, we're doing
      something similar in case of emulatorpin and iothreadpin. If they were
      set, but vcpu placement was auto, we've mistakenly removed them from
      the domain XML even though we are able to set them independently on
      vcpus.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      bbd3eb50
    • T
      qemu: change macvtap device options in response to NIC_RX_FILTER_CHANGED · 79a87694
      Tony Krowiak 提交于
      This patch enables synchronization of the host macvtap
      device options with the guest device's in response to the
      NIC_RX_FILTER_CHANGED event.
      
      The following device options will be synchronized:
      * PROMISC
      * MULTICAST
      * ALLMULTI
      Signed-off-by: NTony Krowiak <akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      79a87694
    • T
      util: Functions for getting/setting device options · e562a61a
      Tony Krowiak 提交于
      This patch provides the utility functions needed to synchronize
      the rxfilter changes made to a guest domain with the corresponding
      macvtap devices on the host:
      
      * Get/set PROMISC flag
      * Get/set ALLMULTI, MULTICAST
      Signed-off-by: NTony Krowiak <akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e562a61a
    • J
      qemu: Don't unconditionally delete file in qemuOpenFileAs · 7879d031
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1158034
      
      If we're expecting to create a file somewhere and that fails for some
      reason during qemuOpenFileAs, then we unlink the path we're attempting
      to create leaving no way to determine what the "existing" privileges,
      protections, or labels are that caused the failure (open, change owner
      and group, change mode, etc.).
      
      Furthermore, if we fall into the path where we'll be opening / creating
      the file using VIR_FILE_OPEN_FORK, we need to first unlink/delete the file
      we created in the first path; otherwise, the attempt by the child process
      to open as some specific user:group may fail because the file was already
      created using nfsnobody:nfsnobody. Again, if we didn't create the file we
      don't want to blindly delete what already exists. Thus, a second reason for
      the original check to set need_unlink to false when we find the file with
      CREAT set, but already existing.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7879d031
    • J
      virfile: Need to check for ENOTCONN from recvfd failure · 29946e3e
      John Ferlan 提交于
      A gnulib change (commit id 'beae0bdc') causes ENOTCONN to be returned
      from recvfd which causes us to fall into the throwaway waitpid() call
      and return ENOTCONN to the caller, this then gets displayed during
      a 'virsh save' when using a root squashed NFS environment that's trying
      to save the file as something other than root:root.
      
      This patch will add the additional check for ENOTCONN to force the code
      into the waitpid loop looking for the actual status from the _exit()'d
      child fork.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      29946e3e
    • J
      qemu: Adjust EndAsyncJob for qemuDomainSaveInternal error path · 8ff38336
      John Ferlan 提交于
      Commit id '540c339a' to fix issues with reference counting and transient
      domains moved the qemuDomainObjEndAsyncJob call prior to the attempt to
      restart the guest CPU's resulting in an error:
      
          error: Failed to save domain rhel70 to /tmp/pl/rhel70.save
          error: internal error: unexpected async job 3
      
      when (ret != 0) - eg, the error path from qemuDomainSaveMemory.
      
      This patch will adjust the logic to call the EndAsyncJob only after
      we've tried to restart the guest CPUs. It also needs to adjust the
      test for qemuDomainRemoveInactive to add the ret == 0 condition.
      
      Additionally, if we get to endjob: because of some error earlier, then
      we need to save that error in the event the CPU restart logic fails.
      We don't want to return the error from CPU restart failure, rather we
      want to return the error from the failed save that caused us to fall
      into the retry to start the CPU logic.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8ff38336
  5. 29 1月, 2015 9 次提交
    • M
      schemas: Allow all generic elements and attributes for all interfaces · 52222568
      Michal Privoznik 提交于
      There are some interface types (notably 'server' and 'client')
      which instead of allowing the default set of elements and
      attributes (like the rest do), try to enumerate only the elements
      they know of. This way it's, however, easy to miss something. For
      instance, the <address/> element was not mentioned at all. This
      resulted in a strange behavior: when such interface was added
      into XML, the address was automatically generated by parsing
      code. Later, the formatted XML hasn't passed the RNG schema. This
      became more visible once we've turned on the XML validation on
      domain XML changes: appending an empty line at the end of
      formatted XML (to trick virsh think the XML had changed) made
      libvirt to refuse the very same XML it formatted.
      
      Instead of trying to find each element and attribute we are
      missing in the schema, lets just allow all the elements and
      attributes like we're doing that for the rest of types. It's no
      harm if the schema is wider than our parser allows.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      52222568
    • M
      qemu: Add AAVMF to the list of known UEFIs · 436dcf0b
      Michal Privoznik 提交于
      Well, even though users can pass the list of UEFI:NVRAM pairs at the
      configure time, we may maintain the list of widely available UEFI
      ourselves too. And as arm64 begin to rises, OVMF was ported there too.
      With a slight name change - it's called AAVMF, with AAVMF_CODE.fd
      being the UEFI firmware and AAVMF_VARS.fd being the NVRAM store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      436dcf0b
    • M
      qemu: Allow UEFI paths to be specified at compile time · bc03a231
      Michal Privoznik 提交于
      Up until now there are just two ways how to specify UEFI paths to
      libvirt. The first one is editing qemu.conf, the other is editing
      qemu_conf.c and recompile which is not that fancy. So, new
      configure option is introduced: --with-loader-nvram which takes a
      list of pairs of UEFI firmware and NVRAM store. This way, the
      compiled in defaults can be passed during compile time without
      need to change the code itself.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      bc03a231
    • J
      Fix syntax-check · 9783c20c
      Ján Tomko 提交于
      My commit 08d1ae16 broke syntax-check by adding ATTRIBUTE_UNUSED
      to the flags parameter.
      
      Rename the parameter to unused_flags to bypass the check.
      9783c20c
    • J
      Remove flag checking in MacVLanCreate helper stub · 08d1ae16
      Ján Tomko 提交于
      When compiling without WITH_MACVTAP, we can get:
      'unsupported flags (0x1) in function
      virNetDevMacVLanCreateWithVPortProfile'
      on an attempt to start a domain.
      
      Remove the flag check to reach the more helpful error:
      Cannot create macvlan devices on this platform
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1186928
      08d1ae16
    • P
      virsh: man: Document behavior of some blkdeviotune's flags when querying · 00af2381
      Peter Krempa 提交于
      --live and --config can't be specified together when querying the
      configuration, but are valid when setting. The man page was hinting that
      they are valid always.
      00af2381
    • P
      util: bitmap: Tolerate NULL bitmaps in virBitmapEqual · 20448c2a
      Peter Krempa 提交于
      After virBitmapEqual is able to compare NULL bitmaps few bits of code
      can be cleaned up.
      20448c2a
    • J
      storage: Check the partition name against provided name · 9bbbb912
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1138516
      
      If the provided volume name doesn't match what parted generated as the
      partition name, then return a failure.
      
      Update virsh.pod and formatstorage.html.in to describe the 'name' restriction
      for disk pools as well as the usage of the <target>'s <format type='value'>.
      9bbbb912
    • J
      storage: When delete extended partition, need to refresh pool · 471e1c4e
      John Ferlan 提交于
      When removing a volume that is the extended partition, all the logical
      volume partitions that exist within the extended partition will also be
      removed, so we need to refresh the pool to have the updated list
      471e1c4e