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

Correctly display 'updates-pending' icon for VMs #475

Closed
marmarek opened this Issue Mar 8, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@marmarek
Member

marmarek commented Mar 8, 2015

Reported by joanna on 8 Mar 2012 19:32 UTC
None

Migrated-From: https://wiki.qubes-os.org/ticket/475

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by joanna on 25 Apr 2012 11:44 UTC
Actually, we don't need to display the "up to date icon" -- just the lack of "check for updates" is enough. So, just remove this green flag icons.

Member

marmarek commented Mar 8, 2015

Comment by joanna on 25 Apr 2012 11:44 UTC
Actually, we don't need to display the "up to date icon" -- just the lack of "check for updates" is enough. So, just remove this green flag icons.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by joanna on 30 Apr 2012 12:27 UTC

Member

marmarek commented Mar 8, 2015

Modified by joanna on 30 Apr 2012 12:27 UTC

@marmarek marmarek changed the title from Do not display "VM up to date" unless updates really got installed in the VM to Remove the Green Flag! Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by marmarek on 1 May 2012 22:37 UTC
Somehow reworked update-notification mechanism (as discussed in emails). Dom0 expose NotifyUpdates service, which can be called by VM with number of available updates (passed via stdout).
If VM calling this service is some updateable VM (template or standalone) - just trust the value.
If calling VM is some template-based VM - process only notification of count>0 updates (so AppVM cannot clear "updates-pending" flag).
Also check if VM is started later than last received notify - if template was updated in the meantime, it probably cleared "updates-pending" flag (setting updates count to 0), so do not override it from outdated VM.

"updates-pending" flag (as Joanna called it) is stored in VM_DIR/updates.stat file. Preferable way of obtaining its location:

from qubes.qubes import updates_stat_file
(...)
vm.dir_path + '/' + updates_stat_file

If file exists, it contains number of updates available (at time of last modification of this file).

From qubes-manager point of view, stat file with "0" should be treated the same as no stat file at all: don't show "updates available" flag.

dom0 part:
http://git.qubes-os.org/gitweb/?p=marmarek/core.git;a=commit;h=370ad33c4416cd6aac17fa1cf76a69d5021135f9

VM (call NotifyUpdates service periodically):
http://git.qubes-os.org/gitweb/?p=marmarek/core.git;a=commit;h=950d848edec5b95a6d0d8b918aed206c6253050e

Side notes:

  1. VM part implemented only for systemd package (so FC14 not supported here).
  2. To manually check update status and send it to dom0, just call (in VM): systemctl start qubes-update-check.service
Member

marmarek commented Mar 8, 2015

Comment by marmarek on 1 May 2012 22:37 UTC
Somehow reworked update-notification mechanism (as discussed in emails). Dom0 expose NotifyUpdates service, which can be called by VM with number of available updates (passed via stdout).
If VM calling this service is some updateable VM (template or standalone) - just trust the value.
If calling VM is some template-based VM - process only notification of count>0 updates (so AppVM cannot clear "updates-pending" flag).
Also check if VM is started later than last received notify - if template was updated in the meantime, it probably cleared "updates-pending" flag (setting updates count to 0), so do not override it from outdated VM.

"updates-pending" flag (as Joanna called it) is stored in VM_DIR/updates.stat file. Preferable way of obtaining its location:

from qubes.qubes import updates_stat_file
(...)
vm.dir_path + '/' + updates_stat_file

If file exists, it contains number of updates available (at time of last modification of this file).

From qubes-manager point of view, stat file with "0" should be treated the same as no stat file at all: don't show "updates available" flag.

dom0 part:
http://git.qubes-os.org/gitweb/?p=marmarek/core.git;a=commit;h=370ad33c4416cd6aac17fa1cf76a69d5021135f9

VM (call NotifyUpdates service periodically):
http://git.qubes-os.org/gitweb/?p=marmarek/core.git;a=commit;h=950d848edec5b95a6d0d8b918aed206c6253050e

Side notes:

  1. VM part implemented only for systemd package (so FC14 not supported here).
  2. To manually check update status and send it to dom0, just call (in VM): systemctl start qubes-update-check.service
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by joanna on 2 May 2012 10:32 UTC

Member

marmarek commented Mar 8, 2015

Modified by joanna on 2 May 2012 10:32 UTC

@marmarek marmarek changed the title from Remove the Green Flag! to Correctly display 'updates-pending' icon for VMs Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by aga on 8 May 2012 17:12 UTC
http://git.qubes-os.org/gitweb/?p=aga/qubes-manager.git;a=commit;h=35733452ce14eb164f853a1156b1c26be1b14e12

Works for Fc >= 15. So the updates pending icon for FC14 templates is NEVER displayed.

Member

marmarek commented Mar 8, 2015

Comment by aga on 8 May 2012 17:12 UTC
http://git.qubes-os.org/gitweb/?p=aga/qubes-manager.git;a=commit;h=35733452ce14eb164f853a1156b1c26be1b14e12

Works for Fc >= 15. So the updates pending icon for FC14 templates is NEVER displayed.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by aga on 10 May 2012 11:52 UTC
Shall we close it?

Member

marmarek commented Mar 8, 2015

Comment by aga on 10 May 2012 11:52 UTC
Shall we close it?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by joanna on 16 May 2012 13:07 UTC
I just got an updates pending icon displayed for my template VM, yet there were no updates avilable (yum updates returned nothing).

Member

marmarek commented Mar 8, 2015

Comment by joanna on 16 May 2012 13:07 UTC
I just got an updates pending icon displayed for my template VM, yet there were no updates avilable (yum updates returned nothing).

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by aga on 25 May 2012 14:41 UTC
Does it finally work after fixing the permission issues?

Member

marmarek commented Mar 8, 2015

Comment by aga on 25 May 2012 14:41 UTC
Does it finally work after fixing the permission issues?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by joanna on 26 May 2012 11:37 UTC
Yup, it seems to work fine now.

Member

marmarek commented Mar 8, 2015

Comment by joanna on 26 May 2012 11:37 UTC
Yup, it seems to work fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment