qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: quintela@redhat.com, "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [RFC PATCH 1/1] qtest/migration: Support more than one QEMU binary
Date: Wed, 4 Oct 2023 18:56:30 +0100	[thread overview]
Message-ID: <ZR2nTmmf8AaUV1g2@redhat.com> (raw)
In-Reply-To: <8734yqpedm.fsf@suse.de>

On Wed, Oct 04, 2023 at 12:59:49PM -0300, Fabiano Rosas wrote:
> Juan Quintela <quintela@redhat.com> writes:
> 
> > Fabiano Rosas <farosas@suse.de> wrote:
> >> Daniel P. Berrangé <berrange@redhat.com> writes:
> >>
> >>> On Tue, Oct 03, 2023 at 05:24:50PM +0200, Philippe Mathieu-Daudé wrote:
> > [...]
> >
> >>> $ cat myqemu.dkr 
> >>> FROM fedora:38
> >>>
> >>> RUN dnf -y install qemu-kvm
> >>>
> >>> $ podman build -f myqemu.dkr --tag myqemu .
> >>>
> >>> $ cat > myqemu <<EOF
> >>> #!/bin/sh
> >>> exec podman run --volume /tmp=/tmp --security-opt label=disable myqemu qemu-system-x86_64 "$@"
> >>>
> >>> $ chmod +x myqemu
> >>>
> >>> $ QTEST_QEMU_BINARY=./myqemu.sh  ./build/tests/qtest/rtc-test
> >>
> >> I'm favor of this. I usually set that variable to something like 'gdb
> >> --args ...' and it works just fine.
> >>
> >>> Except we fail on the last step, because bind mounts don't make UNIX domain
> >>> sockets accessible. So we can see the /tmp/qtest-$PID.sock in the container,
> >>> but it can't be used.
> >>>
> >>> UNIX domain sockets in the filesystem are tied to the mount namespace, and
> >>> podman/docker inherantly creates a new mount namespace making the UNIX
> >>> domani socket inaccessible.
> >>>
> >>> UNIX domain sockets in the abstract namespace, however, are tied to the
> >>> network namespace, so if you used podman --network host, they should be
> >>> accessible.
> >>>
> >>> libqtest could be changed to use abstract UNIX domain sockets on Linux
> >>> only, and likely unlock the use of podman for QEMU.
> >
> > That is one idea, but why can't we convince a container to compile
> > _both_ qemus?
> >
> > I am not familiar with containers, but:
> > - We already know how to compile a qemu inside a container
> > - We can teach it to compile $HEAD and v8.0.0 (or whatever)
> >
> > And do the test inside, right?
> >
> > On the other hand, your approach has the advantage that one can test
> > opensuse qemu against fedora qemu, and similar.  Not sure how useful is
> > that, though.
> >
> > [lots of code to find common machine types]
> 
> I'm working on a cleanup of this patch to make it more integrated with
> libqtest. If we teach qtest_get_machines() to sometimes refresh the list
> of machines then it becomes way less code.
> 
> > I think that it is just easier to pass the machine type we want to test
> > to whatever script we have.  Specially where [sane] architectures like
> > arm don't have a default machine type (no, I haven't double checked if
> > that has changed lately).
> 
> We still need to enforce the same machine type for both binaries and a
> sane range of QEMU versions. I think our docs state that we only support
> migration from QEMU n->n+1 and vice versa? If the test will know what
> combinations are allowed, it could just go ahead and use those.

Query the 'pc' (or 'q35' as appropriate) alias on both QEMU versions,
to resolve them into versioned machines.

Then find which resolved machine version(s) exist in both QEMUs, and
prefer the src machine if multiple matches exist.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2023-10-04 17:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 14:19 [RFC PATCH 0/1] tests/migration-test: Allow testing older machine types Fabiano Rosas
2023-10-03 14:19 ` [RFC PATCH 1/1] qtest/migration: Support more than one QEMU binary Fabiano Rosas
2023-10-03 15:24   ` Philippe Mathieu-Daudé
2023-10-03 15:54     ` Daniel P. Berrangé
2023-10-03 16:24       ` Fabiano Rosas
2023-10-04  8:45         ` Juan Quintela
2023-10-04 15:59           ` Fabiano Rosas
2023-10-04 17:56             ` Daniel P. Berrangé [this message]
2023-10-04 18:09               ` Juan Quintela
2023-10-04 18:21                 ` Thomas Huth

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=ZR2nTmmf8AaUV1g2@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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;
as well as URLs for NNTP newsgroup(s).