From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v8 9/9] qtest/hyperv: Introduce a simple hyper-v test
Date: Fri, 16 Jul 2021 14:12:06 +0200 [thread overview]
Message-ID: <875yxa1mqx.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20210709102242.2a7cd7f7@redhat.com>
Igor Mammedov <imammedo@redhat.com> writes:
> On Thu, 8 Jul 2021 17:02:22 -0400
> Eduardo Habkost <ehabkost@redhat.com> wrote:
>
>> On Tue, Jun 08, 2021 at 02:08:17PM +0200, Vitaly Kuznetsov wrote:
>> > For the beginning, just test 'hv-passthrough' and a couple of custom
>> > Hyper-V enlightenments configurations through QMP. Later, it would
>> > be great to complement this by checking CPUID values from within the
>> > guest.
>> >
>> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> [...]
>> > +static bool kvm_has_sys_hyperv_cpuid(void)
>> > +{
>> > + int fd = open("/dev/kvm", O_RDWR);
>> > + int ret;
>> > +
>> > + g_assert(fd > 0);
>>
g_assert() was an overkill, just 'return false' would do.
>> This crashes when /dev/kvm doesn't exist. See:
>> https://gitlab.com/ehabkost/qemu/-/jobs/1404084459
>
> maybe reuse qtest_has_accel()
> https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg06864.html
>
> instead of op encoding it.
The purpose of this function is to check if KVM_CAP_SYS_HYPERV_CPUID is
supported by KVM. It is certainly unsupported when KVM is not present
:-) but an ioctl() is needed when it is.
We already have a similar check in tests/qtest/migration-test.c where we
test for KVM_CAP_DIRTY_LOG_RING, maybe we can create a library function
but we don't seem to have any KVM-specific stuff in qtest at this moment
...
>> I'm removing it from the queue.
I'll fix g_assert() and send as a separate patch if it's fine.
--
Vitaly
next prev parent reply other threads:[~2021-07-16 12:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 12:08 [PATCH v8 0/9] i386: KVM: expand Hyper-V features early Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 1/9] i386: avoid hardcoding '12' as 'hyperv_vendor_id' length Vitaly Kuznetsov
2021-06-08 12:12 ` Philippe Mathieu-Daudé
2021-06-08 12:08 ` [PATCH v8 2/9] i386: clarify 'hv-passthrough' behavior Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 3/9] i386: hardcode supported eVMCS version to '1' Vitaly Kuznetsov
2021-06-08 12:52 ` Eduardo Habkost
2021-06-16 8:12 ` Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 4/9] i386: make hyperv_expand_features() return bool Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 5/9] i386: expand Hyper-V features during CPU feature expansion time Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 6/9] i386: kill off hv_cpuid_check_and_set() Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 7/9] i386: HV_HYPERCALL_AVAILABLE privilege bit is always needed Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 8/9] i386: Hyper-V SynIC requires POST_MESSAGES/SIGNAL_EVENTS privileges Vitaly Kuznetsov
2021-06-08 12:08 ` [PATCH v8 9/9] qtest/hyperv: Introduce a simple hyper-v test Vitaly Kuznetsov
2021-06-08 12:52 ` Eduardo Habkost
2021-07-08 21:02 ` Eduardo Habkost
2021-07-09 8:22 ` Igor Mammedov
2021-07-16 12:12 ` Vitaly Kuznetsov [this message]
2021-07-19 13:56 ` Igor Mammedov
2021-07-07 14:00 ` [PATCH v8 0/9] i386: KVM: expand Hyper-V features early Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yxa1mqx.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.