From: Janosch Frank <frankja@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>, kvm@vger.kernel.org
Cc: thuth@redhat.com, imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH 7/8] s390x: uv-host: Properly handle config creation errors
Date: Thu, 23 Mar 2023 15:02:05 +0100 [thread overview]
Message-ID: <db6090cc-a21e-96ad-ff82-7933687c4a93@linux.ibm.com> (raw)
In-Reply-To: <167957758513.13757.3801977482458852875@t14-nrb>
On 3/23/23 14:19, Nico Boehr wrote:
> Quoting Janosch Frank (2023-03-23 11:39:12)
> [...]
>> diff --git a/s390x/uv-host.c b/s390x/uv-host.c
>> index d92571b5..b23d51c9 100644
>> --- a/s390x/uv-host.c
>> +++ b/s390x/uv-host.c
>> @@ -370,6 +370,38 @@ static void test_cpu_create(void)
>> report_prefix_pop();
>> }
>>
>> +/*
>> + * If the first bit of the rc is set we need to destroy the
>> + * configuration before testing other create config errors.
>> + */
>> +static void cgc_destroy_if_needed(struct uv_cb_cgc *uvcb)
>
> Is there a reason why we can't make this a cgc_uv_call() function which performs the uv_call and the cleanups if needed?
I'd much rather put the destroy into the cleanup area after the report.
>
> Mixing reports and cleanup activity feels a bit odd to me.
>
> [...]
>> +/* This function expects errors, not successes */
>
> I am confused by this comment. What does it mean?
>
>> +static bool cgc_check_data(struct uv_cb_cgc *uvcb, uint16_t rc_expected)
>
> Rename to cgc_check_rc_and_handle?
>
>> +{
>> + cgc_destroy_if_needed(uvcb);
>> + /*
>> + * We should only receive a handle when the rc is 1 or the
>> + * first bit is set.
>
> Where is the code that checks for rc == 1?
>
> Ah OK, so that's what you mean with the comment above, this function only works if the UVC fails, right?
>
>> + */
>> + if (!(uvcb->header.rc & UVC_RC_DSTR_NEEDED_FLG) && uvcb->guest_handle)
>> + return false;
>
> It would be nicer if I got a proper report message that tells me that we got a handle even though we shouldn't destroy.
We can report_info() or report_abort().
next prev parent reply other threads:[~2023-03-23 14:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 10:39 [kvm-unit-tests PATCH 0/8] s390x: uv-host: Fixups and extensions part 1 Janosch Frank
2023-03-23 10:39 ` [kvm-unit-tests PATCH 1/8] s390x: uv-host: Fix UV init test memory allocation Janosch Frank
2023-03-23 12:29 ` Nico Boehr
2023-03-23 10:39 ` [kvm-unit-tests PATCH 2/8] s390x: uv-host: Check for sufficient amount of memory Janosch Frank
2023-03-23 12:31 ` Nico Boehr
2023-03-23 10:39 ` [kvm-unit-tests PATCH 3/8] s390x: Add PV tests to unittests.cfg Janosch Frank
2023-03-23 10:39 ` [kvm-unit-tests PATCH 4/8] s390x: uv-host: Beautify code Janosch Frank
2023-03-23 12:52 ` Nico Boehr
2023-03-23 10:39 ` [kvm-unit-tests PATCH 5/8] s390x: uv-host: Add cpu number check Janosch Frank
2023-03-23 12:55 ` Nico Boehr
2023-03-23 10:39 ` [kvm-unit-tests PATCH 6/8] s390x: uv-host: Fix create guest variable storage prefix check Janosch Frank
2023-03-23 13:01 ` Nico Boehr
2023-03-23 10:39 ` [kvm-unit-tests PATCH 7/8] s390x: uv-host: Properly handle config creation errors Janosch Frank
2023-03-23 13:19 ` Nico Boehr
2023-03-23 14:02 ` Janosch Frank [this message]
2023-03-23 10:39 ` [kvm-unit-tests PATCH 8/8] s390x: uv-host: Fence access checks when UV debug is enabled Janosch Frank
2023-03-23 13:21 ` Nico Boehr
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=db6090cc-a21e-96ad-ff82-7933687c4a93@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=thuth@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox