* [PULL 0/5] Python patches
@ 2021-11-17 0:33 John Snow
2021-11-17 8:47 ` Richard Henderson
2021-11-17 9:41 ` Gerd Hoffmann
0 siblings, 2 replies; 17+ messages in thread
From: John Snow @ 2021-11-17 0:33 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
qemu-block, Alex Bennée, Philippe Mathieu-Daudé,
Wainer dos Santos Moschetta, Markus Armbruster, Willian Rampazzo,
Hanna Reitz, Cleber Rosa, John Snow
The following changes since commit 2b22e7540d6ab4efe82d442363e3fc900cea6584:
Merge tag 'm68k-for-6.2-pull-request' of git://github.com/vivier/qemu-m68k into staging (2021-11-09 13:16:56 +0100)
are available in the Git repository at:
https://gitlab.com/jsnow/qemu.git tags/python-pull-request
for you to fetch changes up to c398a241ec4138e0b995a0215dea84ca93b0384f:
scripts/device-crash-test: hide tracebacks for QMP connect errors (2021-11-16 14:26:36 -0500)
----------------------------------------------------------------
Pull request
----------------------------------------------------------------
John Snow (5):
python/aqmp: Fix disconnect during capabilities negotiation
python/aqmp: fix ConnectError string method
scripts/device-crash-test: simplify Exception handling
scripts/device-crash-test: don't emit AQMP connection errors to stdout
scripts/device-crash-test: hide tracebacks for QMP connect errors
python/qemu/aqmp/protocol.py | 24 ++++++++++++++++++------
scripts/device-crash-test | 33 +++++++++++++++++++++++++--------
2 files changed, 43 insertions(+), 14 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 0:33 John Snow
@ 2021-11-17 8:47 ` Richard Henderson
2021-11-17 9:41 ` Gerd Hoffmann
1 sibling, 0 replies; 17+ messages in thread
From: Richard Henderson @ 2021-11-17 8:47 UTC (permalink / raw)
To: John Snow, qemu-devel
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
qemu-block, Philippe Mathieu-Daudé,
Wainer dos Santos Moschetta, Markus Armbruster, Willian Rampazzo,
Hanna Reitz, Cleber Rosa, Alex Bennée
On 11/17/21 1:33 AM, John Snow wrote:
> The following changes since commit 2b22e7540d6ab4efe82d442363e3fc900cea6584:
>
> Merge tag 'm68k-for-6.2-pull-request' of git://github.com/vivier/qemu-m68k into staging (2021-11-09 13:16:56 +0100)
>
> are available in the Git repository at:
>
> https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> for you to fetch changes up to c398a241ec4138e0b995a0215dea84ca93b0384f:
>
> scripts/device-crash-test: hide tracebacks for QMP connect errors (2021-11-16 14:26:36 -0500)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------
>
> John Snow (5):
> python/aqmp: Fix disconnect during capabilities negotiation
> python/aqmp: fix ConnectError string method
> scripts/device-crash-test: simplify Exception handling
> scripts/device-crash-test: don't emit AQMP connection errors to stdout
> scripts/device-crash-test: hide tracebacks for QMP connect errors
>
> python/qemu/aqmp/protocol.py | 24 ++++++++++++++++++------
> scripts/device-crash-test | 33 +++++++++++++++++++++++++--------
> 2 files changed, 43 insertions(+), 14 deletions(-)
Applied, thanks.
r~
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 0:33 John Snow
2021-11-17 8:47 ` Richard Henderson
@ 2021-11-17 9:41 ` Gerd Hoffmann
2021-11-17 17:56 ` John Snow
1 sibling, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2021-11-17 9:41 UTC (permalink / raw)
To: John Snow
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
qemu-block, Markus Armbruster, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Willian Rampazzo, Hanna Reitz, Cleber Rosa, Alex Bennée
Hi,
> https://gitlab.com/jsnow/qemu.git tags/python-pull-request
What is the status of the plan to upload this to pypi eventually?
thanks,
Gerd
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 9:41 ` Gerd Hoffmann
@ 2021-11-17 17:56 ` John Snow
2021-11-17 18:20 ` Vladimir Sementsov-Ogievskiy
2021-11-18 6:45 ` Gerd Hoffmann
0 siblings, 2 replies; 17+ messages in thread
From: John Snow @ 2021-11-17 17:56 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
qemu-block, Markus Armbruster, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Willian Rampazzo, Hanna Reitz, Cleber Rosa, Alex Bennée
[-- Attachment #1: Type: text/plain, Size: 2911 bytes --]
On Wed, Nov 17, 2021 at 4:42 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> > https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> What is the status of the plan to upload this to pypi eventually?
>
>
Thanks for asking!
The honest answer is "I'm not exactly sure", but there are a few things to
work out still. Let me use this as an opportunity to try and give you an
honest answer.
We've got four packages right now: qmp, aqmp, machine and utils.
- I don't intend to *ever* upload utils, I created that one specifically as
an in-tree package for "low quality" code that we just need as glue.
- aqmp is brand new. It was moved as the default provider for the QMP
protocol in the tree (being used by machine.py) only two weeks ago. I am
using this current RC testing phase to find any problems with it.
- qmp is something I want to deprecate, I don't intend to upload it to
PyPI. I intend to rename aqmp -> qmp and have just the one qmp package. I
can't do this until next release, and only after we are confident and happy
that aqmp is stable enough.
- machine has a few problems with it. I am reluctant to upload it in its
current form. I am actively developing a new version of it that uses the
new Async QMP module. However, this might take a bit of time, I fear.
So, I think I have this timeline for myself:
- Fix bugs in AQMP package revealed during RC testing
- Introduce sync wrapper for AQMP that resembles the native AQMP interface
more than it resembles the "legacy QMP" interface.
- Remove all QEMU source tree uses of qemu.qmp and qemu.aqmp.legacy.
- Delete qemu.qmp and rename qemu.aqmp to qemu.qmp.
- Split python/qemu/qmp out into its own repository and begin uploading it
to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
- Transition any users of the Python packages in the QEMU source tree to
installing the QMP dependency from PyPI instead of grabbing it from the
tree.
- Delete python/qemu/qmp from the QEMU source tree at this moment;
"re-fork" the package if necessary to collect any commits since the "test
split" procedure.
Some questions to work out:
- What tools should be uploaded with qemu.qmp? a version of qmp-shell is
high on the list for me. qom, qom-set, qom-get, qom-list, qom-tree,
qom-fuse etc I am suspecting might be better left behind in qemu.utils
instead, though. I am not sure I want to support those more broadly. They
weren't designed for "external consumption".
- qemu-ga-client should be moved over into utils, or possibly even deleted
-- it hasn't seen a lot of love and I doubt there are any users. I don't
have the bandwidth to refurbish it for no users. Maybe if there's a demand
in the future ...
... This might be being overcautious, though. Perhaps I can upload a
version of "qemu.aqmp" even this week just as a demonstration of how it
would work.
Happy to take suggestions/feedback on this process.
--js
[-- Attachment #2: Type: text/html, Size: 3865 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 17:56 ` John Snow
@ 2021-11-17 18:20 ` Vladimir Sementsov-Ogievskiy
2021-11-17 19:07 ` John Snow
2021-11-18 6:45 ` Gerd Hoffmann
1 sibling, 1 reply; 17+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-11-17 18:20 UTC (permalink / raw)
To: John Snow, Gerd Hoffmann
Cc: qemu-devel, Kevin Wolf, Peter Maydell, Thomas Huth,
Daniel Berrange, Eduardo Habkost, qemu-block, Alex Bennée,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Markus Armbruster, Willian Rampazzo, Hanna Reitz, Cleber Rosa
17.11.2021 20:56, John Snow wrote:
>
> On Wed, Nov 17, 2021 at 4:42 AM Gerd Hoffmann <kraxel@redhat.com <mailto:kraxel@redhat.com>> wrote:
>
> Hi,
>
> > https://gitlab.com/jsnow/qemu.git <https://gitlab.com/jsnow/qemu.git> tags/python-pull-request
>
> What is the status of the plan to upload this to pypi eventually?
>
>
> Thanks for asking!
>
> The honest answer is "I'm not exactly sure", but there are a few things to work out still. Let me use this as an opportunity to try and give you an honest answer.
> We've got four packages right now: qmp, aqmp, machine and utils.
>
> - I don't intend to *ever* upload utils, I created that one specifically as an in-tree package for "low quality" code that we just need as glue.
> - aqmp is brand new. It was moved as the default provider for the QMP protocol in the tree (being used by machine.py) only two weeks ago. I am using this current RC testing phase to find any problems with it.
> - qmp is something I want to deprecate, I don't intend to upload it to PyPI. I intend to rename aqmp -> qmp and have just the one qmp package. I can't do this until next release, and only after we are confident and happy that aqmp is stable enough.
> - machine has a few problems with it. I am reluctant to upload it in its current form. I am actively developing a new version of it that uses the new Async QMP module. However, this might take a bit of time, I fear.
>
> So, I think I have this timeline for myself:
>
> - Fix bugs in AQMP package revealed during RC testing
> - Introduce sync wrapper for AQMP that resembles the native AQMP interface more than it resembles the "legacy QMP" interface.
> - Remove all QEMU source tree uses of qemu.qmp and qemu.aqmp.legacy.
> - Delete qemu.qmp and rename qemu.aqmp to qemu.qmp.
> - Split python/qemu/qmp out into its own repository and begin uploading it to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
> - Transition any users of the Python packages in the QEMU source tree to installing the QMP dependency from PyPI instead of grabbing it from the tree.
> - Delete python/qemu/qmp from the QEMU source tree at this moment; "re-fork" the package if necessary to collect any commits since the "test split" procedure.
>
That all sounds great!
>
> Some questions to work out:
> - What tools should be uploaded with qemu.qmp? a version of qmp-shell is high on the list for me. qom, qom-set, qom-get, qom-list, qom-tree, qom-fuse etc I am suspecting might be better left behind in qemu.utils instead, though. I am not sure I want to support those more broadly. They weren't designed for "external consumption".
> - qemu-ga-client should be moved over into utils, or possibly even deleted -- it hasn't seen a lot of love and I doubt there are any users. I don't have the bandwidth to refurbish it for no users. Maybe if there's a demand in the future ...
>
>
> ... This might be being overcautious, though. Perhaps I can upload a version of "qemu.aqmp" even this week just as a demonstration of how it would work.
>
Why do we need wait for next release for renaming aqmp -> qmp? Or what next release do you mean? I think you can rename it as soon as 6.3 development phase is open.
I'm not sure that's a good idea to upload qemu.aqmp to public and than rename it to qemu.qmp.. Maybe, you can upload it now as qemu.qmp? So, first, create a separate repo with aqmp (already renamed to qmp), upload it to PyPI (as qmp) - this all as a first step. And then gradually move Qemu to use this new repo instead its own qmp/aqmp.
--
Best regards,
Vladimir
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 18:20 ` Vladimir Sementsov-Ogievskiy
@ 2021-11-17 19:07 ` John Snow
2021-11-17 19:12 ` Vladimir Sementsov-Ogievskiy
0 siblings, 1 reply; 17+ messages in thread
From: John Snow @ 2021-11-17 19:07 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy
Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel Berrange,
Eduardo Habkost, Qemu-block, Markus Armbruster, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Willian Rampazzo, Hanna Reitz, Gerd Hoffmann, Cleber Rosa,
Alex Bennée
[-- Attachment #1: Type: text/plain, Size: 5191 bytes --]
On Wed, Nov 17, 2021 at 1:20 PM Vladimir Sementsov-Ogievskiy <
vsementsov@virtuozzo.com> wrote:
> 17.11.2021 20:56, John Snow wrote:
> >
> > On Wed, Nov 17, 2021 at 4:42 AM Gerd Hoffmann <kraxel@redhat.com
> <mailto:kraxel@redhat.com>> wrote:
> >
> > Hi,
> >
> > > https://gitlab.com/jsnow/qemu.git <
> https://gitlab.com/jsnow/qemu.git> tags/python-pull-request
> >
> > What is the status of the plan to upload this to pypi eventually?
> >
> >
> > Thanks for asking!
> >
> > The honest answer is "I'm not exactly sure", but there are a few things
> to work out still. Let me use this as an opportunity to try and give you an
> honest answer.
> > We've got four packages right now: qmp, aqmp, machine and utils.
> >
> > - I don't intend to *ever* upload utils, I created that one specifically
> as an in-tree package for "low quality" code that we just need as glue.
> > - aqmp is brand new. It was moved as the default provider for the QMP
> protocol in the tree (being used by machine.py) only two weeks ago. I am
> using this current RC testing phase to find any problems with it.
> > - qmp is something I want to deprecate, I don't intend to upload it to
> PyPI. I intend to rename aqmp -> qmp and have just the one qmp package. I
> can't do this until next release, and only after we are confident and happy
> that aqmp is stable enough.
> > - machine has a few problems with it. I am reluctant to upload it in its
> current form. I am actively developing a new version of it that uses the
> new Async QMP module. However, this might take a bit of time, I fear.
> >
> > So, I think I have this timeline for myself:
> >
> > - Fix bugs in AQMP package revealed during RC testing
> > - Introduce sync wrapper for AQMP that resembles the native AQMP
> interface more than it resembles the "legacy QMP" interface.
> > - Remove all QEMU source tree uses of qemu.qmp and qemu.aqmp.legacy.
> > - Delete qemu.qmp and rename qemu.aqmp to qemu.qmp.
> > - Split python/qemu/qmp out into its own repository and begin uploading
> it to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
> > - Transition any users of the Python packages in the QEMU source tree to
> installing the QMP dependency from PyPI instead of grabbing it from the
> tree.
> > - Delete python/qemu/qmp from the QEMU source tree at this moment;
> "re-fork" the package if necessary to collect any commits since the "test
> split" procedure.
> >
>
> That all sounds great!
>
> >
> > Some questions to work out:
> > - What tools should be uploaded with qemu.qmp? a version of qmp-shell is
> high on the list for me. qom, qom-set, qom-get, qom-list, qom-tree,
> qom-fuse etc I am suspecting might be better left behind in qemu.utils
> instead, though. I am not sure I want to support those more broadly. They
> weren't designed for "external consumption".
> > - qemu-ga-client should be moved over into utils, or possibly even
> deleted -- it hasn't seen a lot of love and I doubt there are any users. I
> don't have the bandwidth to refurbish it for no users. Maybe if there's a
> demand in the future ...
> >
> >
> > ... This might be being overcautious, though. Perhaps I can upload a
> version of "qemu.aqmp" even this week just as a demonstration of how it
> would work.
> >
>
> Why do we need wait for next release for renaming aqmp -> qmp? Or what
> next release do you mean? I think you can rename it as soon as 6.3
> development phase is open.
>
>
I might be confused in my thinking because there's a ton of little tasks to
do, and I won't pretend I have thought extremely carefully about the
precise order in which they *have* to be done, only the order in which that
it occurs to me to do them. :)
I suppose I could do something like rename "qmp" to "legacy_qmp" in the
tree as an intermediate step and accomplish the "aqmp -> qmp" rename
sooner, but there's a lot of churn inherent to that. Since there's a lot of
churn inherent to moving users off of the old interface anyway, I figured
I'd just tackle it all at once... which I can't do until the tree re-opens
again.
I can certainly work on it in the meantime, though.
I'm not sure that's a good idea to upload qemu.aqmp to public and than
> rename it to qemu.qmp.. Maybe, you can upload it now as qemu.qmp? So,
> first, create a separate repo with aqmp (already renamed to qmp), upload it
> to PyPI (as qmp) - this all as a first step. And then gradually move Qemu
> to use this new repo instead its own qmp/aqmp.
>
I'm afraid of doing this because I don't want to pollute the 'qemu.qmp'
space with two packages that contain radically different things in it. It
feels safer to fully switch over the QEMU source tree first, and THEN
upload to PyPI. If I go out of order there, I worry that we will run into
circumstances where various scripts/tools will use "the wrong qemu.qmp",
and it will be frustrating for people without a lot of Python packaging
experience to diagnose on their own.
The safest thing is just to wait for me to do all the cleanup churn I laid
out above, but if I were to demo a "preview", doing it under the
'qemu.aqmp' name seems like the safest bet because I don't plan to use that
name long-term.
--js
[-- Attachment #2: Type: text/html, Size: 6516 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 19:07 ` John Snow
@ 2021-11-17 19:12 ` Vladimir Sementsov-Ogievskiy
0 siblings, 0 replies; 17+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-11-17 19:12 UTC (permalink / raw)
To: John Snow
Cc: Gerd Hoffmann, qemu-devel, Kevin Wolf, Peter Maydell, Thomas Huth,
Daniel Berrange, Eduardo Habkost, Qemu-block, Alex Bennée,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Markus Armbruster, Willian Rampazzo, Hanna Reitz, Cleber Rosa
17.11.2021 22:07, John Snow wrote:
>
>
> On Wed, Nov 17, 2021 at 1:20 PM Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com <mailto:vsementsov@virtuozzo.com>> wrote:
>
> 17.11.2021 20:56, John Snow wrote:
> >
> > On Wed, Nov 17, 2021 at 4:42 AM Gerd Hoffmann <kraxel@redhat.com <mailto:kraxel@redhat.com> <mailto:kraxel@redhat.com <mailto:kraxel@redhat.com>>> wrote:
> >
> > Hi,
> >
> > > https://gitlab.com/jsnow/qemu.git <https://gitlab.com/jsnow/qemu.git> <https://gitlab.com/jsnow/qemu.git <https://gitlab.com/jsnow/qemu.git>> tags/python-pull-request
> >
> > What is the status of the plan to upload this to pypi eventually?
> >
> >
> > Thanks for asking!
> >
> > The honest answer is "I'm not exactly sure", but there are a few things to work out still. Let me use this as an opportunity to try and give you an honest answer.
> > We've got four packages right now: qmp, aqmp, machine and utils.
> >
> > - I don't intend to *ever* upload utils, I created that one specifically as an in-tree package for "low quality" code that we just need as glue.
> > - aqmp is brand new. It was moved as the default provider for the QMP protocol in the tree (being used by machine.py) only two weeks ago. I am using this current RC testing phase to find any problems with it.
> > - qmp is something I want to deprecate, I don't intend to upload it to PyPI. I intend to rename aqmp -> qmp and have just the one qmp package. I can't do this until next release, and only after we are confident and happy that aqmp is stable enough.
> > - machine has a few problems with it. I am reluctant to upload it in its current form. I am actively developing a new version of it that uses the new Async QMP module. However, this might take a bit of time, I fear.
> >
> > So, I think I have this timeline for myself:
> >
> > - Fix bugs in AQMP package revealed during RC testing
> > - Introduce sync wrapper for AQMP that resembles the native AQMP interface more than it resembles the "legacy QMP" interface.
> > - Remove all QEMU source tree uses of qemu.qmp and qemu.aqmp.legacy.
> > - Delete qemu.qmp and rename qemu.aqmp to qemu.qmp.
> > - Split python/qemu/qmp out into its own repository and begin uploading it to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
> > - Transition any users of the Python packages in the QEMU source tree to installing the QMP dependency from PyPI instead of grabbing it from the tree.
> > - Delete python/qemu/qmp from the QEMU source tree at this moment; "re-fork" the package if necessary to collect any commits since the "test split" procedure.
> >
>
> That all sounds great!
>
> >
> > Some questions to work out:
> > - What tools should be uploaded with qemu.qmp? a version of qmp-shell is high on the list for me. qom, qom-set, qom-get, qom-list, qom-tree, qom-fuse etc I am suspecting might be better left behind in qemu.utils instead, though. I am not sure I want to support those more broadly. They weren't designed for "external consumption".
> > - qemu-ga-client should be moved over into utils, or possibly even deleted -- it hasn't seen a lot of love and I doubt there are any users. I don't have the bandwidth to refurbish it for no users. Maybe if there's a demand in the future ...
> >
> >
> > ... This might be being overcautious, though. Perhaps I can upload a version of "qemu.aqmp" even this week just as a demonstration of how it would work.
> >
>
> Why do we need wait for next release for renaming aqmp -> qmp? Or what next release do you mean? I think you can rename it as soon as 6.3 development phase is open.
>
>
> I might be confused in my thinking because there's a ton of little tasks to do, and I won't pretend I have thought extremely carefully about the precise order in which they *have* to be done, only the order in which that it occurs to me to do them. :)
>
> I suppose I could do something like rename "qmp" to "legacy_qmp" in the tree as an intermediate step and accomplish the "aqmp -> qmp" rename sooner, but there's a lot of churn inherent to that. Since there's a lot of churn inherent to moving users off of the old interface anyway, I figured I'd just tackle it all at once... which I can't do until the tree re-opens again.
>
> I can certainly work on it in the meantime, though.
>
> I'm not sure that's a good idea to upload qemu.aqmp to public and than rename it to qemu.qmp.. Maybe, you can upload it now as qemu.qmp? So, first, create a separate repo with aqmp (already renamed to qmp), upload it to PyPI (as qmp) - this all as a first step. And then gradually move Qemu to use this new repo instead its own qmp/aqmp.
>
>
> I'm afraid of doing this because I don't want to pollute the 'qemu.qmp' space with two packages that contain radically different things in it. It feels safer to fully switch over the QEMU source tree first, and THEN upload to PyPI. If I go out of order there, I worry that we will run into circumstances where various scripts/tools will use "the wrong qemu.qmp", and it will be frustrating for people without a lot of Python packaging experience to diagnose on their own.
Agree
>
> The safest thing is just to wait for me to do all the cleanup churn I laid out above, but if I were to demo a "preview", doing it under the 'qemu.aqmp' name seems like the safest bet because I don't plan to use that name long-term.
>
OK, that's right. I just imagined a "fast path", but it's not safe, you are right.
--
Best regards,
Vladimir
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-17 17:56 ` John Snow
2021-11-17 18:20 ` Vladimir Sementsov-Ogievskiy
@ 2021-11-18 6:45 ` Gerd Hoffmann
2021-11-18 15:50 ` John Snow
1 sibling, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2021-11-18 6:45 UTC (permalink / raw)
To: John Snow
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
qemu-block, Markus Armbruster, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Willian Rampazzo, Hanna Reitz, Cleber Rosa, Alex Bennée
Hi,
> - Split python/qemu/qmp out into its own repository and begin uploading it
> to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
I think you can do that as two separate steps.
pip can install from vcs too, i.e. when splitted to a separate repo but
not yet uploaded to pypi you can simply drop something like ...
git+https://gitlab.com/qemu/qemu-python.git@master
... into pip-requirements.txt. That way you can easily test things
before actually uploading to pypi.
take care,
Gerd
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2021-11-18 6:45 ` Gerd Hoffmann
@ 2021-11-18 15:50 ` John Snow
0 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2021-11-18 15:50 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: Kevin Wolf, Peter Maydell, Thomas Huth,
Vladimir Sementsov-Ogievskiy, Daniel Berrange, Eduardo Habkost,
Qemu-block, Markus Armbruster, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Willian Rampazzo, Hanna Reitz, Cleber Rosa, Alex Bennée
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
On Thu, Nov 18, 2021 at 1:46 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> > - Split python/qemu/qmp out into its own repository and begin uploading
> it
> > to PyPI, as a test. (Do not delete python/qemu/qmp yet at this phase.)
>
> I think you can do that as two separate steps.
>
> pip can install from vcs too, i.e. when splitted to a separate repo but
> not yet uploaded to pypi you can simply drop something like ...
>
> git+https://gitlab.com/qemu/qemu-python.git@master
>
> ... into pip-requirements.txt. That way you can easily test things
> before actually uploading to pypi.
>
>
Indeed - a limitation here however is that pip will not install from this
source unless explicitly asked to, so you couldn't use this package as a
requirement for another one, for example -- but it works as a testing step.
but that's the rough outline of where I am headed and what I think needs to
be done to get there. It's just taking me a while to get everything put in
order exactly the right way to be able to flip the switch. Hopefully soon,
though.
I realized when re-reading my mails last night that I said I wouldn't be
able to do it until "next release" but what I really meant was "until the
next development window".
--js
[-- Attachment #2: Type: text/html, Size: 1811 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PULL 0/5] Python patches
@ 2023-01-04 21:04 John Snow
2023-01-04 21:04 ` [PULL 1/5] python/machine: Add debug logging to key state changes John Snow
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block
The following changes since commit ecc9a58835f8d4ea4e3ed36832032a71ee08fbb2:
Merge tag 'pull-9p-20221223' of https://github.com/cschoenebeck/qemu into staging (2023-01-04 14:53:59 +0000)
are available in the Git repository at:
https://gitlab.com/jsnow/qemu.git tags/python-pull-request
for you to fetch changes up to 519f3cfce07a067971ff39d4a989b77e7100a947:
python: add 3.11 to supported list (2023-01-04 13:46:05 -0500)
----------------------------------------------------------------
Python patch roundup
Mostly CI fixes and some small debugging improvements.
----------------------------------------------------------------
John Snow (5):
python/machine: Add debug logging to key state changes
python/machine: Handle termination cases without QMP
Python: fix flake8 config
iotests/check: Fix typing for sys.exit() value
python: add 3.11 to supported list
python/qemu/machine/machine.py | 31 +++++++++++++++++++++++++++++++
python/setup.cfg | 6 ++++--
tests/qemu-iotests/check | 2 +-
3 files changed, 36 insertions(+), 3 deletions(-)
--
2.39.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PULL 1/5] python/machine: Add debug logging to key state changes
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
@ 2023-01-04 21:04 ` John Snow
2023-01-04 21:04 ` [PULL 2/5] python/machine: Handle termination cases without QMP John Snow
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block
When key decisions are made about the lifetime of the VM process being
managed, there's no log entry. Juxtaposed with the very verbose runstate
change logging of the QMP module, machine seems a bit too introverted
now.
Season the machine.py module with logging statements to taste to help
make a tastier soup.
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/machine/machine.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 37191f433b2..6f1374a7550 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -373,6 +373,7 @@ def _post_shutdown(self) -> None:
Called to cleanup the VM instance after the process has exited.
May also be called after a failed launch.
"""
+ LOG.debug("Cleaning up after VM process")
try:
self._close_qmp_connection()
except Exception as err: # pylint: disable=broad-except
@@ -497,6 +498,7 @@ def _early_cleanup(self) -> None:
# for QEMU to exit, while QEMU is waiting for the socket to
# become writable.
if self._console_socket is not None:
+ LOG.debug("Closing console socket")
self._console_socket.close()
self._console_socket = None
@@ -507,6 +509,7 @@ def _hard_shutdown(self) -> None:
:raise subprocess.Timeout: When timeout is exceeds 60 seconds
waiting for the QEMU process to terminate.
"""
+ LOG.debug("Performing hard shutdown")
self._early_cleanup()
self._subp.kill()
self._subp.wait(timeout=60)
@@ -523,8 +526,18 @@ def _soft_shutdown(self, timeout: Optional[int]) -> None:
:raise subprocess.TimeoutExpired: When timeout is exceeded waiting for
the QEMU process to terminate.
"""
+ LOG.debug("Attempting graceful termination")
+
self._early_cleanup()
+ if self._quit_issued:
+ LOG.debug(
+ "Anticipating QEMU termination due to prior 'quit' command, "
+ "or explicit call to wait()"
+ )
+ else:
+ LOG.debug("Politely asking QEMU to terminate")
+
if self._qmp_connection:
try:
if not self._quit_issued:
@@ -536,6 +549,10 @@ def _soft_shutdown(self, timeout: Optional[int]) -> None:
self._close_qmp_connection()
# May raise subprocess.TimeoutExpired
+ LOG.debug(
+ "Waiting (timeout=%s) for QEMU process (pid=%s) to terminate",
+ timeout, self._subp.pid
+ )
self._subp.wait(timeout=timeout)
def _do_shutdown(self, timeout: Optional[int]) -> None:
@@ -553,6 +570,10 @@ def _do_shutdown(self, timeout: Optional[int]) -> None:
try:
self._soft_shutdown(timeout)
except Exception as exc:
+ if isinstance(exc, subprocess.TimeoutExpired):
+ LOG.debug("Timed out waiting for QEMU process to exit")
+ LOG.debug("Graceful shutdown failed", exc_info=True)
+ LOG.debug("Falling back to hard shutdown")
self._hard_shutdown()
raise AbnormalShutdown("Could not perform graceful shutdown") \
from exc
@@ -575,6 +596,10 @@ def shutdown(self,
if not self._launched:
return
+ LOG.debug("Shutting down VM appliance; timeout=%s", timeout)
+ if hard:
+ LOG.debug("Caller requests immediate termination of QEMU process.")
+
try:
if hard:
self._user_killed = True
--
2.39.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PULL 2/5] python/machine: Handle termination cases without QMP
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
2023-01-04 21:04 ` [PULL 1/5] python/machine: Add debug logging to key state changes John Snow
@ 2023-01-04 21:04 ` John Snow
2023-01-04 21:04 ` [PULL 3/5] Python: fix flake8 config John Snow
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block
If we request a shutdown of a VM without a QMP console, we'll just hang
waiting. Not ideal.
Add in code that attempts graceful termination in these cases. Tested
lightly; it appears to work and I doubt we rely on this case anywhere,
but it's a corner you're allowed to wedge yourself in, so it should be
handled.
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/machine/machine.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 6f1374a7550..748a0d807c9 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -547,6 +547,12 @@ def _soft_shutdown(self, timeout: Optional[int]) -> None:
finally:
# Regardless, we want to quiesce the connection.
self._close_qmp_connection()
+ elif not self._quit_issued:
+ LOG.debug(
+ "Not anticipating QEMU quit and no QMP connection present, "
+ "issuing SIGTERM"
+ )
+ self._subp.terminate()
# May raise subprocess.TimeoutExpired
LOG.debug(
--
2.39.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PULL 3/5] Python: fix flake8 config
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
2023-01-04 21:04 ` [PULL 1/5] python/machine: Add debug logging to key state changes John Snow
2023-01-04 21:04 ` [PULL 2/5] python/machine: Handle termination cases without QMP John Snow
@ 2023-01-04 21:04 ` John Snow
2023-01-04 21:04 ` [PULL 4/5] iotests/check: Fix typing for sys.exit() value John Snow
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block, Wilfred Mallawa
Newer flake8 versions are a bit pickier about the config file, and my
in-line comment confuses the parser. Fix it.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Message-id: 20221203005234.620788-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/setup.cfg | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/setup.cfg b/python/setup.cfg
index c2c61c75190..c0d7bab168e 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -71,7 +71,8 @@ console_scripts =
qmp-tui = qemu.qmp.qmp_tui:main [tui]
[flake8]
-extend-ignore = E722 # Prefer pylint's bare-except checks to flake8's
+# Prefer pylint's bare-except checks to flake8's
+extend-ignore = E722
exclude = __pycache__,
[mypy]
--
2.39.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PULL 4/5] iotests/check: Fix typing for sys.exit() value
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
` (2 preceding siblings ...)
2023-01-04 21:04 ` [PULL 3/5] Python: fix flake8 config John Snow
@ 2023-01-04 21:04 ` John Snow
2023-01-04 21:04 ` [PULL 5/5] python: add 3.11 to supported list John Snow
2023-01-05 18:42 ` [PULL 0/5] Python patches Peter Maydell
5 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block, Wilfred Mallawa
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Message-id: 20221203005234.620788-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/check | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 75de1b4691e..9bdda1394e7 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -159,7 +159,7 @@ if __name__ == '__main__':
if not tests:
raise ValueError('No tests selected')
except ValueError as e:
- sys.exit(e)
+ sys.exit(str(e))
if args.dry_run:
print('\n'.join(tests))
--
2.39.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PULL 5/5] python: add 3.11 to supported list
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
` (3 preceding siblings ...)
2023-01-04 21:04 ` [PULL 4/5] iotests/check: Fix typing for sys.exit() value John Snow
@ 2023-01-04 21:04 ` John Snow
2023-01-05 18:42 ` [PULL 0/5] Python patches Peter Maydell
5 siblings, 0 replies; 17+ messages in thread
From: John Snow @ 2023-01-04 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Beraldo Leal, Hanna Reitz, Eduardo Habkost,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, John Snow,
Peter Maydell, Kevin Wolf, qemu-block, Wilfred Mallawa
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Message-id: 20221203005234.620788-4-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/setup.cfg | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/setup.cfg b/python/setup.cfg
index c0d7bab168e..56418157065 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -19,6 +19,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
+ Programming Language :: Python :: 3.11
Typing :: Typed
[options]
@@ -159,7 +160,7 @@ multi_line_output=3
# of python available on your system to run this test.
[tox:tox]
-envlist = py36, py37, py38, py39, py310
+envlist = py36, py37, py38, py39, py310, py311
skip_missing_interpreters = true
[testenv]
--
2.39.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
` (4 preceding siblings ...)
2023-01-04 21:04 ` [PULL 5/5] python: add 3.11 to supported list John Snow
@ 2023-01-05 18:42 ` Peter Maydell
5 siblings, 0 replies; 17+ messages in thread
From: Peter Maydell @ 2023-01-05 18:42 UTC (permalink / raw)
To: John Snow
Cc: qemu-devel, Cleber Rosa, Beraldo Leal, Hanna Reitz,
Eduardo Habkost, Markus Armbruster, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, qemu-block
On Wed, 4 Jan 2023 at 21:05, John Snow <jsnow@redhat.com> wrote:
>
> The following changes since commit ecc9a58835f8d4ea4e3ed36832032a71ee08fbb2:
>
> Merge tag 'pull-9p-20221223' of https://github.com/cschoenebeck/qemu into staging (2023-01-04 14:53:59 +0000)
>
> are available in the Git repository at:
>
> https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> for you to fetch changes up to 519f3cfce07a067971ff39d4a989b77e7100a947:
>
> python: add 3.11 to supported list (2023-01-04 13:46:05 -0500)
>
> ----------------------------------------------------------------
> Python patch roundup
>
> Mostly CI fixes and some small debugging improvements.
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PULL 0/5] Python patches
[not found] <20230531204338.1656158-1-jsnow@redhat.com>
@ 2023-05-31 23:20 ` Richard Henderson
0 siblings, 0 replies; 17+ messages in thread
From: Richard Henderson @ 2023-05-31 23:20 UTC (permalink / raw)
To: John Snow, qemu-devel
Cc: Vladimir Sementsov-Ogievskiy, Eduardo Habkost,
Philippe Mathieu-Daudé, Beraldo Leal, Hanna Reitz,
Markus Armbruster, Peter Maydell, qemu-block, Kevin Wolf,
Thomas Huth, Alex Bennée, Cleber Rosa,
Wainer dos Santos Moschetta
On 5/31/23 13:43, John Snow wrote:
> The following changes since commit ab7252279727da51c01cdaf41c5fe563bbded3a6:
>
> gitlab: switch from 'stable' to 'latest' docker container tags (2023-05-31 10:29:14 -0700)
>
> are available in the Git repository at:
>
> https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> for you to fetch changes up to c76e7652c786683edcc846ee0a7a65b587787792:
>
> Revert "python/qmp/protocol: add open_with_socket()" (2023-05-31 16:25:35 -0400)
>
> ----------------------------------------------------------------
> Python: synchronize python-qemu-qmp
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.
r~
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2023-05-31 23:22 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 21:04 [PULL 0/5] Python patches John Snow
2023-01-04 21:04 ` [PULL 1/5] python/machine: Add debug logging to key state changes John Snow
2023-01-04 21:04 ` [PULL 2/5] python/machine: Handle termination cases without QMP John Snow
2023-01-04 21:04 ` [PULL 3/5] Python: fix flake8 config John Snow
2023-01-04 21:04 ` [PULL 4/5] iotests/check: Fix typing for sys.exit() value John Snow
2023-01-04 21:04 ` [PULL 5/5] python: add 3.11 to supported list John Snow
2023-01-05 18:42 ` [PULL 0/5] Python patches Peter Maydell
[not found] <20230531204338.1656158-1-jsnow@redhat.com>
2023-05-31 23:20 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2021-11-17 0:33 John Snow
2021-11-17 8:47 ` Richard Henderson
2021-11-17 9:41 ` Gerd Hoffmann
2021-11-17 17:56 ` John Snow
2021-11-17 18:20 ` Vladimir Sementsov-Ogievskiy
2021-11-17 19:07 ` John Snow
2021-11-17 19:12 ` Vladimir Sementsov-Ogievskiy
2021-11-18 6:45 ` Gerd Hoffmann
2021-11-18 15:50 ` John Snow
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).