1. 25 1月, 2014 1 次提交
    • J
      Block info query: Add check for transient domain · 46a0737e
      John Ferlan 提交于
      Currently the qemuDomainGetBlockInfo will return allocation == physical
      for most backing stores. For a qcow2 block backed device it's possible
      to return the highest lv extent allocated from qemu for an active guest.
      That is a value where allocation != physical and one would hope be less.
      However, if the guest is not running, then the code falls back to returning
      allocation == physical. This turns out to be problematic for rhev which
      monitors the size of the backing store. During a migration, before the
      VM has been started on the target and while it is deemed inactive on the
      source, there's a small window of time where the allocation is returned
      as physical triggering the code to extend the file unnecessarily.
      
      Since rhev uses transient domains and this is edge condition for a transient
      domain, rather than returning good status and allocation == physical when
      this "window of opportunity" exists, this patch will check for a transient
      (or non persistent) domain and return a failure to the caller rather than
      returning the defaults. For a persistent domain, the defaults will be
      returned. The description for the virDomainGetBlockInfo has been updated
      to describe the phenomena.
      46a0737e
  2. 24 1月, 2014 1 次提交
  3. 23 1月, 2014 2 次提交
    • O
      util: Add "shareable" field for virSCSIDevice struct · 2b66504d
      Osier Yang 提交于
      Unlike the host devices of other types, SCSI host device XML supports
      "shareable" tag. This patch introduces it for the virSCSIDevice struct
      for a later patch use (to detect if the SCSI device is shareable when
      preparing the SCSI host device in QEMU driver).
      2b66504d
    • E
      api: require write permission for guest agent interaction · 7f2d27d1
      Eric Blake 提交于
      I noticed that we allow virDomainGetVcpusFlags even for read-only
      connections, but that with a flag, it can require guest agent
      interaction.  It is feasible that a malicious guest could
      intentionally abuse the replies it sends over the guest agent
      connection to possibly trigger a bug in libvirt's JSON parser,
      or withhold an answer so as to prevent the use of the agent
      in a later command such as a shutdown request.  Although we
      don't know of any such exploits now (and therefore don't mind
      posting this patch publicly without trying to get a CVE assigned),
      it is better to err on the side of caution and explicitly require
      full access to any domain where the API requires guest interaction
      to operate correctly.
      
      I audited all commands that are marked as conditionally using a
      guest agent.  Note that at least virDomainFSTrim is documented
      as needing a guest agent, but that such use is unconditional
      depending on the hypervisor (so the existing domain:fs_trim ACL
      should be sufficient there, rather than also requirng domain:write).
      But when designing future APIs, such as the plans for obtaining
      a domain's IP addresses, we should copy the approach of this patch
      in making interaction with the guest be specified via a flag, and
      use that flag to also require stricter access checks.
      
      * src/libvirt.c (virDomainGetVcpusFlags): Forbid guest interaction
      on read-only connection.
      (virDomainShutdownFlags, virDomainReboot): Improve docs on agent
      interaction.
      * src/remote/remote_protocol.x
      (REMOTE_PROC_DOMAIN_SNAPSHOT_CREATE_XML)
      (REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
      (REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS, REMOTE_PROC_DOMAIN_REBOOT)
      (REMOTE_PROC_DOMAIN_SHUTDOWN_FLAGS): Require domain:write for any
      conditional use of a guest agent.
      * src/xen/xen_driver.c: Fix clients.
      * src/libxl/libxl_driver.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/lxc/lxc_driver.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7f2d27d1
  4. 22 1月, 2014 2 次提交
  5. 21 1月, 2014 3 次提交
    • P
      qemu: snapshot: Avoid libvirtd crash when qemu crashes while snapshotting · 55bbb011
      Peter Krempa 提交于
      We shouldn't access the domain definition while we are in the monitor
      section as the domain is unlocked. Additionally after we exit from the
      monitor we need to check if the VM is still alive. Not doing so resulted
      in a crash if qemu exits while attempting to do an external VM snapshot.
      55bbb011
    • F
      spice: expose the QEMU disable file transfer option · 08d07e5f
      Francesco Romani 提交于
      spice-server offers an API to disable file transfer messages
      on the agent channel between the client and the guest.
      This is supported in qemu through the disable-agent-file-xfer option.
      
      This patch exposes this option to libvirt.
      Adds a new element 'filetransfer', with one property,
      'enable', which accepts a boolean.
      Default is enabled, for backward compatibility.
      
      Depends on the capability exported in the first patch of the series.
      Signed-off-by: NFrancesco Romani <fromani@redhat.com>
      08d07e5f
    • F
      spice: detect if qemu can disable file transfer · 19bbc812
      Francesco Romani 提交于
      spice-server offers an API to disable file transfer messages
      on the agent channel between the client and the guest.
      This is supported in qemu through the disable-agent-file-xfer option.
      
      This patch detects if QEMU supports this option, and add
      a capability if does.
      Signed-off-by: NFrancesco Romani <fromani@redhat.com>
      19bbc812
  6. 20 1月, 2014 3 次提交
  7. 17 1月, 2014 3 次提交
    • E
      maint: don't lose error on canceled migration · c8ed177a
      Eric Blake 提交于
      While auditing the error reporting, I noticed that migration
      had some issues.  Some of the static helper functions tried
      to call virDispatchError(), even though their caller will also
      report the error.  Also, if a migration is cancelled early
      because a uri was not set, we did not guarantee that the finish
      stage would not overwrite the first error message.
      
      * src/qemu/qemu_migration.c (doPeer2PeerMigrate2)
      (doPeer2PeerMigrate3): Preserve first error when cancelling.
      * src/libvirt.c (virDomainMigrateVersion3Full): Likewise.
      (virDomainMigrateVersion1, virDomainMigrateVersion2)
      (virDomainMigrateDirect): Avoid redundant error dispatch.
      (virDomainMigrateFinish2, virDomainMigrateFinish3)
      (virDomainMigrateFinish3Params): Don't report error on cleanup
      path.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c8ed177a
    • E
      maint: avoid nested use of virConnect{Ref,Close} · 25221a1b
      Eric Blake 提交于
      The public virConnectRef and virConnectClose API are just thin
      wrappers around virObjectRef/virObjectRef, with added object
      validation and an error reset.  Within our backend drivers, use
      of the object validation is just an inefficiency since we always
      pass valid objects.  More important to think about is what
      happens with the error reset; our uses of virConnectRef happened
      to be safe (since we hadn't encountered any earlier errors), but
      in several cases the use of virConnectClose could lose a real
      error.
      
      Ideally, we should also avoid calling virConnectOpen() from
      within backend drivers - but that is a known situation that
      needs much more design work.
      
      * src/qemu/qemu_process.c (qemuProcessReconnectHelper)
      (qemuProcessReconnect): Avoid nested public API call.
      * src/qemu/qemu_driver.c (qemuAutostartDomains)
      (qemuStateInitialize, qemuStateStop): Likewise.
      * src/qemu/qemu_migration.c (doPeer2PeerMigrate): Likewise.
      * src/storage/storage_driver.c (storageDriverAutostart):
      Likewise.
      * src/uml/uml_driver.c (umlAutostartConfigs): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessAutostartAll): Likewise.
      (virLXCProcessReboot): Likewise, and avoid leaking conn on error.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25221a1b
    • M
      qemu: Change the default unix monitor timeout · fe89b687
      Martin Kletzander 提交于
      There is a number of reported issues when we fail starting a domain.
      Turns out that, in some scenarios like high load, 3 second timeout is
      not enough for qemu to start up to the phase where the socket is
      created.  Since there is no downside of waiting longer, raise the
      timeout right to 30 seconds.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      fe89b687
  8. 16 1月, 2014 2 次提交
    • E
      event: filter global events by domain:getattr ACL [CVE-2014-0028] · f9f56340
      Eric Blake 提交于
      Ever since ACL filtering was added in commit 76397360 (v1.1.1), a
      user could still use event registration to obtain access to a
      domain that they could not normally access via virDomainLookup*
      or virConnectListAllDomains and friends.  We already have the
      framework in the RPC generator for creating the filter, and
      previous cleanup patches got us to the point that we can now
      wire the filter through the entire object event stack.
      
      Furthermore, whether or not domain:getattr is honored, use of
      global events is a form of obtaining a list of networks, which
      is covered by connect:search_domains added in a93cd08f (v1.1.0).
      Ideally, we'd have a way to enforce connect:search_domains when
      doing global registrations while omitting that check on a
      per-domain registration.  But this patch just unconditionally
      requires connect:search_domains, even when no list could be
      obtained, based on the following observations:
      1. Administrators are unlikely to grant domain:getattr for one
      or all domains while still denying connect:search_domains - a
      user that is able to manage domains will want to be able to
      manage them efficiently, but efficient management includes being
      able to list the domains they can access.  The idea of denying
      connect:search_domains while still granting access to individual
      domains is therefore not adding any real security, but just
      serves as a layer of obscurity to annoy the end user.
      2. In the current implementation, domain events are filtered
      on the client; the server has no idea if a domain filter was
      requested, and must therefore assume that all domain event
      requests are global.  Even if we fix the RPC protocol to
      allow for server-side filtering for newer client/server combos,
      making the connect:serach_domains ACL check conditional on
      whether the domain argument was NULL won't benefit older clients.
      Therefore, we choose to document that connect:search_domains
      is a pre-requisite to any domain event management.
      
      Network events need the same treatment, with the obvious
      change of using connect:search_networks and network:getattr.
      
      * src/access/viraccessperm.h
      (VIR_ACCESS_PERM_CONNECT_SEARCH_DOMAINS)
      (VIR_ACCESS_PERM_CONNECT_SEARCH_NETWORKS): Document additional
      effect of the permission.
      * src/conf/domain_event.h (virDomainEventStateRegister)
      (virDomainEventStateRegisterID): Add new parameter.
      * src/conf/network_event.h (virNetworkEventStateRegisterID):
      Likewise.
      * src/conf/object_event_private.h (virObjectEventStateRegisterID):
      Likewise.
      * src/conf/object_event.c (_virObjectEventCallback): Track a filter.
      (virObjectEventDispatchMatchCallback): Use filter.
      (virObjectEventCallbackListAddID): Register filter.
      * src/conf/domain_event.c (virDomainEventFilter): New function.
      (virDomainEventStateRegister, virDomainEventStateRegisterID):
      Adjust callers.
      * src/conf/network_event.c (virNetworkEventFilter): New function.
      (virNetworkEventStateRegisterID): Adjust caller.
      * src/remote/remote_protocol.x
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_REGISTER)
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_REGISTER_ANY)
      (REMOTE_PROC_CONNECT_NETWORK_EVENT_REGISTER_ANY): Generate a
      filter, and require connect:search_domains instead of weaker
      connect:read.
      * src/test/test_driver.c (testConnectDomainEventRegister)
      (testConnectDomainEventRegisterAny)
      (testConnectNetworkEventRegisterAny): Update callers.
      * src/remote/remote_driver.c (remoteConnectDomainEventRegister)
      (remoteConnectDomainEventRegisterAny): Likewise.
      * src/xen/xen_driver.c (xenUnifiedConnectDomainEventRegister)
      (xenUnifiedConnectDomainEventRegisterAny): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc): Likewise.
      * src/libxl/libxl_driver.c (libxlConnectDomainEventRegister)
      (libxlConnectDomainEventRegisterAny): Likewise.
      * src/qemu/qemu_driver.c (qemuConnectDomainEventRegister)
      (qemuConnectDomainEventRegisterAny): Likewise.
      * src/uml/uml_driver.c (umlConnectDomainEventRegister)
      (umlConnectDomainEventRegisterAny): Likewise.
      * src/network/bridge_driver.c
      (networkConnectNetworkEventRegisterAny): Likewise.
      * src/lxc/lxc_driver.c (lxcConnectDomainEventRegister)
      (lxcConnectDomainEventRegisterAny): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f9f56340
    • P
      qemu: Avoid operations on NULL monitor if VM fails early · b952cbbc
      Peter Krempa 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1047659
      
      If a VM dies very early during an attempted connect to the guest agent
      while the locks are down the domain monitor object will be freed. The
      object is then accessed later as any failure during guest agent startup
      isn't considered fatal.
      
      In the current upstream version this doesn't lead to a crash as
      virObjectLock called when entering the monitor in
      qemuProcessDetectVcpuPIDs checks the pointer before attempting to
      dereference (lock) it. The NULL pointer is then caught in the monitor
      helper code.
      
      Before the introduction of virObjectLockable - observed on 0.10.2 - the
      pointer is locked directly via virMutexLock leading to a crash.
      
      To avoid this problem we need to differentiate between the guest agent
      not being present and the VM quitting when the locks were down. The fix
      reorganizes the code in qemuConnectAgent to add the check and then adds
      special handling to the callers.
      b952cbbc
  9. 09 1月, 2014 1 次提交
  10. 07 1月, 2014 10 次提交
    • J
      qemu: Fix job usage in virDomainGetBlockIoTune · 3b564259
      Jiri Denemark 提交于
      CVE-2013-6458
      
      Every API that is going to begin a job should do that before fetching
      data from vm->def.
      3b564259
    • J
      qemu: Fix job usage in qemuDomainBlockCopy · ff5f30b6
      Jiri Denemark 提交于
      Every API that is going to begin a job should do that before fetching
      data from vm->def.
      ff5f30b6
    • J
      qemu: Fix job usage in qemuDomainBlockJobImpl · f93d2caa
      Jiri Denemark 提交于
      CVE-2013-6458
      
      Every API that is going to begin a job should do that before fetching
      data from vm->def.
      f93d2caa
    • J
      qemu: Avoid using stale data in virDomainGetBlockInfo · b7992595
      Jiri Denemark 提交于
      CVE-2013-6458
      
      Generally, every API that is going to begin a job should do that before
      fetching data from vm->def. However, qemuDomainGetBlockInfo does not
      know whether it will have to start a job or not before checking vm->def.
      To avoid using disk alias that might have been freed while we were
      waiting for a job, we use its copy. In case the disk was removed in the
      meantime, we will fail with "cannot find statistics for device '...'"
      error message.
      b7992595
    • J
      qemu: Do not access stale data in virDomainBlockStats · db86da5c
      Jiri Denemark 提交于
      CVE-2013-6458
      https://bugzilla.redhat.com/show_bug.cgi?id=1043069
      
      When virDomainDetachDeviceFlags is called concurrently to
      virDomainBlockStats: libvirtd may crash because qemuDomainBlockStats
      finds a disk in vm->def before getting a job on a domain and uses the
      disk pointer after getting the job. However, the domain in unlocked
      while waiting on a job condition and thus data behind the disk pointer
      may disappear. This happens when thread 1 runs
      virDomainDetachDeviceFlags and enters monitor to actually remove the
      disk. Then another thread starts running virDomainBlockStats, finds the
      disk in vm->def, and while it's waiting on the job condition (owned by
      the first thread), the first thread finishes the disk removal. When the
      second thread gets the job, the memory pointed to be the disk pointer is
      already gone.
      
      That said, every API that is going to begin a job should do that before
      fetching data from vm->def.
      db86da5c
    • Y
      Fix segmentation fault when accessing default qemu machine type · 72953074
      Yudai Yamagish 提交于
      This patch fixes a segmentation fault when creating new virtual machines using QEMU.
      The segmentation fault is caused by commit f4183068
      and commit cbb6ec42.
      
      In virQEMUCapsProbeQMPMachineTypes, when copying machines to qemuCaps, "none" is skipped.
      Therefore, the value of i and "qemuCaps->nmachineTypes - 1" do not always match.
      However, defIdx value (used to call virQEMUCapsSetDefaultMachine) is set using the value in i
      when the array elements are in qemuCaps->nmachineTypes - 1.
      So, when libvirt tries to create virtual machines using the default machine type,
      qemuCaps->machineTypes[defIdx] is accessed and since the defIdx is NULL, it results in segmentation fault.
      Signed-off-by: NYudai Yamagishi <yummy@sfc.wide.ad.jp>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      72953074
    • M
      qemuProcessStop: Don't overwrite any errors · 088ff08c
      Michal Privoznik 提交于
      Currently, the qemuProcessStop tries to open the domain log file
      and saves the original error afterwards. Then all the cleanup is
      done after which the error is restored back. This has however one
      flaw: if opening of the log file fails an error is reported,
      which results in previous error being overwritten (the useful
      one, e.g. "PCI device XXXX:XXXX could not be found"). Hence, user
      sees something like:
      
        error: failed to create logfile /var/log/libvirt/qemu/ovirt_usb.log: No such file or directory
      
      instead of:
      
        error: internal error: Did not find USB device 8644:8003
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reported-by: NZhou Yimin <zhouyimin@huawei.com>
      088ff08c
    • E
      maint: fix comment typos in qemu numa code · 599ef94d
      Eric Blake 提交于
      Introduced in commit 81fae6b9.
      
      * src/qemu/qemu_driver.c (qemuDomainSetNumaParamsLive): Fix typos.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      599ef94d
    • M
      Fix argument order of qemuMigrationPerformJob(). · bcd0ac47
      Minoru Usui 提交于
      @listenAddress and @cookiein arguments, should be exchanged,
      because the order of the caller and the callee does not match.
      
      This results in the listen address being ignored for peer-to-peer
      migration and the cookie being ignored for v2 migration.
      
      Introduced by c4ac7ef6 (v1.1.4-rc1~141).
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1049338Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      bcd0ac47
    • P
      AArch64: Porting of armv7l conditons to run qemu for aarch64. · 27e32e0f
      Pranavkumar Sawargaonkar 提交于
      AArch64 qemu has similar behavior as armv7l, like use of mmio etc.
      This patch adds similar bypass checks what we have for armv7l to aarch64.
      E.g. we are enabling mmio transport for Nicdev.
      Making addDefaultUSB and addDefaultMemballoon to false etc.
      
      V3:
      - Adding missing domain rng schema for aarcg64 and test case in
        testutilsqemu.c which was causing test suite failure
        while running make check.
      
      V2:
      - Added testcase to qemuxml2argvtest as suggested
        during review comments of V1.
      
      V1:
      - Initial patch.
      Signed-off-by: NAnup Patel <anup.patel@linaro.org>
      Signed-off-by: NPranavkumar Sawargaonkar <pranavkumar@linaro.org>
      27e32e0f
  11. 06 1月, 2014 3 次提交
    • P
      qemu: range check numa memory placement mode · 6e7490c7
      Peter Krempa 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1047234
      
      Add a range check for supported numa memory placement modes provided by
      the user before setting them in the domain definition. Without the check
      the user is able to provide a (yet) unknown mode which is then stored in
      the domain definition. This potentially causes a NULL dereference when
      the defintion is formatted into the XML.
      
      To reproduce run:
       virsh numatune DOMNAME --mode 6 --nodeset 0
      
      The XML will then contain:
        <numatune>
            <memory mode='(null)' nodeset='0'/>
        </numatune>
      
      With this fix, the command fails:
       error: Unable to change numa parameters
       error: invalid argument: unsupported numa_mode: '6'
      6e7490c7
    • P
      qemu: Clean up qemuDomainSetNumaParameters · 8b573a6b
      Peter Krempa 提交于
      Add whitespace to separate logical code blocks, reformat error messages
      and clean up code flow.
      
      This patch changes error handling in some cases where the the loop would
      be continued to jump to cleanup instead and error out rather than modify
      the domain any further.
      8b573a6b
    • J
      Fix explicit usage of default video PCI slots · ec128e69
      Ján Tomko 提交于
      Do not leave the PCI address of the primary video card set
      to the legacy default (0000:00:02.0) if we're doing two-pass
      allocation.
      
      Since QEMU 1.6 (QEMU_CAPS_VIDEO_PRIMARY) we allow the primary
      video card to be on other slots than 0000:00:02.0 (as we use
      -device instead of -vga).
      
      However we fail to assign it an address if:
      * another device explicitly uses 0000:00:02.0 and
      * the primary video device has no address specified
      
      On the first pass, we have set the address to default, then checked
      if it's available, leaving it set even if it wasn't. This address
      got picked up by the second pass, resulting in a conflict:
      
      XML error: Attempted double use of PCI slot 0000:00:02.0
      (may need "multifunction='on'" for device on function 0)
      
      Also fix the test that was supposed to catch this.
      ec128e69
  12. 23 12月, 2013 2 次提交
    • L
      qemu: avoid duplicate security label restore on hostdev attach failure · c0f511ee
      Laine Stump 提交于
      This eliminates the misleading error message that was being logged
      when a vfio hostdev hotplug failed:
      
        error: unable to set user and group to '107:107' on '/dev/vfio/22':
               No such file or directory
      
      as documented in:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1035490
      
      Commit ee414b5d (pushed as a fix for Bug 1016511 and part of Bug
      1025108) replaced the single call to
      virSecurityManagerSetHostdevLabel() in qemuDomainAttachHostDevice()
      with individual calls to that same function in each
      device-type-specific attach function (for PCI, USB, and SCSI). It also
      added a corresponding call to virSecurityManagerRestoreHostdevLabel()
      in the error handling of the device-type-specific functions, but
      forgot to remove the common call to that from
      qemuDomainAttachHostDevice() - this resulted in a duplicate call to
      virSecurityManagerRestoreHostdevLabel(), with the second occurrence
      being after (e.g.) a PCI device has already been re-attached to the
      host driver, thus destroying some of the device nodes / links that we
      then attempted to re-label (e.f. /dev/vfio/22) and generating an error
      log that obscured the original error.
      c0f511ee
    • L
      qemu: properly set MaxMemLock when hotplugging with VFIO · 6d867f72
      Laine Stump 提交于
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1035490
      
      virProcessSetMaxMemLock() (which is a wrapper over prlimit(3)) expects
      the memory size in bytes, but libvirt's domain definition (which was
      being used by qemuDomainAttachHostPciDevice()) stores all memory
      tuning parameters in KiB. This was being accounted for when setting
      MaxMemLock at domain startup time (so cold-plugged devices would
      work), but not for hotplug.
      
      This patch simplifies the few lines that call
      virProcessSetMemMaxLock(), and multiply the amount * 1024 so that
      we're locking the correct amount of memory.
      
      What remains a mystery to me is why hot-plug of a managed='no' device
      would succeed (at least on my system) while managed='yes' would
      fail. I guess in one case the memory was coincidentally already
      resident and in the other it wasn't.
      6d867f72
  13. 18 12月, 2013 1 次提交
    • E
      qemu: ask for -enable-fips when FIPS is required · a21cfb0f
      Eric Blake 提交于
      On a system that is enforcing FIPS, most libraries honor the
      current mode by default.  Qemu, on the other hand, refused to
      honor FIPS mode unless you add the '-enable-fips' command
      line option; worse, this option is not discoverable via QMP,
      and is only present on binaries built for Linux.  So, if we
      detect FIPS mode, then we unconditionally ask for FIPS; either
      qemu is new enough to have the option and then correctly
      cripple insecure VNC passwords, or it is so old that we are
      correctly avoiding a FIPS violation by preventing qemu from
      starting.  Meanwhile, if we don't detect FIPS mode, then
      omitting the argument is safe whether the qemu has the option
      (but it would do nothing because FIPS is disabled) or whether
      qemu lacks the option (including in the case where we are not
      running on Linux).
      
      The testsuite was a bit interesting: we don't want our test
      to depend on whether it is being run in FIPS mode, so I had
      to tweak things to set the capability bit outside of our
      normal interaction with capability parsing.
      
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1035474
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_ENABLE_FIPS): New bit.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Conditionally
      set capability according to detection of FIPS mode.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Use it.
      * tests/qemucapabilitiestest.c (testQemuCaps): Conditionally set
      capability to test expected output.
      * tests/qemucapabilitiesdata/caps_1.2.2-1.caps: Update list.
      * tests/qemucapabilitiesdata/caps_1.6.0-1.caps: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a21cfb0f
  14. 17 12月, 2013 1 次提交
  15. 13 12月, 2013 3 次提交
    • M
      qemu: check for reboot-timeout on monitor · 15275f2e
      Martin Kletzander 提交于
      The support for <boot rebootTimeout="12345"/> was added before we were
      checking for qemu command line options in QMP, so we haven't properly
      adapted virQEMUCaps when using it and thus we report unsupported
      option with new enough qemu.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1042690Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      15275f2e
    • E
      object: require maximal alignment in base class · fca4f233
      Eric Blake 提交于
      Recent changes to events (commit 8a29ffcf) resulted in new compile
      failures on some targets (such as ARM OMAP5):
      conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
      conf/domain_event.c:1198:30: error: cast increases required alignment of
      target type [-Werror=cast-align]
      conf/domain_event.c:1314:34: error: cast increases required alignment of
      target type [-Werror=cast-align]
      cc1: all warnings being treated as errors
      
      The error is due to alignment; the base class is merely aligned
      to the worst of 'int' and 'void*', while the child class must
      be aligned to a 'long long'.  The solution is to include a
      'long long' (and for good measure, a function pointer) in the
      base class to ensure correct alignment regardless of what a
      child class may add, but to wrap the inclusion in a union so
      as to not incur any wasted space.  On a typical x86_64 platform,
      the base class remains 16 bytes; on i686, the base class remains
      12 bytes; and on the impacted ARM platform, the base class grows
      from 12 bytes to 16 bytes due to the increase of alignment from
      4 to 8 bytes.
      
      Reported by Michele Paolino and others.
      
      * src/util/virobject.h (_virObject): Use a union to ensure that
      subclasses never have stricter alignment than the parent.
      * src/util/virobject.c (virObjectNew, virObjectUnref)
      (virObjectRef): Adjust clients.
      * src/libvirt.c (virConnectRef, virDomainRef, virNetworkRef)
      (virInterfaceRef, virStoragePoolRef, virStorageVolRef)
      (virNodeDeviceRef, virSecretRef, virStreamRef, virNWFilterRef)
      (virDomainSnapshotRef): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorOpenInternal)
      (qemuMonitorClose): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fca4f233
    • H
      qemu: add support for -device pvpanic · 4d18758d
      Hu Tao 提交于
      Map the new <panic> device in XML to the '-device pvpanic' command
      line of qemu.  Clients can then couple the <panic> device and the
      <on_crash> directive to control behavior when the guest reports
      a panic to qemu.
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4d18758d
  16. 12 12月, 2013 2 次提交