1. 16 9月, 2014 2 次提交
  2. 15 9月, 2014 1 次提交
    • J
      Resolve Coverity CHECKED_RETURN · 07334ccb
      John Ferlan 提交于
      Coverity complained that checking the return of virDomainCreate()
      was not consistent amongst the callers - so added the return check
      to the objecteventtest.c and adjust the virt-login-shell to compare
      < 0 rather than just non zero for the failure condition.
      07334ccb
  3. 12 9月, 2014 3 次提交
    • E
      blockcopy: add qemu implementation of new tunables · eef91f94
      Eric Blake 提交于
      Upstream qemu 1.4 added some drive-mirror tunables not present
      when it was first introduced in 1.3.  Management apps may want
      to set these in some cases (for example, without tuning
      granularity down to sector size, a copy may end up occupying
      more bytes than the original because an entire cluster is
      copied even when only a sector within the cluster is dirty,
      although tuning it down results in more CPU time to do the
      copy).  I haven't personally needed to use the parameters, but
      since they exist, and since the new API supports virTypedParams,
      we might as well expose them.
      
      Since the tuning parameters aren't often used, and omitted from
      the QMP command when unspecified, I think it is safe to rely on
      qemu 1.3 to issue an error about them being unsupported, rather
      than trying to create a new capability bit in libvirt.
      
      Meanwhile, all versions of qemu from 1.4 to 2.1 have a bug where
      a bad granularity (such as non-power-of-2) gives a poor message:
      error: internal error: unable to execute QEMU command 'drive-mirror': Invalid parameter 'drive-virtio-disk0'
      
      because of abuse of QERR_INVALID_PARAMETER (which is supposed to
      name the parameter that was given a bad value, rather than the
      value passed to some other parameter).  I don't see that a
      capability check will help, so we'll just live with it (and it
      has since been improved in upstream qemu).
      
      * src/qemu/qemu_monitor.h (qemuMonitorDriveMirror): Add
      parameters.
      * src/qemu/qemu_monitor.c (qemuMonitorDriveMirror): Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopyCommon): Likewise.
      (qemuDomainBlockRebase, qemuDomainBlockCopy): Adjust callers.
      * src/qemu/qemu_migration.c (qemuMigrationDriveMirror): Likewise.
      * tests/qemumonitorjsontest.c (qemuMonitorJSONDriveMirror): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eef91f94
    • D
      tests: Add more test suite mock helpers · 47ffd5e8
      Daniel P. Berrange 提交于
      Rename the VIR_MOCK_IMPL* macros to VIR_MOCK_WRAP*
      and add new VIR_MOCK_IMPL macros which let you directly
      implement overrides in the preloaded source.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      47ffd5e8
    • D
      util: Allow port allocator to skip bind() check · 973173e6
      Daniel P. Berrange 提交于
      Test suites using the port allocator don't want to have different
      behaviour depending on whether a port is in use on the host. Add
      a VIR_PORT_ALLOCATOR_SKIP_BIND_CHECK which test suites can use
      to skip the bind() test. The port allocator will thus only track
      ports in use by the test suite process itself. This is fine when
      using the port allocator to generate guest configs which won't
      actually be launched
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      973173e6
  4. 11 9月, 2014 1 次提交
  5. 10 9月, 2014 3 次提交
    • M
      qemu: Automatically create NVRAM store · 742b08e3
      Michal Privoznik 提交于
      When using split UEFI image, it may come handy if libvirt manages per
      domain _VARS file automatically. While the _CODE file is RO and can be
      shared among multiple domains, you certainly don't want to do that on
      the _VARS file. This latter one needs to be per domain. So at the
      domain startup process, if it's determined that domain needs _VARS
      file it's copied from this master _VARS file. The location of the
      master file is configurable in qemu.conf.
      
      Temporary, on per domain basis the location of master NVRAM file can
      be overridden by this @template attribute I'm inventing to the
      <nvram/> element. All it does is holding path to the master NVRAM file
      from which local copy is created. If that's the case, the map in
      qemu.conf is not consulted.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      742b08e3
    • 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
  6. 06 9月, 2014 1 次提交
    • E
      blockcopy: allow block device destination · b7e73585
      Eric Blake 提交于
      To date, anyone performing a block copy and pivot ends up with
      the destination being treated as <disk type='file'>.  While this
      works for data access for a block device, it has at least one
      noticeable shortcoming: virDomainGetBlockInfo() reports allocation
      differently for block devices visited as files (the size of the
      device) than for block devices visited as <disk type='block'>
      (the maximum sector used, as reported by qemu); and this difference
      is significant when trying to manage qcow2 format on block devices
      that can be grown as needed.
      
      Of course, the more powerful virDomainBlockCopy() API can already
      express the ability to set the <disk> type.  But a new API can't
      be backported, while a new flag to an existing API can; and it is
      also rather inconvenient to have to resort to the full power of
      generating XML when just adding a flag to the older call will do
      the trick.  So this patch enhances blockcopy to let the user flag
      when the resulting XML after the copy must list the device as
      type='block'.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_REBASE_COPY_DEV):
      New flag.
      * src/libvirt.c (virDomainBlockRebase): Document it.
      * tools/virsh-domain.c (opts_block_copy, blockJobImpl): Add
      --blockdev option.
      * tools/virsh.pod (blockcopy): Document it.
      * src/qemu/qemu_driver.c (qemuDomainBlockRebase): Allow new flag.
      (qemuDomainBlockCopy): Remember the flag, and make sure it is only
      used on actual block devices.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b7e73585
  7. 05 9月, 2014 4 次提交
    • J
      Don't include non-migratable features in host-model · de0aeafe
      Ján Tomko 提交于
      Commit fba6bc47 introduced support for the 'invtsc' feature,
      which blocks migration. We should not include it in the
      host-model CPU by default, because it's intended to be used
      with migration.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1138221
      de0aeafe
    • M
      tests: Add test cases for previous commit · 36cc189a
      Michal Privoznik 提交于
      This commit is rather big. Firstly, the in memory config
      representation is adjusted like if security_driver was set to "none".
      The rest is then just adaptation to the new code that will generate
      different seclabels.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      36cc189a
    • E
      maint: use hanging curly braces · 625e04a8
      Eric Blake 提交于
      Our style overwhelmingly uses hanging braces (the open brace
      hangs at the end of the compound condition, rather than on
      its own line), with the primary exception of the top level function
      body.  Fix the few remaining outliers, before adding a syntax
      check in a later patch.
      
      * src/interface/interface_backend_netcf.c (netcfStateReload)
      (netcfInterfaceClose, netcf_to_vir_err): Correct use of { in
      compound statement.
      * src/conf/domain_conf.c (virDomainHostdevDefFormatSubsys)
      (virDomainHostdevDefFormatCaps): Likewise.
      * src/network/bridge_driver.c (networkAllocateActualDevice):
      Likewise.
      * src/util/virfile.c (virBuildPathInternal): Likewise.
      * src/util/virnetdev.c (virNetDevGetVirtualFunctions): Likewise.
      * src/util/virnetdevmacvlan.c
      (virNetDevMacVLanVPortProfileCallback): Likewise.
      * src/util/virtypedparam.c (virTypedParameterAssign): Likewise.
      * src/util/virutil.c (virGetWin32DirectoryRoot)
      (virFileWaitForDevices): Likewise.
      * src/vbox/vbox_common.c (vboxDumpNetwork): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      625e04a8
    • 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
  8. 04 9月, 2014 3 次提交
  9. 03 9月, 2014 1 次提交
  10. 29 8月, 2014 2 次提交
    • J
      qemu: Allow use of iothreads for disk definitions · ef8da2ad
      John Ferlan 提交于
      For virtio-blk-pci disks with the disk iothread attribute that are
      running the correct emulator, add the "iothread=iothread#" to the
      -device command line in order to enable iothreads for the disk as
      long as the command is available, the disk iothread value provided is
      valid, and is supported for the disk device being added
      ef8da2ad
    • J
      qemu: Add support for iothreads · 72edaae7
      John Ferlan 提交于
      Add a new capability to ensure the iothreads feature exists for the qemu
      emulator being run - requires the "query-iothreads" QMP command. Using the
      domain XML add correspoding command argument in order to generate the
      threads. The iothreads will use a name space "iothread#" where, the
      future patch to add support for using an iothread to a disk definition to
      merely define which of the available threads to use.
      
      Add tests to ensure the xml/argv processing is correct.  Note that no
      change was made to qemuargv2xmltest.c as processing the -object element
      would require knowing more than just iothreads.
      72edaae7
  11. 28 8月, 2014 1 次提交
  12. 27 8月, 2014 1 次提交
  13. 26 8月, 2014 2 次提交
    • A
      Add new 'kvm' domain feature and ability to hide KVM signature · d0711642
      Alex Williamson 提交于
      QEMU 2.1 added support for the kvm=off option to the -cpu command,
      allowing the KVM hypervisor signature to be hidden from the guest.
      This enables disabling of some paravirualization features in the
      guest as well as allowing certain drivers which test for the
      hypervisor to load.  Domain XML syntax is as follows:
      
      <domain type='kvm>
        ...
        <features>
          ...
          <kvm>
            <hidden state='on'/>
          </kvm>
        </features>
        ...
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      d0711642
    • E
      maint: drop spurious semicolons · 28de556d
      Eric Blake 提交于
      I noticed a line 'int nparams = 0;;' in remote_dispatch.h, and
      tracked down where it was generated.  While at it, I found a
      couple of other double semicolons.  Additionally, I noticed that
      commit df0b57a9 left a stale reference to the file name
      remote_dispatch_bodies.h.
      
      * src/conf/numatune_conf.c (virDomainNumatuneNodeParseXML): Drop
      empty statement.
      * tests/virdbustest.c (testMessageStruct, testMessageSimple):
      Likewise.
      * src/rpc/gendispatch.pl (remote_dispatch_bodies.h): Likewise, and
      update stale comments.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      28de556d
  14. 25 8月, 2014 3 次提交
  15. 23 8月, 2014 1 次提交
  16. 22 8月, 2014 3 次提交
  17. 21 8月, 2014 1 次提交
  18. 20 8月, 2014 4 次提交
    • 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: Issue rtc-reset-reinjection command after guest-set-time · b606bbb4
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1103245
      
      An advice appeared there on the qemu-devel list [1]. When a domain is
      suspended and then resumed guest kernel is not aware of this. So we've
      introduced virDomainSetTime API that resets the time within guest
      using qemu-ga. On the other hand, qemu itself is trying to make RTC
      beat faster to catch the difference. But if we don't tell qemu that
      guest's time was reset via the other method, both mechanisms are
      applied resulting in again wrong guest time. In order to avoid summing
      both corrections we need to tell qemu that it should not use the RTC
      injection if the guest time is set via guest agent.
      
      1: http://www.mail-archive.com/qemu-devel@nongnu.org/msg236435.htmlSigned-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b606bbb4
    • R
      bhyve: add volumes support · 6c2e7d0b
      Roman Bogorodskiy 提交于
      Update bhyveBuildDiskArgStr to support volumes:
      
       - Make virBhyveProcessBuildBhyveCmd and
         virBhyveProcessBuildLoadCmd take virConnectPtr as the
         first argument instead of bhyveConnPtr as virConnectPtr is
         needed for virStorageTranslateDiskSourcePool,
       - Add virStorageTranslateDiskSourcePool call to
         virBhyveProcessBuildBhyveCmd and
         virBhyveProcessBuildLoadCmd,
       - Allow disks of type VIR_STORAGE_TYPE_VOLUME
      6c2e7d0b
    • R
      storage: make disk source pool translation generic · 8c170c9f
      Roman Bogorodskiy 提交于
      Currently, qemu driver uses qemuTranslateDiskSourcePool()
      to translate disk volume information. This function is
      general enough and could be used for other drivers as well,
      so move it to conf/domain_conf.c along with its helpers.
      
       - qemuTranslateDiskSourcePool: move to storage/storage_driver.c
         and rename to virStorageTranslateDiskSourcePool,
       - qemuAddISCSIPoolSourceHost: move to storage/storage_driver.c
         and rename to virStorageAddISCSIPoolSourceHost,
       - qemuTranslateDiskSourcePoolAuth: move to storage/storage_driver.c
         and rename to virStorageTranslateDiskSourcePoolAuth,
       - Update users of qemuTranslateDiskSourcePool to use a
         new name.
      8c170c9f
  19. 19 8月, 2014 2 次提交
  20. 12 8月, 2014 1 次提交