1. 24 8月, 2015 1 次提交
  2. 10 7月, 2015 4 次提交
  3. 08 7月, 2015 1 次提交
  4. 02 7月, 2015 1 次提交
  5. 21 4月, 2015 2 次提交
  6. 14 4月, 2015 1 次提交
  7. 14 2月, 2015 1 次提交
  8. 13 2月, 2015 2 次提交
  9. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  10. 11 12月, 2014 2 次提交
  11. 09 12月, 2014 1 次提交
    • J
      security: Manage SELinux labels on shared/readonly hostdev's · f36d9285
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1082521
      
      Support for shared hostdev's was added in a number of commits, initially
      starting with 'f2c1d9a8' and most recently commit id 'fd243fc4' to fix
      issues with the initial implementation.  Missed in all those changes was
      the need to mimic the virSELinux{Set|Restore}SecurityDiskLabel code to
      handle the "shared" (or shareable) and readonly options when Setting
      or Restoring the SELinux labels.
      
      This patch will adjust the virSecuritySELinuxSetSecuritySCSILabel to not
      use the virSecuritySELinuxSetSecurityHostdevLabelHelper in order to set
      the label. Rather follow what the Disk code does by setting the label
      differently based on whether shareable/readonly is set.  This patch will
      also modify the virSecuritySELinuxRestoreSecuritySCSILabel to follow
      the same logic as virSecuritySELinuxRestoreSecurityImageLabelInt and not
      restore the label if shared/readonly
      f36d9285
  12. 25 11月, 2014 3 次提交
  13. 15 11月, 2014 2 次提交
  14. 30 10月, 2014 1 次提交
  15. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in helpers · ff99c791
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/conf/nwfilter_conf.c: Fix initialization.
      * src/cpu/cpu_x86.c: Likewise.
      * src/interface/interface_backend_netcf.c: Likewise.
      * src/locking/lock_daemon.c: Likewise.
      * src/locking/lock_driver_lockd.c: Likewise.
      * src/locking/lock_driver_sanlock.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/rpc/virnetserver.c: Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxGenSecurityLabel): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff99c791
  16. 08 10月, 2014 1 次提交
    • M
      security_selinux: Don't relabel /dev/net/tun · ebc05263
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1147057
      
      The code for relabelling the TAP FD is there due to a race. When
      libvirt creates a /dev/tapN device it's labeled as
      'system_u:object_r:device_t:s0' by default. Later, when
      udev/systemd reacts to this device, it's relabelled to the
      expected label 'system_u:object_r:tun_tap_device_t:s0'. Hence, we
      have a code that relabels the device, to cut the race down. For
      more info see ae368ebf.
      
      But the problem is, the relabel function is called on all TUN/TAP
      devices. Yes, on /dev/net/tun too. This is however a special kind
      of device - other processes uses it too. We shouldn't touch it's
      label then.
      
      Ideally, there would an API in SELinux that would label just the
      passed FD and not the underlying path. That way, we wouldn't need
      to care as we would be not labeling /dev/net/tun but the FD
      passed to the domain. Unfortunately, there's no such API so we
      have to workaround until then.
      Tested-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ebc05263
  17. 25 9月, 2014 1 次提交
  18. 24 9月, 2014 1 次提交
    • P
      util: storage: Allow metadata crawler to report useful errors · b8549877
      Peter Krempa 提交于
      Add a new parameter to virStorageFileGetMetadata that will break the
      backing chain detection process and report useful error message rather
      than having to use virStorageFileChainGetBroken.
      
      This patch just introduces the option, usage will be provided
      separately.
      b8549877
  19. 19 9月, 2014 1 次提交
    • M
      virSecuritySELinuxSetTapFDLabel: Temporarily revert to old behavior · ba7468db
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1141879
      
      A long time ago I've implemented support for so called multiqueue
      net.  The idea was to let guest network traffic be processed by
      multiple host CPUs and thus increasing performance. However, this
      behavior is enabled by QEMU via special ioctl() iterated over the
      all tap FDs passed in by libvirt. Unfortunately, SELinux comes in
      and disallows the ioctl() call because the /dev/net/tun has label
      system_u:object_r:tun_tap_device_t:s0 and 'attach_queue' ioctl()
      is not allowed on tun_tap_device_t type. So after discussion with
      a SELinux developer we've decided that the FDs passed to the QEMU
      should be labelled with svirt_t type and SELinux policy will
      allow the ioctl(). Therefore I've made a patch
      (cf976d9d) that does exactly this. The patch
      was fixed then by a4431931 and
      b635b7a1. However, things are not
      that easy - even though the API to label FD is called
      (fsetfilecon_raw) the underlying file is labelled too! So
      effectively we are mangling /dev/net/tun label. Yes, that broke
      dozen of other application from openvpn, or boxes, to qemu
      running other domains.
      
      The best solution would be if SELinux provides a way to label an
      FD only, which could be then labeled when passed to the qemu.
      However that's a long path to go and we should fix this
      regression AQAP. So I went to talk to the SELinux developer again
      and we agreed on temporary solution that:
      
      1) All the three patches are reverted
      2) SELinux temporarily allows 'attach_queue' on the
      tun_tap_device_t
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ba7468db
  20. 11 9月, 2014 2 次提交
    • M
      nvram: Fix permissions · 37d8c75f
      Michal Privoznik 提交于
      I've noticed two problem with the automatically created NVRAM varstore
      file. The first, even though I run qemu as root:root for some reason I
      get Permission denied when trying to open the _VARS.fd file. The
      problem is, the upper directory misses execute permissions, which in
      combination with us dropping some capabilities result in EPERM.
      
      The next thing is, that if I switch SELinux to enforcing mode, I get
      another EPERM because the vars file is not labeled correctly. It is
      passed to qemu as disk and hence should be labelled as disk. QEMU may
      write to it eventually, so this is different to kernel or initrd.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      37d8c75f
    • M
      selinux: Properly check TAP FD label · b635b7a1
      Michal Privoznik 提交于
      After a4431931 the TAP FDs ale labeled with image label instead
      of the process label. On the other hand, the commit was
      incomplete as a few lines above, there's still old check for the
      process label presence while it should be check for the image
      label instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b635b7a1
  21. 10 9月, 2014 2 次提交
    • M
      qemu: Implement extended loader and nvram · 54289916
      Michal Privoznik 提交于
      QEMU now supports UEFI with the following command line:
      
        -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
        -drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
      
      where the first line reflects <loader> and the second one <nvram>.
      Moreover, these two lines obsolete the -bios argument.
      
      Note that UEFI is unusable without ACPI. This is handled properly now.
      Among with this extension, the variable file is expected to be
      writable and hence we need security drivers to label it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      54289916
    • M
      conf: Extend <loader/> and introduce <nvram/> · 68bf13db
      Michal Privoznik 提交于
      Up to now, users can configure BIOS via the <loader/> element. With
      the upcoming implementation of UEFI this is not enough as BIOS and
      UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
      is programmable flash (although all writes to code section are
      denied). Therefore we need new attribute @type which will
      differentiate the two. Then, new attribute @readonly is introduced to
      reflect the fact that some images are RO.
      
      Moreover, the OVMF (which is going to be used mostly), works in two
      modes:
      1) Code and UEFI variable store is mixed in one file.
      2) Code and UEFI variable store is separated in two files
      
      The latter has advantage of updating the UEFI code without losing the
      configuration. However, in order to represent the latter case we need
      yet another XML element: <nvram/>. Currently, it has no additional
      attributes, it's just a bare element containing path to the variable
      store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68bf13db
  22. 07 9月, 2014 1 次提交
  23. 05 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in remaining spots · d194d6e7
      Eric Blake 提交于
      I'm about to add a syntax check that enforces our documented
      HACKING style of always using matching {} on if-else statements.
      
      This patch focuses on all remaining problems, where there weren't
      enough issues to warrant splitting it further.
      
      * src/remote/remote_driver.c (doRemoteOpen): Correct use of {}.
      * src/security/virt-aa-helper.c (vah_add_path, valid_path, main):
      Likewise.
      * src/rpc/virnetsocket.c (virNetSocketNewConnectLibSSH2):
      Likewise.
      * src/esx/esx_vi_types.c (esxVI_Type_FromString): Likewise.
      * src/uml/uml_driver.c (umlDomainDetachDevice): Likewise.
      * src/util/viralloc.c (virShrinkN): Likewise.
      * src/util/virbuffer.c (virBufferURIEncodeString): Likewise.
      * src/util/virdbus.c (virDBusCall): Likewise.
      * src/util/virnetdev.c (virNetDevValidateConfig): Likewise.
      * src/util/virnetdevvportprofile.c
      (virNetDevVPortProfileGetNthParent): Likewise.
      * src/util/virpci.c (virPCIDeviceIterDevices)
      (virPCIDeviceWaitForCleanup)
      (virPCIDeviceIsBehindSwitchLackingACS): Likewise.
      * src/util/virsocketaddr.c (virSocketAddrGetNumNetmaskBits):
      Likewise.
      * src/util/viruri.c (virURIParseParams): Likewise.
      * daemon/stream.c (daemonStreamHandleAbort): Likewise.
      * tests/testutils.c (virtTestResult): Likewise.
      * tests/cputest.c (cpuTestBaseline): Likewise.
      * tools/virsh-domain.c (cmdDomPMSuspend): Likewise.
      * tools/virsh-host.c (cmdNodeSuspend): Likewise.
      * src/esx/esx_vi_generator.py (Type.generate_typefromstring):
      Tweak generated code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d194d6e7
  24. 01 9月, 2014 1 次提交
  25. 20 8月, 2014 2 次提交
    • M
      cleanup spaces between parentheses and braces · 93cf8f98
      Martin Kletzander 提交于
      And add a syntax-check for '){$'.  It's not perfect, but better than
      nothing.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      93cf8f98
    • M
      qemu: Label all TAP FDs · cf976d9d
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1095636
      
      When starting up the domain the domain's NICs are allocated. As of
      1f24f682 (v1.0.6) we are able to use multiqueue feature on virtio
      NICs. It breaks network processing into multiple queues which can be
      processed in parallel by different host CPUs. The queues are, however,
      created by opening /dev/net/tun several times. Unfortunately, only the
      first FD in the row is labelled so when turning the multiqueue feature
      on in the guest, qemu will get AVC denial. Make sure we label all the
      FDs needed.
      
      Moreover, the default label of /dev/net/tun doesn't allow
      attaching a queue:
      
          type=AVC msg=audit(1399622478.790:893): avc:  denied  { attach_queue }
          for  pid=7585 comm="qemu-kvm"
          scontext=system_u:system_r:svirt_t:s0:c638,c877
          tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023
          tclass=tun_socket
      
      And as suggested by SELinux maintainers, the tun FD should be labeled
      as svirt_t. Therefore, we don't need to adjust any range (as done
      previously by Guannan in ae368ebf) rather set the seclabel of the
      domain directly.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cf976d9d
  26. 24 7月, 2014 3 次提交
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSIiSCSI · 17bddc46
      John Ferlan 提交于
      Create the structures and API's to hold and manage the iSCSI host device.
      This extends the 'scsi_host' definitions added in commit id '5c811dce'.
      A future patch will add the XML parsing, but that code requires some
      infrastructure to be in place first in order to handle the differences
      between a 'scsi_host' and an 'iSCSI host' device.
      17bddc46
    • 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