Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virttest.env_process: Keep vm.instance throughout the workflow #2020

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ldoktor
Copy link
Contributor

@ldoktor ldoktor commented Mar 27, 2019

We use the vm.instance as a key to our screendump status dict, but the
instance number might change during our evaluation. Let's get the
instance at the beginning of our workflow and keep it everywhere to
avoid assigning to non-existing keys.

Signed-off-by: Lukáš Doktor [email protected]

We use the vm.instance as a key to our screendump status dict, but the
instance number might change during our evaluation. Let's get the
instance at the beginning of our workflow and keep it everywhere to
avoid assigning to non-existing keys.

Signed-off-by: Lukáš Doktor <[email protected]>
@luckyh
Copy link
Contributor

luckyh commented Mar 28, 2019

@lolyu would you please help check if this patch has something overlapped with your one (#2016), thanks!

counter[vm.instance] += 1
filename = "%04d.jpg" % counter[vm.instance]
counter[instance] += 1
filename = "%04d.jpg" % counter[instance]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if vm.instance changes, counter[instance] will starts from 1, so all previous image files will be overwritten. I believe it is better to relate vm.instance with screendump_dir.

@ldoktor
Copy link
Contributor Author

ldoktor commented Mar 28, 2019

I'm sorry, I don't really have time to properly look at that other PR. The purpose of this PR is not to change the way screendump works, it only fixes a bug where processing of a single screendump might result in crash/traceback. It happens when we check whether vm.instance exists in counter, but the VM instance changes (migration) before we increment the counter.

It is not critical, I'm seeing this issue for many years, but never had time to send a patch. Anyway this patch does not affect anything apart of the single case where VM re-creates during processing of the single screendump (we get the new vm.instance after creating a new screendump).

Btw at first glance I think the other PR suffers the same here: b62f707#diff-4ad1e2a008c3f4477e993d5e26652b0fR567

@lolyu
Copy link
Contributor

lolyu commented Apr 1, 2019

Yes, patch #2016 suffers from the same issue, but is the overwritten of previous screendump files after migration(vm.instance changes) expected?

@ldoktor
Copy link
Contributor Author

ldoktor commented Apr 5, 2019

Yes, I've been seeing it in my logs from time to time for years, just never cared enough to send it. Finally now I did. Would you please incorporate it in your screendump rework? Or should I send it after that one is merged?

@lolyu
Copy link
Contributor

lolyu commented Apr 8, 2019

You could keep this patch, after its merge, I will re-evaluate this and modify my rework then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants