qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 87bf1f: python/machine: add @sock_dir propert


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 87bf1f: python/machine: add @sock_dir property
Date: Tue, 23 Nov 2021 02:32:46 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 87bf1fe5cbffefe6b7ee13a7015ae285250ad2db
      
https://github.com/qemu/qemu/commit/87bf1fe5cbffefe6b7ee13a7015ae285250ad2db
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/machine/machine.py

  Log Message:
  -----------
  python/machine: add @sock_dir property

Analogous to temp_dir and log_dir, add a sock_dir property that defaults
to @temp_dir -- instead of base_temp_dir -- when the user hasn't
overridden the sock dir value in the initializer.

This gives us a much more unique directory to put sockfiles in by default.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: 6eeb3de7e1aff91ce6e092a39f85946d12664385
      
https://github.com/qemu/qemu/commit/6eeb3de7e1aff91ce6e092a39f85946d12664385
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/machine/machine.py

  Log Message:
  -----------
  python/machine: remove _remove_monitor_sockfile property

It doesn't matter if it was the user or the class itself that specified
where the sockfile should be created; the fact is that if we are using a
sockfile here, we created it and we can clean it up.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: 72b17fe715056c96ea73f187ab46721788b3a782
      
https://github.com/qemu/qemu/commit/72b17fe715056c96ea73f187ab46721788b3a782
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/machine/machine.py

  Log Message:
  -----------
  python/machine: add instance disambiguator to default nickname

If you create two instances of QEMUMachine(), they'll both create the
same nickname by default -- which is not that helpful.

Luckily, they'll both create unique temporary directories ... but due to
user configuration, they may share logging and sockfile directories,
meaning two instances can collide. The Python logging will also be quite
confusing, with no differentiation between the two instances.

Add an instance disambiguator (The memory address of the instance) to
the default nickname to foolproof this in all cases.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-4-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: b1ca99199320fcc010f407b84ac00d96e7e4baa1
      
https://github.com/qemu/qemu/commit/b1ca99199320fcc010f407b84ac00d96e7e4baa1
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/machine/machine.py

  Log Message:
  -----------
  python/machine: move more variable initializations to _pre_launch

No need to clear them only to set them later.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-5-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: 1611e6cf4e7163f6102b37010a8b7e7120f468b5
      
https://github.com/qemu/qemu/commit/1611e6cf4e7163f6102b37010a8b7e7120f468b5
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/machine/machine.py

  Log Message:
  -----------
  python/machine: handle "fast" QEMU terminations

In the case that the QEMU process actually launches -- but then dies so
quickly that we can't establish a QMP connection to it -- QEMUMachine
currently calls _post_shutdown() assuming that it never launched the VM
process.

This isn't true, though: it "merely" may have failed to establish a QMP
connection and the process is in the middle of its own exit path.

If we don't wait for the subprocess, the caller may get a bogus `None`
return for .exitcode(). This behavior was observed from
device-crash-test; after the switch to Async QMP, the timings were
changed such that it was now seemingly possible to witness the failure
of "vm.launch()" *prior* to the exitcode becoming available.

The semantic of the `_launched` property is changed in this
patch. Instead of representing the condition "launch() executed
successfully", it will now represent "has forked a child process
successfully". This way, wait() when called in the exit path won't
become a no-op.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-6-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: 206439cd8937a3dc556537074d5d37e5d74eb0d0
      
https://github.com/qemu/qemu/commit/206439cd8937a3dc556537074d5d37e5d74eb0d0
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M scripts/device-crash-test

  Log Message:
  -----------
  scripts/device-crash-test: Use a QMP timeout

Despite all the previous fixes, it's still possible for
device-crash-test to wedge itself in the case that QEMU terminates *so
quickly* that it doesn't even begin a connection attempt to our QMP
client. Python will just joyfully wait ad infinitum for a connection
that will now never arrive.

The real fix is to use asyncio to simultaneously poll both the health of
the launched process AND the connection attempt. That's quite a bit more
invasive than just setting a connection timeout, though.

Do the very simplest thing for now.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20211118204620.1897674-7-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: a57cb3e23d5ac918a69d0aab918470ff0b429ff9
      
https://github.com/qemu/qemu/commit/a57cb3e23d5ac918a69d0aab918470ff0b429ff9
  Author: John Snow <jsnow@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M python/qemu/aqmp/qmp_client.py

  Log Message:
  -----------
  python/aqmp: fix send_fd_scm for python 3.6.x

3.6 doesn't play keepaway with the socket object, so we don't need to go
fishing for it on this version. In fact, so long as 'sendmsg' is still
available, it's probably preferable to just use that method and only go
fishing for forbidden details when we absolutely have to.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20211118204620.1897674-8-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>


  Commit: 3c2a46d5286b475ce9fc81cbf0ed47af5adeff6b
      
https://github.com/qemu/qemu/commit/3c2a46d5286b475ce9fc81cbf0ed47af5adeff6b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M python/qemu/aqmp/qmp_client.py
    M python/qemu/machine/machine.py
    M scripts/device-crash-test

  Log Message:
  -----------
  Merge tag 'python-pull-request' of https://gitlab.com/jsnow/qemu into staging

Python testing fixes for 6.2

A few more fixes to help eliminate race conditions from
device-crash-test, along with a fix that allows the SCM_RIGHTS
functionality to work on hosts that only have Python 3.6.

If this is too much this late in the RC process, I'd advocate for at
least patch 7/7 by itself.

# gpg: Signature made Tue 23 Nov 2021 03:37:17 AM CET
# gpg:                using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]

* tag 'python-pull-request' of https://gitlab.com/jsnow/qemu:
  python/aqmp: fix send_fd_scm for python 3.6.x
  scripts/device-crash-test: Use a QMP timeout
  python/machine: handle "fast" QEMU terminations
  python/machine: move more variable initializations to _pre_launch
  python/machine: add instance disambiguator to default nickname
  python/machine: remove _remove_monitor_sockfile property
  python/machine: add @sock_dir property

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/6d9c9603ad2f...3c2a46d5286b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]