1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00
Commit graph

2205 commits

Author SHA1 Message Date
catborise
2a3c05020f test(connection): host-request tests give the fake open 1 s, not 0.2 s
CONNECT_TIMEOUT bounds both the wait for a host's request slot, which
these tests time out on purpose, and the wait for the open's thread,
which they expect to finish. 0.2 s was missed once on a CI runner
("h did not answer within 0.2 s" in test_an_ended_request_lets_the_next_one_in).
The four refusal tests now wait 1 s each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 10:22:41 +03:00
catborise
23ce5de31e feat(settings): WEBVIRTCLOUD_DEBUG=1 turns on Django's debug mode
DEBUG was fixed to False in the template, and Docker builds settings.py
from it in each container: debug mode could only be had by editing the
file inside a running container. It is now read from the environment like
the other options; off unless the variable is 1.

The toolbar's URLs follow settings-dev, which installs the toolbar, not
DEBUG: with the dev packages present, DEBUG alone imported them without
the app and every URL lookup failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 09:48:34 +03:00
catborise
47d2a34403 chore(static): nginx alone serves the static files; WhiteNoise is removed
nginx answers /static/ from staticfiles/ before a request reaches gunicorn,
so WhiteNoise never served a file in an installed panel. It only answered
under runserver with DEBUG off, from staticfiles/ as the last collectstatic
left it: a stale copy without the themes broke the page. The dev server
serves the sources itself with DEBUG on, or with --insecure, which the
README now says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-09 08:16:30 +03:00
catborise
a7f620d3c9 test(connection): the thread tests wait for the opens they started
ConnectionThreadsTestCase, like BoundedOpenTestCase, released its blocked
opens when a test ended without waiting for them, so an open could still
end during the next test. Its cleanup joins the threads the test started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:38:07 +03:00
catborise
9f323d709e test: no test connects to a real host
Tests of eight files patched a host's status but not what the page also read, its
connection, connection_error or proxy, and so connected for real: over
ssh to 10.0.0.9 or over TCP to unroutable addresses (5 to 10 s each until
the connect timeout), and to the machine's own libvirt (qemu:///system).
A failed host is not tried again for a while, so only the first such test
of a process connected, and which one depended on the order. They now
patch the connection itself, or what the page reads, and use RFC 5737
addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:22:16 +03:00
catborise
0d225edda4 test(connection): a test waits for the opens it started
BoundedOpenTestCase released its blocked opens when a test ended but did
not wait for them: an open that ended during the next test logged
"h: connected" into that test's assertLogs, and the log test failed in
two of three runs of the vrtManager tests in reverse order. The cleanup
now joins the threads the test started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 22:12:55 +03:00
catborise
f09a1b67f5 test(accounts): validate_ssh_key is tested in one place
test_ssh_keys repeated test_utils' cases of a key with and without a
comment and of an invalid key; test_utils keeps them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
6dab3b210c test(migrate): the worker refuses a migration whose user may no longer migrate
The worker checks again, before it migrates, that the job's user is
still an active superuser; no test removed either while the job was
queued, so the check could go unnoticed, as it is tested for clones and
new VMs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
9a4a201dac test(backup): the backup has the database's last change
The test checked only that the copy had a table, and it copied the test
run's own database file, which a run of this module alone does not
create. Each test now backs up a database of its own whose last change
is still only in its WAL file, and checks that the copy has it: a copy of
the main file alone would lose it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
91f8d83bc1 test(installer): check that the settings are copied from the template
The test checked only wvc_ensure_settings' exit status and then wrote
the settings file itself: a function that copied nothing passed. It now
checks the file's contents after the copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
2ee3e5ddad test(quota): the concurrent resize test checks what happened to each request
The test asserted only that one resize ran: a request that failed for any
other reason in its thread, unseen, passed it as well. It now collects
each request's messages, or its exception, and asserts that one resized
and the other was refused by the user's quota lock or by the quota.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 21:20:06 +03:00
catborise
3ead5fadd7 test(connection): a close during the lookup returns the connection it checked
The test fired the close callback at the 1st, 2nd or 3rd isAlive call of
a lookup, but a lookup calls isAlive once: two of its three cases closed
nothing. It also took a libvirtError for a result, as it only asserted
that the result was not None. It now runs the one interleaving there is
and asserts that the lookup returns the connection it checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 20:51:02 +03:00
catborise
b737b1f8f7 test(snapshots): check the call that creates a snapshot, not a wrapper of it
_snapshotCreateXML only forwarded to the domain's snapshotCreateXML, and
every snapshot test replaced it with a mock: a wrapper that called nothing
passed all of them. The wrapper is gone and the tests assert on the
domain's call, which the code makes directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 20:50:05 +03:00
catborise
8eb619114c fix(console): a session that a password change ended opens no console
session_user_id read the user id out of the session row as it was, so a
session cookie that Django no longer accepts (the user's password changed,
or the user was deactivated) still matched a console token of its user in
novncd and socketiod. It now asks django.contrib.auth.get_user, which checks
the session's password hash and that the user may sign in.

The serial console tests built sessions by hand with only the user id;
they now sign in with force_login, as the panel does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 20:47:27 +03:00
catborise
fe553a2d65 fix(console): a serial console token works only in its user's session
socketiod refused a request without a signed-in session, but took a
token from anyone's session: a token read from a log or a URL opened
another user's serial console for 120 s. As novncd does, the session
must be the token's user's; the refusal is the page's "not allowed".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
b6752f6370 docs(readme): the development setup starts the job worker
Creating, cloning, migrating and deleting VMs are jobs: with the dev
server alone they stay queued. The step starts run_worker with the dev
settings in another terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
cac76b84cc docs: how the datasource finds a VM, and the console settings only a superuser changes
The datasource names the VM by the reverse DNS name of the request's
address and sends keys only when its first label is one VM's name. On
the console settings, the listen address and removing the password of
a console listening beyond localhost are a superuser's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
e7df84e2ae docs(readme): API errors, the new VM steps and refusals in the Logs
An API request with invalid fields answers DRF's field errors, not
{"detail": ...}. The new VM's machine is chosen on a page before the
details form. The Logs page records 401 and 403 answers; a VM hidden
from a user answers 404 and is not logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
49c99e430b docs(readme): the backup timer starts within 10 minutes of 03:15
webvirt-backup.timer has RandomizedDelaySec=10min and Persistent=true:
it runs up to 10 minutes after 03:15, and at the next boot when the
server was off then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
77a5013fd3 docs(readme): a console token needs a signed-in session
The serial console refuses a request without a signed-in session before
it reads the token, and noVNC accepts a token only in its user's
session: the token alone does not open a console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
d08c7d5333 docs(permissions): passwordless_console is a default of the new-user form
Only the Users page's new-user form ticks it; the signal for new users
grants change_password alone, and the grant to every user ran once, in
the migration that added the permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
6b2092e19d docs(readme): the features list says what cancels, freezes and shows
Only a queued job or a running clone, migration, disk move or ISO upload
can be cancelled (the other kinds are not cancellable once running).
Freezing the guest's file systems is an option of a snapshot without
memory. instances.view_instances shows every VM read-only, besides the
VMs assigned to a user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
47ec243248 docs(architecture): Python 3.14, and which API VM list reconciles
CI runs Python 3.10 to 3.14. The API's list of one compute's VMs calls
refresh_instance_database before reading, as the VM list page does; only
the list of all VMs reads the rows as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
892c738a13 docs(readme): the SMBIOS warning's fix restarts virtqemud on RHEL 10
The RHEL family 10 computes run libvirt's modular daemons (the bootstrap
enables virtqemud.socket), where no libvirtd is there to restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
2af26221dd docs(readme): the docker stop command names the container
docker stop -t 95 without a container fails with "requires at least 1
argument"; compose names it webvirtcloud.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
59089e3407 docs(readme): moving a PostgreSQL panel leaves out the SQLite restore
Both blocks of Moving to a new machine restore $b/db.sqlite3, which a
backup of a PostgreSQL panel does not have, so the chain stopped there.
The section says to restore PostgreSQL by hand and leave that line out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
0637490133 docs(readme): moving to a new machine copies an empty ssh backup too
The installer block copied the backup's SSH keys with cp "$b"/ssh/*:
a backup of a panel without keys has an empty ssh/ directory, the glob
stays unexpanded, cp fails and the rest of the && chain is skipped. It
copies the directory's contents as the pki line does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
52455bf0fb docs(readme): manage.py commands run with the panel's venv and user
The password reset and the behaviour changes' session and lockout
commands ran a bare python3 manage.py, which on an installer host fails
with "Couldn't import Django" (the packages are in the venv) and had no
Docker form. They name the venv's python as the web service user, and
the Docker exec form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 18:01:30 +03:00
catborise
c72ce9a299 ci: the Docker image is built with a layer cache
Each run built the image from nothing, compiling libvirt-python and
python-ldap again. Buildx keeps the layers in GitHub's cache, so a run
that changes only code rebuilds only the last stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00
catborise
1549b5e9f1 build(docker): docker-compose.yml leaves out Compose's defaults
build named the default Dockerfile and each volume the default local
driver. The resolved config is the same; the volumes keep their names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00
catborise
a2bbf788f4 build(docker): the build context leaves out docs, CI and the host installers
The image took .github, doc, dev, the installer scripts, the Vagrantfile
and the ruff cache, and a rotated log (*.log.1) of a used checkout. The
list is now grouped by why a file stays out, without the entries for
tools this repository does not use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00
catborise
6e3d376eef build(docker): gunicorn runs 4 workers in the image
gunicorn.conf.py starts 2 x CPUs + 1 workers, at most 8, about 140 MB
each: 1.1 GB on the deployed host for a panel. The image now runs 4,
which still sends up to 8 requests at a time to one compute and leaves
threads for the others when one hangs. GUNICORN_CMD_ARGS in
docker-compose.override.yml sets another number; installs outside
Docker keep their default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00
catborise
80a66dc8b5 build(docker): the image is Ubuntu 26.04 with supervisord in place of phusion's runit
phusion/baseimage brought sshd, syslog-ng, my_init and runit's per
service scripts, and an nginx log forwarder tailing a file. The image
is now ubuntu:26.04 with Ubuntu's supervisor: conf/docker holds the
start script (settings, secret key, ownership, migrations as www-data),
one supervisord.conf for the six processes, nginx's config with errors
to docker logs, the backup's cron line and the health check. A stop
signals every process at once, so the worker keeps its 60 s drain
within the 95 s grace. The same volumes and container name work as
before; README runs commands with exec -u www-data in place of
/sbin/setuser. The image goes from 805 MB to 642 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00
catborise
b03828c684 build(docker): the image has one copy of the venv and no pip
chown -R www-data on /srv/webvirtcloud after collectstatic copied the
venv and the code into a layer of their own. The code now stays root's:
the panel writes only to its data and backup directories, which the
start script gives it. pip is removed from the runtime venv and its
cache is a build cache mount, so a requirement change downloads only
what changed. The image goes from 1.17 GB to 805 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 15:57:33 +03:00
catborise
1764240cff refactor(vrtManager): instance.py imports libvirt's names without a fallback
When the import of libvirt's names failed, the except branch imported
four of them and left the module to fail later on any other one with a
NameError. libvirt-python always has them; the import is a plain one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:44:09 +03:00
catborise
56806b2f8b refactor(vrtManager): the connection manager locks its dict with threading.RLock
The 223-line read-write lock guarded only the dict of connections, a
lookup of a few entries: readers never waited on a long writer, as the
connection is opened outside the lock. One reentrant lock does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:43:33 +03:00
catborise
2dfc393f05 fix(vrtManager): a new VM's disk path, network and filter names are XML text
create_instance put an existing volume's path and the network and
filter names into the domain XML unescaped, so a quote or ampersand,
which libvirt allows in them, broke the VM's XML. They are escaped as
attach_disk does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:42:47 +03:00
catborise
0ac078b9cc fix(vrtManager): an RBD disk takes its pool's auth and monitors as they are
A disk of an RBD pool, at VM creation or added later, had the pool's
user, secret uuid and monitors put into its XML as strings: a user with
a quote or ampersand broke the XML, and a secret named by usage gave
IndexError on attach and uuid='None' at creation. One function now
copies the pool's auth (uuid or usage) and host elements into the
disk's source with lxml, replacing the two string builders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:42:20 +03:00
catborise
f94124c891 fix(vrtManager): an ISO put in a host CD-ROM drive is read
A CD-ROM of type block (a host drive) kept its type when an ISO was
inserted, and libvirt reads only source/@dev for that type, so the drive
stayed empty. Inserting an ISO now makes it a file drive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:40:26 +03:00
catborise
1ddc941b2d fix(vrtManager): a vCPU maximum the CPU topology does not make is refused first
A VM with a CPU topology takes only the maximum it makes; libvirt
refused another one after the vCPU hotplug list had been removed, so a
failed resize left hotplug off. The maximum is now checked against the
topology before anything changes, with tr and zh translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:40:06 +03:00
catborise
e206862856 fix(vrtManager): a NIC's edit keeps the parameters of its filter
Saving a NIC's settings replaced its filterref even when the filter
stayed the same, so its parameters were lost: clean-traffic with a
fixed IP went back to learning the address at the next start. The same
filter now keeps its element; another filter replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:38:53 +03:00
catborise
8d09e08908 fix(storages): a volume's copy is not offered as qcow
QEMU no longer creates images of the first qcow format: qemu-img stops
with "Unknown file format 'qcow'", so converting a copy to it always
failed. The choice is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:36:52 +03:00
catborise
ff46ae509f fix(vrtManager): a template's copy takes qcow2's options only as qcow2
The copy of a template for a new VM always got qcow2's compat and
lazy_refcounts, which libvirt refuses for a qcow template, and only a
dir pool named it as a file. Every pool of files now does, and only a
qcow2 copy gets those options. The pool types of files are one list,
which the cloud-init seed check also reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:35:19 +03:00
catborise
f952d4e0d0 fix(vrtManager): a VM's new disk in an NFS or filesystem pool keeps its format
A new VM's disk and a disk added to a VM were built by a copy of the
volume XML of the Storage page that kept the format in dir pools only:
in an fs or netfs pool a qcow2 disk became a raw one allocated whole,
and a qcow disk got qcow2's compat and lazy_refcounts, which libvirt
refuses. Both now use the Storage page's builder, where every pool of
files keeps the format and the other pools make a raw volume without
metadata preallocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:34:51 +03:00
catborise
8f09812b7d fix(instances): a new VM's existing volume or template is taken from the chosen pool
The create job looked volumes up by name in every active pool and took
the first match, so a volume of the same name in another pool could be
attached or copied in place of the chosen one. The form now sends each
existing volume as pool/volume and the template's pool, and the job
looks each up in its own pool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 14:33:10 +03:00
catborise
d2383be914 refactor(vrtManager): new VM UUIDs come from uuid.uuid4()
randomUUID() built a version 4 UUID from 16 random bytes by hand; the clone and create jobs now take str(uuid4()) from the standard library, and the function and its format test go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 12:24:47 +03:00
catborise
f97708a7b7 refactor(instances): a new disk's name prefix comes from vol_dev_type
get_new_disk_dev() mapped virtio to vd, ide to hd, fdc to fd and other buses to sd itself; vrtManager.util.vol_dev_type() has that mapping, and the bus change in vrtManager uses it with the same sd fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 12:24:18 +03:00
catborise
cc104716e0 refactor(instances): a migration merges owners with move_ownership
record_migration() repeated computes.utils._move_ownership() line by line: owners move to the record the destination already has, a user's rights are merged and the template mark is kept. It now calls that function, renamed move_ownership as it is used from both apps; the owners left on the source record go with it, by cascade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 12:20:17 +03:00
catborise
9ec3c09358 refactor(vrtManager): remove the wvmConnect.close() that did nothing
Its body was a pass: connections are kept by the connection manager, not closed per object. The calls to it, and the finally blocks and None guards that only called it, are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 12:19:29 +03:00
catborise
62885c74ca refactor(vrtManager): validate_macaddr checks the type once
It tested isinstance(val, str) twice, a leftover of the Python 2 str/unicode check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 12:16:50 +03:00