1. 15 12月, 2015 5 次提交
    • A
      pci: Use 'addr' instead of 'dev' for virPCIDeviceAddressPtr · 90791fbf
      Andrea Bolognani 提交于
      The name 'dev' is more appropriate for virPCIDevicePtr.
      90791fbf
    • M
      qemuMonitorJSONEjectMedia: Don't leak stringified reply · c4073657
      Michal Privoznik 提交于
      The return value of virJSONValueToString() should be freed when
      no longer needed. This is not the case after 256496e1.
      
      ==26902== 138 bytes in 2 blocks are definitely lost in loss record 1,051 of 1,239
      ==26902==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==26902==    by 0xAA5F599: strdup (in /lib64/libc-2.21.so)
      ==26902==    by 0x552BAD9: virStrdup (virstring.c:726)
      ==26902==    by 0x54F60A7: virJSONValueToString (virjson.c:1790)
      ==26902==    by 0x1DF6EBB9: qemuMonitorJSONEjectMedia (qemu_monitor_json.c:2225)
      ==26902==    by 0x1DF57A4C: qemuMonitorEjectMedia (qemu_monitor.c:1985)
      ==26902==    by 0x1DF1EF2D: qemuDomainChangeEjectableMedia (qemu_hotplug.c:199)
      ==26902==    by 0x1DF90314: qemuDomainChangeDiskLive (qemu_driver.c:7985)
      ==26902==    by 0x1DF90476: qemuDomainUpdateDeviceLive (qemu_driver.c:8030)
      ==26902==    by 0x1DF91ED7: qemuDomainUpdateDeviceFlags (qemu_driver.c:8677)
      ==26902==    by 0x561785F: virDomainUpdateDeviceFlags (libvirt-domain.c:8559)
      ==26902==    by 0x134210: remoteDispatchDomainUpdateDeviceFlags (remote_dispatch.h:10966)
      
      ==26902== 106 bytes in 1 blocks are definitely lost in loss record 1,033 of 1,239
      ==26902==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==26902==    by 0xAA5F599: strdup (in /lib64/libc-2.21.so)
      ==26902==    by 0x552BAD9: virStrdup (virstring.c:726)
      ==26902==    by 0x54F60A7: virJSONValueToString (virjson.c:1790)
      ==26902==    by 0x1DF6EC0C: qemuMonitorJSONEjectMedia (qemu_monitor_json.c:2227)
      ==26902==    by 0x1DF57A4C: qemuMonitorEjectMedia (qemu_monitor.c:1985)
      ==26902==    by 0x1DF1EF2D: qemuDomainChangeEjectableMedia (qemu_hotplug.c:199)
      ==26902==    by 0x1DF90314: qemuDomainChangeDiskLive (qemu_driver.c:7985)
      ==26902==    by 0x1DF90476: qemuDomainUpdateDeviceLive (qemu_driver.c:8030)
      ==26902==    by 0x1DF91ED7: qemuDomainUpdateDeviceFlags (qemu_driver.c:8677)
      ==26902==    by 0x561785F: virDomainUpdateDeviceFlags (libvirt-domain.c:8559)
      ==26902==    by 0x134210: remoteDispatchDomainUpdateDeviceFlags (remote_dispatch.h:10966)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c4073657
    • H
      qemu cgroups: move new threads to new cgroup after cpuset is set up · 90b721e4
      Henning Schild 提交于
      Moving tasks to cgroups implied sched_setaffinity. Changing the cpus in
      a set implies the same for all tasks in the group.
      The old code put the the thread into the cpuset inherited from the
      machine cgroup, which allowed it to run outside of vcpupin for a short
      while.
      Signed-off-by: NHenning Schild <henning.schild@siemens.com>
      90b721e4
    • H
      qemu: do not put a task into machine cgroup · a41c00b4
      Henning Schild 提交于
      The machine cgroup is a superset, a parent to the emulator and vcpuX
      cgroups. The parent cgroup should never have any tasks directly in it.
      In fact the parent cpuset might contain way more cpus than the sum of
      emulatorpin and vcpupins. So putting tasks in the superset will allow
      them to run outside of <cputune>.
      Signed-off-by: NHenning Schild <henning.schild@siemens.com>
      a41c00b4
    • H
      util: cgroups do not implicitly add task to new machine cgroup · 71ce4759
      Henning Schild 提交于
      virCgroupNewMachine used to add the pidleader to the newly created
      machine cgroup. Do not do this implicit anymore.
      Signed-off-by: NHenning Schild <henning.schild@siemens.com>
      71ce4759
  2. 14 12月, 2015 2 次提交
  3. 13 12月, 2015 1 次提交
    • M
      virNetDevMacVLanTapSetup: Work around older systems · ec93cc25
      Michal Privoznik 提交于
      Some older systems, e.g. RHEL-6 do not have IFF_MULTI_QUEUE flag
      which we use to enable multiqueue feature. Therefore one gets the
      following compile error there:
      
        CC     util/libvirt_util_la-virnetdevmacvlan.lo
      util/virnetdevmacvlan.c: In function 'virNetDevMacVLanTapSetup':
      util/virnetdevmacvlan.c:338: error: 'IFF_MULTI_QUEUE' undeclared (first use in this function)
      util/virnetdevmacvlan.c:338: error: (Each undeclared identifier is reported only once
      util/virnetdevmacvlan.c:338: error: for each function it appears in.)
      make[3]: *** [util/libvirt_util_la-virnetdevmacvlan.lo] Error 1
      
      So, whenever user wants us to enable the feature on such systems,
      we will just throw a runtime error instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ec93cc25
  4. 12 12月, 2015 1 次提交
    • E
      CVE-2015-5313: storage: don't allow '/' in filesystem volume names · 034e47c3
      Eric Blake 提交于
      The libvirt file system storage driver determines what file to
      act on by concatenating the pool location with the volume name.
      If a user is able to pick names like "../../../etc/passwd", then
      they can escape the bounds of the pool.  For that matter,
      virStoragePoolListVolumes() doesn't descend into subdirectories,
      so a user really shouldn't use a name with a slash.
      
      Normally, only privileged users can coerce libvirt into creating
      or opening existing files using the virStorageVol APIs; and such
      users already have full privilege to create any domain XML (so it
      is not an escalation of privilege).  But in the case of
      fine-grained ACLs, it is feasible that a user can be granted
      storage_vol:create but not domain:write, and it violates
      assumptions if such a user can abuse libvirt to access files
      outside of the storage pool.
      
      Therefore, prevent all use of volume names that contain "/",
      whether or not such a name is actually attempting to escape the
      pool.
      
      This changes things from:
      
      $ virsh vol-create-as default ../../../../../../etc/haha --capacity 128
      Vol ../../../../../../etc/haha created
      $ rm /etc/haha
      
      to:
      
      $ virsh vol-create-as default ../../../../../../etc/haha --capacity 128
      error: Failed to create vol ../../../../../../etc/haha
      error: Requested operation is not valid: volume name '../../../../../../etc/haha' cannot contain '/'
      Signed-off-by: NEric Blake <eblake@redhat.com>
      034e47c3
  5. 11 12月, 2015 10 次提交
  6. 10 12月, 2015 6 次提交
    • J
      storage: Ignore block devices that fail format detection · a523770c
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1276198
      
      Prior to commit id '98322052' failure to saferead the block device would
      cause an error to be logged and the device to be skipped while attempting
      to discover/create a stable target path for a new LUN (NPIV).
      
      This was because virStorageBackendSCSIFindLUs ignored errors from
      processLU and virStorageBackendSCSINewLun.
      
      Ignoring the failure allowed a multipath device with an "active" and
      "ghost" to be present on the host with the "ghost" block device being
      ignored. This patch will return a -2 to the caller indicating the desire
      to ignore the block device since it cannot be used directly rather than
      fail the pool startup.
      a523770c
    • J
      storage: Add debug message · b3df72c4
      John Ferlan 提交于
      I found this useful while processing a volume that wouldn't end up
      showing up in the resulting list of block volumes. In this case, the
      partition type wasn't found in the disk_types table.
      b3df72c4
    • J
      storage: Handle readflags errors · 1bc84b0a
      John Ferlan 提交于
      Similar to the openflags VIR_STORAGE_VOL_OPEN_NOERROR processing, if some
      read processing operation fails, check the readflags for the corresponding
      error flag being set. If so, rather then causing an error - use VIR_WARN
      to flag the error, but return -2 which some callers can use to perform
      specific actions. Use a new VIR_STORAGE_VOL_READ_NOERROR flag in a new
      VolReadErrorMode enum.
      1bc84b0a
    • J
      storage: Set ret = -1 on failures in virStorageBackendUpdateVolTargetInfo · 1edfce9b
      John Ferlan 提交于
      While processing the volume for lseek, virFileReadHeaderFD, and
      virStorageFileGetMetadataFromBuf - failure would cause an error,
      but ret would not be set. That would result in an error message being
      sent, but successful status being returned.
      1edfce9b
    • J
      storage: Add comments for backend APIs · af4028dc
      John Ferlan 提交于
      Just so it's clearer what to expect upon input and what types of return
      values could be generated.  These were loosely copied from existing
      virStorageBackendUpdateVolTargetInfoFD.
      af4028dc
    • J
      storage: Add readflags for backend error processing · 22346003
      John Ferlan 提交于
      Similar to the openflags which allow VIR_STORAGE_VOL_OPEN_NOERROR to be
      passed to avoid open errors, add a 'readflags' variable so that in the
      future read failures could also be ignored.
      22346003
  7. 09 12月, 2015 15 次提交