[pve-devel] applied: [PATCH v4 0/8] Refactor QemuServer to avoid dependency cycles

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 20 20:41:46 CET 2019


On 11/19/19 12:23 PM, Stefan Reiter wrote:
> This series refactors QemuServer and creates three new packages:
> * 'PVE::QemuServer::Helpers' for general purpose helpers
> * 'PVE::QemuServer::Monitor' for higher-level QMP functions
> * 'PVE::QemuServer::Machine' for QEMU machine-type related helpers
> 
> This refactoring came along because qemu_machine_feature_enabled needs to be
> used in 'PVE::QemuServer::CPUConfig', a new package that will be introduced with
> my custom CPU series [0]. This would currently require dependency cycles, but by
> extracting the code in this series and splitting it up into multiple helper
> modules, this can be avoided. Care was taken not to introduce new dependecy
> cycles.
> 
> New functions are created as PVE::QemuServer, not PVE::Qemu, to be consistent
> for now.
> 
> v4:
> * fixed some 'use' statements
> * leave config/lock paths in QemuConfig
> * fix and improve parse_cmdline (differentiate parameter '--foo' and '--foo 1',
>   no ordering for now, I don't know if that ever makes in difference in QEMU?)
> * vm_exists_on_node -> assert_config_exists_on_node and improved error message,
>   remove $noerr (can be moved to AbstractConfig later if wanted)
> * include Monitor.pm in the patch creating it ;)
> 
> v3:
> * QMP -> QemuServer::Monitor
> * QemuSchema -> QemuServer::Helpers (more or less)
> * split check_running (but keep old version to not change all callers)
> * split qemu_machine_feature_enabled
> * include "check_cmdline -> parse_cmdline" patch in series (needed for later
>   live migration with custom CPU types anyway)
> * redo patches to pve-manager/pve-ha-manager to accomodate changes in v3
> 
> v2:
> * Actually test changes correctly - sorry
> * Fix a few package 'use's I missed to move to new packages
> * Fix tests for pve-manager
> * Fix missing '=' in pve-container
> 
> [0] https://pve.proxmox.com/pipermail/pve-devel/2019-October/039608.html
> 
> 
> qemu-server: Stefan Reiter (6):
>   refactor: create QemuServer::Helpers and move file/dir code
>   Change check_cmdline to parse_cmdline
>   refactor: split check_running into _exists_ and _running_
>   refactor: create QemuServer::Monitor for high-level QMP access
>   refactor: extract QEMU machine related helpers to package
>   refactor: split qemu_machine_feature_enabled
> 

applied, with breaks/depends for ha-manager and pve-manager. Had to resolve a
trivial merge conflict due to a recent change for print_vga_device which used
qemu_machine_featur.. method and had to change signature a bit.
Took this chance to make the min_version helper an EXPORT_OK, as it is used
very frequently in QemuServer, just FYI. thanks





More information about the pve-devel mailing list