Re: [PATCH v2 4/7] qemu: get arch name from <cpu> element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 27, 2012 at 14:49:49 +0100, Paolo Bonzini wrote:
> The qemu32 CPU model is chosen based on the <os arch=...> name when
> creating the QEMU command line for a 64-bit host.  For the opposite
> transformation we can test the guest CPU model for the "lm" feature.
> If it is absent, def->os.arch needs to be corrected.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index fc337f7..7fe8c48 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6830,6 +6830,24 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
>          }
>      } while ((p = next));
>  
> +    if (STREQ(dom->os.arch, "x86_64")) {
> +        bool is_32bit = false;
> +        union cpuData *cpuData = NULL;
> +        int ret;
> +
> +        ret = cpuEncode("x86_64", cpu, NULL, &cpuData,
> +                        NULL, NULL, NULL, NULL);
> +        if (ret < 0)
> +            goto error;
> +
> +        is_32bit = (cpuHasFeature("x86_64", cpuData, "lm") != 1);
> +        cpuDataFree("x86_64", cpuData);

OK, this proves I still didn't embed the arch into cpu so that we don't have
to pass it to all cpu* APIs. Perhaps I'll find some time for this soon.

Anyway, you're patch is good, ACK.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]