1. 16 7月, 2014 5 次提交
    • C
      Rework lxc apparmor profile · 9265f8ab
      Cédric Bosdonnat 提交于
      Rework the apparmor lxc profile abstraction to mimic ubuntu's container-default.
      This profile allows quite a lot, but strives to restrict access to
      dangerous resources.
      
      Removing the explicit authorizations to bash, systemd and cron files,
      forces them to keep the lxc profile for all applications inside the
      container. PUx permissions where leading to running systemd (and others
      tasks) unconfined.
      
      Put the generic files, network and capabilities restrictions directly
      in the TEMPLATE.lxc: this way, users can restrict them on a per
      container basis.
      9265f8ab
    • R
      Implement interface stats for BSD · 61bbdbb9
      Roman Bogorodskiy 提交于
      61bbdbb9
    • R
      util: virstatslinux: make more generic · 5559a8b8
      Roman Bogorodskiy 提交于
      Rename linuxDomainInterfaceStats to virNetInterfaceStats in order
      to allow adding platform specific implementations without
      making consumer worrying about specific implementation to be used.
      
      Also, rename util/virstatslinux.c to util/virstats.c so placing
      other platform specific implementations into this file don't
      look unexpected from the file name.
      5559a8b8
    • C
      libxl: fix return value error Attach|DetachDeviceFlags · 2f97ea32
      Chunyan Liu 提交于
      Code logic in libxlDomainAttachDeviceFlags and libxlDomainDetachDeviceFlags
      is wrong with return value in error cases.
      
      'ret' was being set to 0 if 'flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG' was
      false. Then if something like virDomainDeviceDefParse() failed in the
      VIR_DOMAIN_DEVICE_MODIFY_LIVE logic, the error would be reported but the
      function would return success.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      2f97ea32
    • C
      libxl: support hotplug of <interface> · b0d24540
      Chunyan Liu 提交于
      Add code to support attach/detaching a network device.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      b0d24540
  2. 15 7月, 2014 4 次提交
    • C
      libxl: add HOSTDEV type in libxlDomainDetachDeviceConfig · 232cf2a4
      Chunyan Liu 提交于
      Missing HOSTDEV type in libxlDomainDetachDeviceConfig. Add it.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      232cf2a4
    • J
      spec: Update polkit dependencies for CVE-2013-4311 · 20e01504
      Jiri Denemark 提交于
      Use secured polkit on distros which provide it. However, RHEL-6 will
      still allow for older polkit-0.93 rather than forcing polkit-0.96-5
      which is not available in all RHEL-6 releases.
      20e01504
    • P
      qemu: blockcopy: Initialize correct source structure · 95d6aff7
      Peter Krempa 提交于
      4cc1f1a0 introduced a crash when doing a
      block copy as virStorageSourceInitChainElement was called on
      "disk->mirror" that is still NULL at that point instead of "mirror"
      which temporarily holds the mirror source struct until it's fully
      initialized. This resulted into a crash as a NULL was dereferenced.
      
      Reported by: Shanzi Yu <shyu@redhat.com>
      95d6aff7
    • J
      GetBlockInfo: Use the correct path to qemuOpenFile · 54d4619c
      John Ferlan 提交于
      Commit id '3ea661de' refactored the code to use the 'disk->src->path'
      instead of getting the path from virDomainDiskGetSource().  The one
      call to qemuOpenFile() didn't use the disk source path, rather it used
      the path as passed from the caller (in this case 'vda') - this caused
      a failure with the virt-test/tp-libvirt as follows:
      
      $ virsh domblkinfo virt-tests-vm1 vda
      error: cannot stat file '/home/virt-test/shared/data/images/jeos-20-64.qcow2': Bad file descriptor
      
      $
      54d4619c
  3. 14 7月, 2014 8 次提交
    • E
      capabilities: use bool instead of int · 58156f39
      Eric Blake 提交于
      While preparing to add a capability for active commit, I noticed
      that the existing code was abusing int for boolean values.
      
      * src/conf/capabilities.h (_virCapsGuestFeature, _virCapsHost)
      (virCapabilitiesNew, virCapabilitiesAddGuestFeature): Improve
      types.
      * src/conf/capabilities.c (virCapabilitiesNew)
      (virCapabilitiesAddGuestFeature): Adjust signature.
      * src/bhyve/bhyve_capabilities.c (virBhyveCapsBuild): Update
      clients.
      * src/esx/esx_driver.c (esxCapsInit): Likewise.
      * src/libxl/libxl_conf.c (libxlMakeCapabilities): Likewise.
      * src/lxc/lxc_conf.c (virLXCDriverCapsInit): Likewise.
      * src/openvz/openvz_conf.c (openvzCapsInit): Likewise.
      * src/parallels/parallels_driver.c (parallelsBuildCapabilities):
      Likewise.
      * src/phyp/phyp_driver.c (phypCapsInit): Likewise.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInit)
      (virQEMUCapsInitGuestFromBinary): Likewise.
      * src/security/virt-aa-helper.c (get_definition): Likewise.
      * src/test/test_driver.c (testBuildCapabilities): Likewise.
      * src/uml/uml_conf.c (umlCapsInit): Likewise.
      * src/vbox/vbox_tmpl.c (vboxCapsInit): Likewise.
      * src/vmware/vmware_conf.c (vmwareCapsInit): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorBuildCapabilities):
      Likewise.
      * src/xenapi/xenapi_driver.c (getCapsObject): Likewise.
      * tests/qemucaps2xmltest.c (testGetCaps): Likewise.
      * tests/testutils.c (virTestGenericCapsInit): Likewise.
      * tests/testutilslxc.c (testLXCCapsInit): Likewise.
      * tests/testutilsqemu.c (testQemuCapsInit): Likewise.
      * tests/testutilsxen.c (testXenCapsInit): Likewise.
      * tests/vircaps2xmltest.c (buildVirCapabilities): Likewise.
      * tests/vircapstest.c (buildNUMATopology): Likewise.
      * tests/vmx2xmltest.c (testCapsInit): Likewise.
      * tests/xml2vmxtest.c (testCapsInit): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      58156f39
    • E
      docs: mention more about older capability feature bits · 06cf86e9
      Eric Blake 提交于
      Our documentation for features was rather sparse; this fleshes out
      more of the details for other existing capabilities (and cost me
      some time trawling git history).
      
      * docs/formatcaps.html.in: Document it feature bits.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      06cf86e9
    • C
      openvswitch: Delete port if it exists while adding a new one · 33445ce8
      Chunhe Li 提交于
      If the openvswitch service is stopped, and is followed by destroying a
      VM, the openvswitch bridge translates into a state where it doesn't
      recover the port configuration. While it successfully fetches data
      from the internal DB, since the corresponding virtual interface does
      not exists anymore the whole recovery process fails leaving restarted
      VM with inability to connect to the bridge. The following set of
      commands will trigger the problem:
      
      virsh start vm
      service openvswitch-switch stop
      virsh destroy vm
      service openvswitch-switch start
      virsh start vm
      Signed-off-by: NChunhe Li <lichunhe@huawei.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      33445ce8
    • J
      virseclabel: Resolve Coverity FORWARD_NULL issue · 1c89f6eb
      John Ferlan 提交于
      Resolve issue introduced by commit id '13adf1b2'
      1c89f6eb
    • M
      virSecurityLabelDefParseXML: Rework · da78351b
      Michal Privoznik 提交于
      Instead of allocating the virSecurityLabelDef structure ourselves, we
      can utilize virSecurityLabelDefNew which even sets the default values
      for us.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      da78351b
    • M
      conf: Always format seclabel's model · 99c8d2e8
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1113860
      
      We've always done that. Well, until 990e46c4. Point is, if we don't
      format model, we may lose a domain on libvirtd restart. If the
      seclabel is implicit however, we should skip it's formatting.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      99c8d2e8
    • P
      doc: Be more specific about semantics of _REUSE_EXT flag · 6f04fb15
      Peter Krempa 提交于
      Snapshots and block-copy have a flag that forces qemu to re-use existing
      file. Our docs weren't exactly clear on what the existing file should
      contain for this to actually work.
      
      Re-word the docs a bit to state that the file needs to be pre-created in
      the desired format and the backing chain metadata needs to be set prior
      to handing it over to qemu.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1084360
      6f04fb15
    • P
      doc: Document that snapshot name of block-backed disk isn't autogenerated · 500f80a5
      Peter Krempa 提交于
      Libvirt generates external snapshot target file names for file backed
      storage but not for block backed storage. Document the limitation.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1032363
      500f80a5
  4. 12 7月, 2014 3 次提交
  5. 11 7月, 2014 6 次提交
  6. 10 7月, 2014 4 次提交
    • J
      check for cfg->spiceTLS earlier in qemuProcessSPICEAllocatePorts · b02fca79
      Ján Tomko 提交于
      This saves a few lines of code and catches the error when:
      <spice autoport ='yes' defaultMode='any' ..>
        <channel name='main' mode='secure'/>
      </spice>
      is specified with spice_tls = 0 in qemu.conf.
      
      Instead of this error in qemuBuildGraphicsSPICECommandLine:
      error: unsupported configuration: spice secure channels set in XML
      configuration, but TLS port is not provided
      
      an error is reported in qemuProcessSPICEAllocatePorts:
      error: unsupported configuration: Auto allocation of spice TLS port
      requested but spice TLS is disabled in qemu.conf
      
      Inspired by:
      https://www.redhat.com/archives/libvir-list/2014-June/msg01408.html
      b02fca79
    • E
      build: package .pc files for mingw64 · ddf6b139
      Eric Blake 提交于
      Commit 65d8c92a fixed the mingw spec file for 32-bit builds,
      but forgot to make the adjustment for 64-bit builds:
      
      Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/eblake/rpmbuild/BUILDROOT/mingw-libvirt-1.2.7-1.fc20.eblake1404944503.x86_64
      error: Installed (but unpackaged) file(s) found:
         /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/libvirt-lxc.pc
         /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/libvirt-qemu.pc
      
      * mingw-libvirt.spec.in (%files): List missing .pc files.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ddf6b139
    • E
      build: fix gnulib build for mingw · 0c33633f
      Eric Blake 提交于
      Pavel flagged a build regression under mingw, and traced it to a
      recent flaw in gnulib for working around nl_langinfo. This picks
      up the fix.
      
      * gnulib: Update to latest, for mingw build fixes.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0c33633f
    • O
      libxl: add discard support to libxl_device_disk · 4e7e5e9f
      Olaf Hering 提交于
      Translate libvirt discard settings into libxl-4.5 discard settings.
      Signed-off-by: NOlaf Hering <olaf@aepfle.de>
      4e7e5e9f
  7. 09 7月, 2014 10 次提交
    • M
      qemu: don't error out when cgroups don't exist · 0c04906f
      Martin Kletzander 提交于
      When creating cgroups for vcpu and emulator threads whilst starting a
      domain, we explicitly skip creating those cgroups in case priv->cgroup
      is NULL (cgroups not supported) because SetAffinity() serves the same
      purpose.  If the host supports only some cgroups (the ones we need are
      either unmounted or disabled in qemu.conf), we error out with weird
      message even though we could continue starting the domain.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1097028Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      0c04906f
    • M
      virsh: document the possibility of accepting integers for numatune mode · fd59f6c8
      Martin Kletzander 提交于
      According to the code, 'virsh numatune' supports integers for
      specifying --mode as well as the string definitions "strict",
      "interleave", and "preferred".  However, this possibility was not
      documented anywhere, so this patch adds it to both the man page and
      command help.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1085706Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      fd59f6c8
    • P
      util: storage: Fix build after 25924dec · 61e45dfb
      Peter Krempa 提交于
      The commit referenced above changed function arguments of
      virStorageFileGetMetadataFromBuf() but didn't tweak the
      ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it
      actually obeys them. We disabled them for GCC and thus it didn't show
      up.
      
      Additionally in commit 3ea661de I passed
      NULL to the backingFormat argument which was also marked as nonnull. Use
      a dummy int's address when the argument isn't supplied so that the code
      doesn't need to change much.
      61e45dfb
    • P
      conf: Improve metadata type verification · 37381666
      Peter Krempa 提交于
      Split out checking of invalid metadata type from the switch statement so
      that we can use the typecasted enum value to allow tracking addition of
      new items by the compliler.
      
      Also avoids two dead-code break statements.
      37381666
    • J
      qemu: fix domxml-to-native failing when spice_tls is not enabled · e871ab88
      Jincheng Miao 提交于
      The default graphics channel mode is 'any', so as to defaultMode attribute.
      If defaultMode and channel mode are all the default value 'any',
      qemuConnectDomainXMLToNative will set TLSPort.
      But in qemuBuildGraphicsSPICECommandLine, if spice_tls is not enabled, libvirtd
      will report an error to tell the user that spice TLS is disabled in qemu.conf.
      
      So qemuConnectDomainXMLToNative should check spice_tls is enabled,
      then decide to allocate an tlsPort number to this graphics.
      
      If user specified defaultMode is 'secure', qemuConnectDomainXMLToNative
      could allocate tlsPort, and then let qemuBuildGraphicsSPICECommandLine reports
      the spice_tls disabled error.
      
      The related bug is:
      https://bugzilla.redhat.com/show_bug.cgi?id=1113868Signed-off-by: NJincheng Miao <jmiao@redhat.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      e871ab88
    • P
      qemu: snapshot: Refactor image labelling of new snapshot files · 52c21204
      Peter Krempa 提交于
      Now that cgroups/security driver/locking driver support labelling of
      individual images and tolerate network storage we don't have to refrain
      from passing all image files to it. This allows removing the checking
      code as we already make sure that the snapshot function won't be called
      with unsupported options.
      52c21204
    • P
      qemu: Refactor qemuDomainPrepareDiskChainElement · 66df8bf4
      Peter Krempa 提交于
      Now that security, cgroup and locking APIs support working on individual
      images and we track the backing chain security info on a per-image basis
      we can finally kill swapping the disk source in virDomainDiskDef and use
      the virStorageSource directly.
      66df8bf4
    • P
      qemu: snapshot: Improve approach to deal with snapshot metadata · 363e9a68
      Peter Krempa 提交于
      Until now we were changing information about the disk source via
      multiple steps of copying data. Now that we changed to a pointer to
      store the disk source we might use it to change the approach to track
      the data.
      
      Additionally this will allow proper tracking of the backing chain.
      363e9a68
    • P
      qemu: block: Properly track disk source while pivoting to new image · 4cc1f1a0
      Peter Krempa 提交于
      When pivoting to a new disk source after a block commit (and possibly
      after a soon-to-be-added active block commit) we changed just a few
      fields to the new target. In case we'd copy a network disk to a local
      file we'd not change the type properly.
      
      To avoid such problems, switch to tracking of the source via changing of
      the complete source struct to the one tracking the mirroring info.
      4cc1f1a0
    • P
      qemu: blockcopy: Use the mirror disk source to label the files · 9ff75a85
      Peter Krempa 提交于
      Use the source struct and the corresponding function so that we can
      avoid using the path separately. Now that
      qemuDomainPrepareDiskChainElementPath isn't use anywhere, we can safely
      remove it.
      
      Additionally, the removal fixes a misaligned comment as the removed
      function was added under a comment for a different function.
      9ff75a85