Permalink
Commits on Jan 10, 2013
  1. exec: Return CPUState from qemu_get_cpu()

    Move the declaration to qemu/cpu.h and add documentation.
    The implementation still depends on CPUArchState for CPU iteration.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    committed Dec 17, 2012
  2. xen: Simplify halting of first CPU

    Use the global first_cpu variable to halt the CPU rather than using a
    local first_cpu initialized from qemu_get_cpu(0).
    
    This will allow to change qemu_get_cpu() return type to CPUState
    despite use of the CPU_COMMON halted field in the reset handler.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    committed Dec 17, 2012
  3. kvm: Pass CPUState to kvm_init_vcpu()

    CPUArchState is no longer needed, and it thereby no longer depends on
    NEED_CPU_H.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    committed Dec 17, 2012
  4. cpu: Move cpu_index field to CPUState

    Note that target-alpha accesses this field from TCG, now using a
    negative offset. Therefore the field is placed last in CPUState.
    
    Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.
    
    Move common parts of mips cpu_state_reset() to mips_cpu_reset().
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Acked-by: Richard Henderson <rth@twiddle.net> (for alpha)
    committed Dec 17, 2012
  5. cpu: Move numa_node field to CPUState

    Signed-off-by: Andreas Färber <afaerber@suse.de>
    committed Dec 17, 2012
  6. target-mips: Clean up mips_cpu_map_tc() documentation

    This function will be touched again soon, so a good understanding of env
    vs. other helps. Adopt gtk-doc style.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Reviewed-by: Eric Johnson <ericj@mips.com>
    committed Dec 17, 2012
  7. cpu: Move nr_{cores,threads} fields to CPUState

    Pass MIPSCPU to malta_mips_config(); avoid that for mips_cpu_map_tc()
    since callers only access MIPS Thread Contexts, inside TCG helpers.
    
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    committed Dec 17, 2012
Commits on Jan 9, 2013
  1. Merge remote-tracking branch 'mdroth/qga-pull-1-8-2013' into staging

    * mdroth/qga-pull-1-8-2013:
      qemu-ga: sample fsfreeze hooks
      qemu-ga: execute hook to quiesce the guest on fsfreeze-freeze/thaw
      qemu-ga: guest_suspend(): improve error reporting
      qemu-ga: bios_supports_mode(): improve error reporting
      qemu-ga: qmp_guest_network_get_interfaces(): get rid of snprintf() + error_set()
      qemu-ga: qmp_guest_fstrim(): get rid of sprintf() + error_set()
      qemu-ga: qmp_guest_fsfreeze_*(): get rid of sprintf() + error_set()
      qemu-ga: build_fs_mount_list(): take an Error argument
      qemu-ga: qmp_guest_shutdown(): improve error reporting
      qemu-ga: qmp_guest_file_*: improve error reporting
      qemu-ga: qmp_guest_file_close(): fix fclose() error check
      qemu-ga: guest_file_handle_find(): take an Error argument
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Anthony Liguori committed Jan 9, 2013
Commits on Jan 8, 2013
  1. qemu-ga: sample fsfreeze hooks

    Adds sample hook scripts for --fsfreeze-hook option of qemu-ga.
      - fsfreeze-hook : execute scripts in fsfreeze-hook.d/
      - fsfreeze-hook.d/mysql-flush.sh.sample : quiesce MySQL before snapshot
    
    Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    gpsnavi committed with mdroth Dec 12, 2012
  2. qemu-ga: execute hook to quiesce the guest on fsfreeze-freeze/thaw

    To use the online disk snapshot for online-backup, application-level
    consistency of the snapshot image is required. However, currently the
    guest agent can provide only filesystem-level consistency, and the
    snapshot may contain dirty data, for example, incomplete transactions.
    This patch provides the opportunity to quiesce applications before
    snapshot is taken.
    
    If --fsfreeze-hook option is specified, the hook is executed with
    "freeze" argument before the filesystem is frozen by fsfreeze-freeze
    command. As for fsfreeze-thaw command, the hook is executed with "thaw"
    argument after the filesystem is thawed.
    
    This patch depends on patchset to improve error reporting by Luiz Capitulino:
      http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg03016.html
    
    Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    
    *clarified usage in help output
    
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    gpsnavi committed with mdroth Dec 12, 2012
  3. qemu-ga: guest_suspend(): improve error reporting

    Most errors are QERR_UNDEFINED_ERROR today.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  4. qemu-ga: bios_supports_mode(): improve error reporting

    Most errors are QERR_UNDEFINED_ERROR today.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  5. qemu-ga: qmp_guest_network_get_interfaces(): get rid of snprintf() + …

    …error_set()
    
    Convert them to error_setg_errno().
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  6. qemu-ga: qmp_guest_fstrim(): get rid of sprintf() + error_set()

    Convert them to error_setg_errno().
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  7. qemu-ga: qmp_guest_fsfreeze_*(): get rid of sprintf() + error_set()

    Convert them to error_setg_errno().
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  8. qemu-ga: build_fs_mount_list(): take an Error argument

    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 29, 2012
  9. qemu-ga: qmp_guest_shutdown(): improve error reporting

    Most errors are QERR_UNDEFINED_ERROR. Also, adds ga_wait_child() as
    a future commit will use it too.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  10. qemu-ga: qmp_guest_file_*: improve error reporting

    Use error_setg_errno() when possible with an improved error description.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  11. qemu-ga: qmp_guest_file_close(): fix fclose() error check

    fclose() returns EOF on error.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  12. qemu-ga: guest_file_handle_find(): take an Error argument

    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    
    *Fixed missing space character in error message
    
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Luiz Capitulino committed with mdroth Nov 27, 2012
  13. Merge remote-tracking branch 'afaerber/qom-cpu' into staging

    * afaerber/qom-cpu:
      target-i386: Explicitly set vendor for each built-in cpudef
      target-i386: Sanitize AMD's ext2_features at realize time
      target-i386: Filter out unsupported features at realize time
      qemu-common.h: Make qemu_init_vcpu() stub static inline
      target-i386: check/enforce: Eliminate check_feat field
      target-i386: check/enforce: Check SVM flag support as well
      target-i386: check/enforce: Check all CPUID.80000001H.EDX bits
      target-i386: check/enforce: Do not ignore "hypervisor" flag
      target-i386: check/enforce: Fix CPUID leaf numbers on error messages
      target-i386: kvm: Enable all supported KVM features for -cpu host
      target-i386: kvm: -cpu host: Use GET_SUPPORTED_CPUID for SVM features
      cpu: Change parent type to Device
      qdev: Don't assume existence of parent bus on unparenting
      qdev: Include qdev code into *-user, too
      libqemustub: sysbus_get_default() stub
      libqemustub: vmstate register/unregister stubs
      libqemustub: Add qemu_[un]register_reset() stubs
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Anthony Liguori committed Jan 8, 2013
  14. target-i386: Explicitly set vendor for each built-in cpudef

    Since cpudef config is not supported anymore and all remaining sources
    now always set x86_def_t.vendor[123] fields, remove setting default
    vendor to simplify future re-factoring.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov committed with Dec 28, 2012
  15. target-i386: Sanitize AMD's ext2_features at realize time

    When CPU properties are implemented, ext2_features may change
    between object_new(CPU) and cpu_realize_fn(). Sanitizing
    ext2_features for AMD based CPU at realize() time will keep
    current behavior after CPU features are converted to properties.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov committed with Dec 28, 2012
  16. target-i386: Filter out unsupported features at realize time

    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Igor Mammedov committed with Dec 28, 2012
  17. qemu-common.h: Make qemu_init_vcpu() stub static inline

    Turn the *-user macro into a no-op inline function to avoid
    unused-variable warnings and band-aiding #ifdef'ery.
    
    This allows to drop an #ifdef for alpha and avoids more for unicore32
    and other upcoming trivial realizefn implementations.
    
    Suggested-by: Lluís Vilanova <vilanova@ac.upc.edu>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    committed Jan 5, 2013
  18. target-i386: check/enforce: Eliminate check_feat field

    Now that all entries have check_feat=~0 in
    kvm_check_features_against_host(), we can eliminate check_feat entirely
    and make the code check all bits.
    
    This patch shouldn't introduce any behavior change, as check_feat is set
    to ~0 on all entries.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  19. target-i386: check/enforce: Check SVM flag support as well

    When nested SVM is supported, the kernel returns the SVM flag on
    GET_SUPPORTED_CPUID[1], so we can check the SVM flag safely in
    kvm_check_features_against_host().
    
    I don't know why the original code ignored the SVM flag. Maybe it was
    because kvm_cpu_fill_host() used the CPUID instruction directly instead
    of GET_SUPPORTED_CPUID
    
    [1] Older kernels (before v2.6.37) returned the SVM flag even if nested
        SVM was _not_ supported. So the only cases where this patch should
        change behavior is when SVM is being requested by the user or the
        CPU model, but not supported by the host. And on these cases we
        really want QEMU to abort if the "enforce" option is set.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  20. target-i386: check/enforce: Check all CPUID.80000001H.EDX bits

    I have no idea why PPRO_FEATURES was being ignored on the check of the
    CPUID.80000001H.EDX bits. I believe it was a mistake, and it was
    supposed to be ~(PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) or just
    ~CPUID_EXT2_AMD_ALIASES, because some time ago kvm_cpu_fill_host() used
    the CPUID instruction directly (instead of
    kvm_arch_get_supported_cpuid()).
    
    But now kvm_cpu_fill_host() uses kvm_arch_get_supported_cpuid(), and
    kvm_arch_get_supported_cpuid() returns all supported bits for
    CPUID.80000001H.EDX, even the AMD aliases (that are explicitly copied
    from CPUID.01H.EDX), so we can make the code check/enforce all the
    CPUID.80000001H.EDX bits.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  21. target-i386: check/enforce: Do not ignore "hypervisor" flag

    We don't need any hack to ignore CPUID_EXT_HYPERVISOR anymore, because
    kvm_arch_get_supported_cpuid() now sets CPUID_EXT_HYPERVISOR properly.
    So, this shouldn't introduce any behavior change, but it makes the code
    simpler.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  22. target-i386: check/enforce: Fix CPUID leaf numbers on error messages

    The -cpu check/enforce warnings are printing incorrect information about the
    missing flags. There are no feature flags on CPUID leaves 0 and 0x80000000, but
    there were references to 0 and 0x80000000 in the table at
    kvm_check_features_against_host().
    
    This changes the model_features_t struct to contain the register number as
    well, so the error messages print the correct CPUID leaf+register information,
    instead of wrong CPUID leaf numbers.
    
    This also changes the format of the error messages, so they follow the
    "CPUID.<leaf>.<register>.<name> [bit <offset>]" convention used in Intel
    documentation. Example output:
    
        $ qemu-system-x86_64 -machine pc-1.0,accel=kvm -cpu Opteron_G4,+ia64,enforce
        warning: host doesn't support requested feature: CPUID.01H:EDX.ia64 [bit 30]
        warning: host doesn't support requested feature: CPUID.01H:ECX.xsave [bit 26]
        warning: host doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.misalignsse [bit 7]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.3dnowprefetch [bit 8]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.xop [bit 11]
        warning: host doesn't support requested feature: CPUID.80000001H:ECX.fma4 [bit 16]
        Unable to find x86 CPU definition
        $
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  23. target-i386: kvm: Enable all supported KVM features for -cpu host

    When using -cpu host, we don't need to use the kvm_default_features
    variable, as the user is explicitly asking QEMU to enable all feature
    supported by the host.
    
    This changes the kvm_cpu_fill_host() code to use GET_SUPPORTED_CPUID to
    initialize the kvm_features field, so we get all host KVM features
    enabled.
    
    This will also allow us to properly check/enforce KVM features inside
    kvm_check_features_against_host() later. For example, we will be able to
    make this:
    
      $ qemu-system-x86_64 -cpu ...,+kvm_pv_eoi,enforce
    
    refuse to start if kvm_pv_eoi is not supported by the host (after we fix
    kvm_check_features_against_host() to check KVM flags as well).
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  24. target-i386: kvm: -cpu host: Use GET_SUPPORTED_CPUID for SVM features

    The existing -cpu host code simply sets every bit inside svm_features
    (initializing it to -1), and that makes it impossible to make the
    enforce/check options work properly when the user asks for SVM features
    explicitly in the command-line.
    
    So, instead of initializing svm_features to -1, use GET_SUPPORTED_CPUID
    to fill only the bits that are supported by the host (just like we do
    for all other CPUID feature words inside kvm_cpu_fill_host()).
    
    This will keep the existing behavior (as filter_features_for_kvm()
    already uses GET_SUPPORTED_CPUID to filter svm_features), but will allow
    us to properly check for KVM features inside
    kvm_check_features_against_host() later.
    
    For example, we will be able to make this:
    
      $ qemu-system-x86_64 -cpu ...,+pfthreshold,enforce
    
    refuse to start if the SVM "pfthreshold" feature is not supported by the
    host (after we fix kvm_check_features_against_host() to check SVM flags
    as well).
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Jan 4, 2013
  25. cpu: Change parent type to Device

    This finally makes the CPU class a subclass of the Device class,
    allowing us to start using DeviceState properties on CPU subclasses.
    
    It has no_user=1, as creating CPUs using -device doesn't work yet.
    
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Dec 5, 2012
  26. qdev: Don't assume existence of parent bus on unparenting

    Commit 667d22d (qdev: move bus removal
    to object_unparent) made the assumption that at unparenting time
    parent_bus is not NULL. This assumption is unjustified since
    object_unparent() may well be called directly after object_initialize(),
    without any qdev_set_parent_bus().
    
    This did not cause any issues yet because qdev_[try_]create() does call
    qdev_set_parent_bus(), falling back to SysBus if unsupplied.
    
    While at it, ensure that this new function uses the device_ prefix and
    make the name more neutral in light of this semantic change.
    
    Reported-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    Tested-by: Igor Mammedov <imammedo@redhat.com>
    committed Jan 4, 2013
  27. qdev: Include qdev code into *-user, too

    The code depends on some functions from qemu-option.o, so add
    qemu-option.o to universal-obj-y to make sure it's included.
    
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas Färber <afaerber@suse.de>
    ehabkost committed with Dec 5, 2012