Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-04-06 Thread Olaf Hering
Am Mon, 6 Apr 2020 18:00:45 +0200
schrieb Paolo Bonzini :

> On 28/03/20 08:09, Olaf Hering wrote:
> > On Fri, Mar 27, Paolo Bonzini wrote:
> >   
> >> Looks good, I would just do the following adjustments to have more
> >> consistency between pc and xenfv machine types  
> > 
> > Do you want me to resend with this change?  
> 
> Had you tested this patch?  It fails qom-test, test-qmp and test-hmp
> because xenfv-qemu4 is not blacklisted.  Anyway I fixed it up and will
> include it in my next pull request.

I did not specifically test your follow-up change, it just renamed variables.

I also got failures from automated testing.
To me they looked like unrelated general errors in the testing framework.
Sorry if I overlooked the essential piece of info that said it was a regression 
caused by the tested changes.

Olaf


pgp9dxuZPOQOq.pgp
Description: Digitale Signatur von OpenPGP


Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-04-06 Thread Paolo Bonzini
On 28/03/20 08:09, Olaf Hering wrote:
> On Fri, Mar 27, Paolo Bonzini wrote:
> 
>> Looks good, I would just do the following adjustments to have more
>> consistency between pc and xenfv machine types
> 
> Do you want me to resend with this change?

Had you tested this patch?  It fails qom-test, test-qmp and test-hmp
because xenfv-qemu4 is not blacklisted.  Anyway I fixed it up and will
include it in my next pull request.

Paolo




Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-28 Thread Paolo Bonzini
Nope, that's fine. If you are okay I can apply them myself.

Paolo

Il sab 28 mar 2020, 08:09 Olaf Hering  ha scritto:

> On Fri, Mar 27, Paolo Bonzini wrote:
>
> > Looks good, I would just do the following adjustments to have more
> > consistency between pc and xenfv machine types
>
> Do you want me to resend with this change?
>
> Olaf
>
>


Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-28 Thread Olaf Hering
On Fri, Mar 27, Paolo Bonzini wrote:

> Looks good, I would just do the following adjustments to have more
> consistency between pc and xenfv machine types

Do you want me to resend with this change?

Olaf



Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200327151841.13877-1-o...@aepfle.de/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

PASS 1 fdc-test /x86_64/fdc/cmos
PASS 2 fdc-test /x86_64/fdc/no_media_on_start
PASS 3 fdc-test /x86_64/fdc/read_without_media
==6166==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 4 fdc-test /x86_64/fdc/media_change
PASS 5 fdc-test /x86_64/fdc/sense_interrupt
PASS 6 fdc-test /x86_64/fdc/relative_seek
---
PASS 32 test-opts-visitor /visitor/opts/range/beyond
PASS 33 test-opts-visitor /visitor/opts/dict/unvisited
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  
tests/test-coroutine -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl 
--test-name="test-coroutine" 
==6201==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
==6201==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 
0x7ffc7cdd3000; bottom 0x7ff2b73e8000; size: 0x0009c59eb000 (41970216960)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-coroutine /basic/no-dangling-access
---
PASS 12 test-aio /aio/event/flush
PASS 13 test-aio /aio/event/wait/no-flush-cb
PASS 11 fdc-test /x86_64/fdc/read_no_dma_18
==6216==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 14 test-aio /aio/timer/schedule
PASS 15 test-aio /aio/coroutine/queue-chaining
PASS 16 test-aio /aio-gsource/flush
---
PASS 28 test-aio /aio-gsource/timer/schedule
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  
tests/test-aio-multithread -m=quick -k --tap < /dev/null | 
./scripts/tap-driver.pl --test-name="test-aio-multithread" 
PASS 12 fdc-test /x86_64/fdc/read_no_dma_19
==6221==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 1 test-aio-multithread /aio/multi/lifecycle
PASS 13 fdc-test /x86_64/fdc/fuzz-registers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  
QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img 
tests/qtest/ide-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl 
--test-name="ide-test" 
==6238==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 2 test-aio-multithread /aio/multi/schedule
PASS 1 ide-test /x86_64/ide/identify
==6249==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 2 ide-test /x86_64/ide/flush
PASS 3 test-aio-multithread /aio/multi/mutex/contended
==6255==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 3 ide-test /x86_64/ide/bmdma/simple_rw
==6266==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 4 ide-test /x86_64/ide/bmdma/trim
==6272==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 4 test-aio-multithread /aio/multi/mutex/handoff
PASS 5 test-aio-multithread /aio/multi/mutex/mcs
PASS 6 test-aio-multithread /aio/multi/mutex/pthread
---
PASS 6 test-throttle /throttle/detach_attach
PASS 7 test-throttle /throttle/config_functions
PASS 8 test-throttle /throttle/accounting
==6289==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 9 test-throttle /throttle/groups
PASS 10 test-throttle /throttle/config/enabled
PASS 11 test-throttle /throttle/config/conflicting
---
PASS 14 test-throttle /throttle/config/max
PASS 15 test-throttle /throttle/config/iops_size
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  
tests/test-thread-pool -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl 
--test-name="test-thread-pool" 
==6293==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 1 test-thread-pool /thread-pool/submit
PASS 2 test-thread-pool /thread-pool/submit-aio
PASS 3 test-thread-pool /thread-pool/submit-co
PASS 4 test-thread-pool /thread-pool/submit-many
==6360==WARNING: ASan doesn't fully support makecontext/swapcontext functions 
and may produce false positives in some cases!
PASS 5 test-thread-pool /thread-pool/cancel
PASS 6 test-thread-pool /thread-pool/cancel-async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  

Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-27 Thread Paolo Bonzini
Looks good, I would just do the following adjustments to have more
consistency between pc and xenfv machine types:

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index c565f41791..eb7b273508 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -948,26 +948,26 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
 
 
 #ifdef CONFIG_XEN
-static void xenfv_qemu_4_x_machine_options(MachineClass *m)
+static void xenfv_4_2_machine_options(MachineClass *m)
 {
 pc_i440fx_4_2_machine_options(m);
-m->desc = "Xen Fully-virtualized PC (qemu 4.x compat)";
+m->desc = "Xen Fully-virtualized PC";
 m->max_cpus = HVM_MAX_VCPUS;
 m->default_machine_opts = "accel=xen";
-m->smbus_no_migration_support = false;
 }
 
-DEFINE_PC_MACHINE(xenfv_qemu4, "xenfv-qemu4", pc_xen_hvm_init,
-  xenfv_qemu_4_x_machine_options);
+DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
+  xenfv_4_2_machine_options);
 
-static void xenfv_machine_options(MachineClass *m)
+static void xenfv_3_1_machine_options(MachineClass *m)
 {
 pc_i440fx_3_1_machine_options(m);
 m->desc = "Xen Fully-virtualized PC";
+m->alias = "xenfv";
 m->max_cpus = HVM_MAX_VCPUS;
 m->default_machine_opts = "accel=xen";
 }
 
-DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
-  xenfv_machine_options);
+DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
+  xenfv_3_1_machine_options);
 #endif


On 27/03/20 16:18, Olaf Hering wrote:
> With qemu4 an incompatible change was added to pc_piix, which makes it
> practical impossible to migrate domUs started with qemu2 or qemu3 to
> newer qemu versions. Commit 7fccf2a06890e3bc3b30e29827ad3fb93fe88fea
> added and enabled a new member "smbus_no_migration_support". In commit
> 4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf the vmstate_acpi got new
> elements, which are conditionally filled. As a result, an incoming
> migration expected smbus related data unless smbus migration was
> disabled for a given MachineClass. Since first commit forgot to handle
> 'xenfv', domUs started with qemu4 are incompatible with their qemu3
> siblings.
> 
> Using other existing machine types, such as 'pc-i440fx-3.1', is not
> possible because 'xenfv' creates the 'xen-platform' PCI device at
> 00:02.0, while all other variants to run a domU would create it at
> 00:04.0.
> 
> To cover both the existing and the broken case of 'xenfv' in a single
> qemu binary, a new compatibility variant of 'xenfv-qemu4' must be added
> which targets domUs started with qemu-4.0, qemu-4.1 and qemu-4.2. The
> existing 'xenfv' restores compatibility of qemu5+ with qemu2/3.
> 
> Host admins who started domUs with qemu-4.x have to use a wrapper script
> which appends '-machine xenfv-qemu4' to the device-model command line.
> This is only required if there is no maintenance window which allows to
> temporary shutdown the domU and restart it with a fixed device-model.
> 
> The wrapper script is as simple as this:
>   #!/bin/sh
>   exec /usr/bin/qemu-system-i386 "$@" -machine xenfv-qemu4
> 
> With xl this script will be enabled with device_model_override=, see
> xl.cfg(5). To live migrate a domU, adjust the existing domU.cfg and pass
> it to xl migrate or xl save/restore:
>   xl migrate -C new-domU.cfg domU remote-host
>   xl save domU CheckpointFile new-domU.cfg
>   xl restore new-domU.cfg CheckpointFile
> 
> With libvirt this script will be enabled with the  element in
> domU.xml. Use 'virsh edit' prior 'virsh migrate' to replace the existing
>  element to point it to the wrapper script.
> 
> Signed-off-by: Olaf Hering 
> ---
>  hw/i386/pc_piix.c | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index e6756216f9..c565f41791 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -948,8 +948,21 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
>  
>  
>  #ifdef CONFIG_XEN
> +static void xenfv_qemu_4_x_machine_options(MachineClass *m)
> +{
> +pc_i440fx_4_2_machine_options(m);
> +m->desc = "Xen Fully-virtualized PC (qemu 4.x compat)";
> +m->max_cpus = HVM_MAX_VCPUS;
> +m->default_machine_opts = "accel=xen";
> +m->smbus_no_migration_support = false;
> +}
> +
> +DEFINE_PC_MACHINE(xenfv_qemu4, "xenfv-qemu4", pc_xen_hvm_init,
> +  xenfv_qemu_4_x_machine_options);
> +
>  static void xenfv_machine_options(MachineClass *m)
>  {
> +pc_i440fx_3_1_machine_options(m);
>  m->desc = "Xen Fully-virtualized PC";
>  m->max_cpus = HVM_MAX_VCPUS;
>  m->default_machine_opts = "accel=xen";
> 




Re: [PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200327151841.13877-1-o...@aepfle.de/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing 
commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

qemu-system-x86_64: The -accel and "-machine accel=" options are incompatible
socket_accept failed: Resource temporarily unavailable
**
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake:
 assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
/tmp/qemu-test/src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate 
QEMU process but encountered exit status 1 (expected 0)
ERROR - Bail out! 
ERROR:/tmp/qemu-test/src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake:
 assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs
  TESTiotest-qcow2: 220
  TESTiotest-qcow2: 226
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', 
'--label', 'com.qemu.instance.uuid=c0802ac7d3fa41b7a139924b4a378319', '-u', 
'1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', 
'-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 
'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', 
'/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', 
'/var/tmp/patchew-tester-tmp-aaptxbb4/src/docker-src.2020-03-27-11.31.38.7191:/var/tmp/qemu:z,ro',
 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit 
status 2.
filter=--filter=label=com.qemu.instance.uuid=c0802ac7d3fa41b7a139924b4a378319
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-aaptxbb4/src'
make: *** [docker-run-test-quick@centos7] Error 2

real13m59.403s
user0m8.306s


The full log is available at
http://patchew.org/logs/20200327151841.13877-1-o...@aepfle.de/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-de...@redhat.com

[PATCH v4] piix: fix xenfv regression, add compat machine xenfv-qemu4

2020-03-27 Thread Olaf Hering
With qemu4 an incompatible change was added to pc_piix, which makes it
practical impossible to migrate domUs started with qemu2 or qemu3 to
newer qemu versions. Commit 7fccf2a06890e3bc3b30e29827ad3fb93fe88fea
added and enabled a new member "smbus_no_migration_support". In commit
4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf the vmstate_acpi got new
elements, which are conditionally filled. As a result, an incoming
migration expected smbus related data unless smbus migration was
disabled for a given MachineClass. Since first commit forgot to handle
'xenfv', domUs started with qemu4 are incompatible with their qemu3
siblings.

Using other existing machine types, such as 'pc-i440fx-3.1', is not
possible because 'xenfv' creates the 'xen-platform' PCI device at
00:02.0, while all other variants to run a domU would create it at
00:04.0.

To cover both the existing and the broken case of 'xenfv' in a single
qemu binary, a new compatibility variant of 'xenfv-qemu4' must be added
which targets domUs started with qemu-4.0, qemu-4.1 and qemu-4.2. The
existing 'xenfv' restores compatibility of qemu5+ with qemu2/3.

Host admins who started domUs with qemu-4.x have to use a wrapper script
which appends '-machine xenfv-qemu4' to the device-model command line.
This is only required if there is no maintenance window which allows to
temporary shutdown the domU and restart it with a fixed device-model.

The wrapper script is as simple as this:
  #!/bin/sh
  exec /usr/bin/qemu-system-i386 "$@" -machine xenfv-qemu4

With xl this script will be enabled with device_model_override=, see
xl.cfg(5). To live migrate a domU, adjust the existing domU.cfg and pass
it to xl migrate or xl save/restore:
  xl migrate -C new-domU.cfg domU remote-host
  xl save domU CheckpointFile new-domU.cfg
  xl restore new-domU.cfg CheckpointFile

With libvirt this script will be enabled with the  element in
domU.xml. Use 'virsh edit' prior 'virsh migrate' to replace the existing
 element to point it to the wrapper script.

Signed-off-by: Olaf Hering 
---
 hw/i386/pc_piix.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index e6756216f9..c565f41791 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -948,8 +948,21 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
 
 
 #ifdef CONFIG_XEN
+static void xenfv_qemu_4_x_machine_options(MachineClass *m)
+{
+pc_i440fx_4_2_machine_options(m);
+m->desc = "Xen Fully-virtualized PC (qemu 4.x compat)";
+m->max_cpus = HVM_MAX_VCPUS;
+m->default_machine_opts = "accel=xen";
+m->smbus_no_migration_support = false;
+}
+
+DEFINE_PC_MACHINE(xenfv_qemu4, "xenfv-qemu4", pc_xen_hvm_init,
+  xenfv_qemu_4_x_machine_options);
+
 static void xenfv_machine_options(MachineClass *m)
 {
+pc_i440fx_3_1_machine_options(m);
 m->desc = "Xen Fully-virtualized PC";
 m->max_cpus = HVM_MAX_VCPUS;
 m->default_machine_opts = "accel=xen";