Re: [RFC PATCH kvm-unit-tests] x86: add ioregionfd fast PIO test

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

 



On Mon, Mar 01, 2021 at 09:33:19PM +0300, Elena Afanasova wrote:
> @@ -159,6 +166,8 @@ function run()
>          print_result "FAIL" $testname "$summary"
>      fi
>  
> +    [ -n "${fifo}" ] && rm -rf $fifo

Is there a guarantee that $helper_cmd has terminated? If not then it
would be good to store its pid and invoke kill $helper_cmd_pid here
(maybe with an error message indicating helper_cmd hung).

> diff --git a/x86/ioregionfd-test.c b/x86/ioregionfd-test.c
> new file mode 100644
> index 0000000..5ea5e57
> --- /dev/null
> +++ b/x86/ioregionfd-test.c
> @@ -0,0 +1,84 @@

Please add a comment describing the purpose of this program.

> +	pollfd.fd = read_fd;
> +	pollfd.events = POLLIN;
> +
> +	for (;;) {
> +		ret = poll(&pollfd, 1, -1);
> +		if (ret < 0) {
> +			close(read_fd);
> +			if (write_fd > 0)
> +				close(write_fd);
> +			err_exit("poll\n");
> +		}

Is poll() necessary? I think a blocking read(read_fd) would have the
same effect and simplify the code?

> diff --git a/x86/ioregionfd_pio.c b/x86/ioregionfd_pio.c
> new file mode 100644
> index 0000000..eaf8aad
> --- /dev/null
> +++ b/x86/ioregionfd_pio.c
> @@ -0,0 +1,24 @@

Please add a comment explaining the purpose of this test.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux