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

Do not crash on pool with no volumes #9504

Open
ethnh opened this issue Oct 12, 2024 · 0 comments · May be fixed by QubesOS/qubes-core-admin-client#311
Open

Do not crash on pool with no volumes #9504

ethnh opened this issue Oct 12, 2024 · 0 comments · May be fixed by QubesOS/qubes-core-admin-client#311
Labels
C: storage P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.

Comments

@ethnh
Copy link

ethnh commented Oct 12, 2024

The problem you're addressing (if any)

Do not crash on pool with no volumes

The solution you'd like

From 2448b386505af8540f21b0f81275f45776070f8c Mon Sep 17 00:00:00 2001
From: Yaroslav Bolyukin <[email protected]>
Date: Sat, 14 Sep 2024 00:09:19 +0200
Subject: [PATCH 3/3] fix: do not crash on pool with no volumes

---
 qubesadmin/storage.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qubesadmin/storage.py b/qubesadmin/storage.py
index 27f5696..99e8d81 100644
--- a/qubesadmin/storage.py
+++ b/qubesadmin/storage.py
@@ -430,6 +430,8 @@ class Pool(object):
                 'dom0', 'admin.pool.volume.List', self.name, None)
         except qubesadmin.exc.QubesDaemonAccessError:
             raise qubesadmin.exc.QubesPropertyAccessError('volumes')
+        if volumes_data == b'':
+            return
         assert volumes_data.endswith(b'\n')
         volumes_data = volumes_data[:-1].decode('ascii')
         for vid in volumes_data.splitlines():
-- 
2.45.2

The value to a user, and who that user might be

This is not an issue on QubesOS, because in qubes you have OOTB setup, and pools are never empty.

This is not the case on NixOS as dom0, on Nix you need to install distributions after
https://github.com/QubesOS/qubes-core-admin-client/blob/main/qubesadmin/storage.py

Completion criteria checklist

(This section is for developer use only. Please do not modify it.)

@ethnh ethnh added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: storage P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants