[libvirt] [GSoC] Update ideas page

2018-12-02 Thread Michal Prívozník
Dear list, Google announced another round of GSoC [1]. The organization applications can be filled mid January next year (~1.5 month to go). Please update our Ideas page [2] if you have any idea for student projects (you do not have to mentor it if you don't feel like it). Similarly, if you

[libvirt] [PATCH v3] openvswitch: Add new port VLAN mode "dot1q-tunnel"

2018-12-02 Thread luzhipeng
From: ZhiPeng Lu Signed-off-by: ZhiPeng Lu --- v1->v2: 1. Fix "make syntax-check" failure v2->v3: 1. remove other_config when updating vlan docs/formatnetwork.html.in | 17 + docs/schemas/networkcommon.rng | 1 + src/conf/netdev_vlan_conf.c | 2 +-

[libvirt] [PATCH v5 01/36] qemu_process: Move process code from qemu_capabilities to qemu_process

2018-12-02 Thread Chris Venteicher
Qemu process code in qemu_capabilities.c is moved to qemu_process.c in order to make the code usable outside the original capabilities usecases. The moved code activates and manages Qemu processes without establishing a guest domain. ** This patch is a straight cut/paste move between files. **

[libvirt] [PATCH v5 02/36] qemu_process: Use qemuProcessQmp prefix

2018-12-02 Thread Chris Venteicher
s/virQEMUCapsInitQMPCommand/qemuProcessQmp/ No functionality change. Use file appropriate prefix in moved code. Signed-off-by: Chris Venteicher --- src/qemu/qemu_capabilities.c | 14 +++--- src/qemu/qemu_process.c | 28 ++-- src/qemu/qemu_process.h |

[libvirt] [PATCH v5 07/36] qemu_process: Use qemuProcessQmp struct for a single process

2018-12-02 Thread Chris Venteicher
In new process code, move from model where qemuProcessQmp struct can be used to activate a series of Qemu processes to model where one qemuProcessQmp struct is used for one and only one Qemu process. By allowing only one process activation per qemuProcessQmp struct, the struct can safely store

[libvirt] [PATCH v5 04/36] qemu_process: Refer to proc not cmd in process code

2018-12-02 Thread Chris Venteicher
s/cmd/proc/ in process code imported from qemu_capabilities. No functionality is changed. Just variable renaming. Process code imported from qemu_capabilities was oriented around starting a process to issue a single QMP command. Future usecases (ex. baseline, compare) expect to use a single

[libvirt] [PATCH v5 05/36] qemu_process: Use consistent name for stop process function

2018-12-02 Thread Chris Venteicher
s/qemuProcessQmpAbort/qemuProcessQmpStop/ applied to change function name used to stop QEMU processes in process code moved from qemu_capabilities. No functionality change. The new name, qemuProcessQmpStop, is consistent with the existing function qemuProcessStop used to stop Domain processes.

[libvirt] [PATCH v5 03/36] qemu_process: Limit qemuProcessQmpNew to const input strings

2018-12-02 Thread Chris Venteicher
Add the const qualifier on non modified strings (string only copied inside qemuProcessQmpNew) so that const strings can be used directly in calls to qemuProcessQmpNew in future patches. Signed-off-by: Chris Venteicher --- src/qemu/qemu_process.c | 2 +- src/qemu/qemu_process.h | 2 +- 2 files

[libvirt] [PATCH v5 09/36] qemu_process: Persist stderr in qemuProcessQmp struct

2018-12-02 Thread Chris Venteicher
A qemuProcessQmp struct tracks the entire lifespan of a single QEMU Process including storing error output when the process terminates or activation fails. Error output remains available until qemuProcessQmpFree is called. The qmperr variable is renamed stderr (captures stderr from process.)

[libvirt] [PATCH v5 00/36] BaselineHypervisorCPU using QEMU QMP exchanges

2018-12-02 Thread Chris Venteicher
Some architectures (S390) depend on QEMU to compute baseline CPU model and expand a models feature set. Interacting with QEMU requires starting the QEMU process and completing one or more query-cpu-model-baseline QMP exchanges with QEMU in addition to a query-cpu-model-expansion QMP exchange to

[libvirt] [PATCH v5 13/36] qemu_process: Setup paths within qemuProcessQmpInit

2018-12-02 Thread Chris Venteicher
Move code for setting paths and prepping file system from qemuProcessQmpNew to qemuProcessQmpInit. This keeps qemuProcessQmpNew limited to data structures and path initialization is done in qemuProcessQmpInit. The patch is a non-functional, cut / paste change, however goto is now "cleanup"

[libvirt] [PATCH v5 06/36] qemu_capabilities: Stop QEMU process before freeing

2018-12-02 Thread Chris Venteicher
virQEMUCapsInitQMP now stops QEMU process in all execution paths, before freeing the process structure. The qemuProcessQmpStop function can be called multiple times without problems... Won't attempt to stop processes and free resources multiple times. Follow the convention established in

[libvirt] [PATCH v5 10/36] qemu_process: Introduce qemuProcessQmpStart

2018-12-02 Thread Chris Venteicher
Move a step closer to the function structure used elsewhere in qemu_process where qemuProcessStart and qemuProcessStop are the exposed functions. qemuProcessQmpStart mirrors qemuProcessStart in calling sub functions to initialize, launch the process and connect the monitor to the QEMU process.

[libvirt] [PATCH v5 08/36] qemu_process: All ProcessQMP errors are fatal

2018-12-02 Thread Chris Venteicher
In the past capabilities could be determined in other ways if QMP messaging didn't succeed so a non-fatal error case was included in the capabilities and QMP Process code. For a while now, QMP capabilities failure has been a fatal case. This patch makes QMP process failures return as a fatal

[libvirt] [PATCH v5 15/36] qemu_process: Don't open monitor if process failed

2018-12-02 Thread Chris Venteicher
Gracefully handle case when proc activation failed prior to calling. Consistent with the existing code for qemuConnectMonitor (for domains) in qemu_process.c... - Handle qemMonitorOpen failure with INFO message and NULL ptr - Identify parameters passed to qemuMonitorOpen Monitor callbacks

[libvirt] [PATCH v5 12/36] qemu_process: Store libDir in qemuProcessQmp struct

2018-12-02 Thread Chris Venteicher
Store libDir path in the qemuProcessQmp struct in anticipation of moving path construction code into qemuProcessQmpInit function. Signed-off-by: Chris Venteicher --- src/qemu/qemu_process.c | 8 +--- src/qemu/qemu_process.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git

[libvirt] [PATCH v5 11/36] qemu_process: Collect monitor code in single function

2018-12-02 Thread Chris Venteicher
qemuMonitor code lives in qemuProcessQmpConnectMonitor rather than in qemuProcessQmpNew and qemuProcessQmpLaunch. This is consistent with existing structure in qemu_process.c where qemuConnectMonitor function contains monitor code for domain process activation. Simple code moves in this patch.

[libvirt] [PATCH v5 14/36] qemu_process: Stop retaining Monitor config in qemuProcessQmp

2018-12-02 Thread Chris Venteicher
The monitor config data is removed from the qemuProcessQmp struct. The monitor config data can be initialized immediately before call to qemuMonitorOpen and does not need to be maintained after the call because qemuMonitorOpen copies any strings it needs. Signed-off-by: Chris Venteicher ---

[libvirt] [PATCH v5 20/36] qemu_process: Enter QMP command mode when starting QEMU Process

2018-12-02 Thread Chris Venteicher
qemuProcessQmpStart starts a QEMU process and monitor connection that can be used by multiple functions possibly for multiple QMP commands. The QMP exchange to exit capabilities negotiation mode and enter command mode can only be performed once after the monitor connection is established. Move

[libvirt] [PATCH v5 23/36] qemu_monitor: Introduce qemuMonitorCPUModelInfoNew

2018-12-02 Thread Chris Venteicher
Use a helper function to allocate and initializes CPU Model Info structs. Signed-off-by: Chris Venteicher --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_monitor.c | 32 +++- src/qemu/qemu_monitor.h | 2 ++ 3 files changed, 30 insertions(+), 6

[libvirt] [PATCH v5 21/36] qemu_process: Use unique directories for QMP processes

2018-12-02 Thread Chris Venteicher
Multiple QEMU processes for QMP commands can operate concurrently. Use a unique directory under libDir for each QEMU processes to avoid pidfile and unix socket collision between processes. The pid file name is changed from "capabilities.pidfile" to "qmp.pid" because we no longer need to avoid a

[libvirt] [PATCH v5 22/36] qemu_process: Stop locking QMP process monitor immediately

2018-12-02 Thread Chris Venteicher
Locking the monitor object immediately after call to qemuMonitorOpen doesn't make sense now that we have expanded the QEMU process code to cover more than the original capabilities usecase. Removing the monitor lock makes the qemuProcessQmpConnectMonitor code consistent with the

[libvirt] [PATCH v5 16/36] qemu_process: Cleanup qemuProcessQmp alloc function

2018-12-02 Thread Chris Venteicher
qemuProcessQmpNew is one of the 4 public functions used to create and manage a qemu process for QMP command exchanges outside of domain operations. Add descriptive comment block, Debug statement and make source consistent with the cleanup / VIR_STEAL_PTR format used elsewhere. Signed-off-by:

[libvirt] [PATCH v5 17/36] qemu_process: Cleanup qemuProcessQmpStop function

2018-12-02 Thread Chris Venteicher
qemuProcessQmpStop is one of the 4 public functions used to create and manage a Qemu process for QMP command exchanges. Add comment header and debug message. Other minor code formatting cleanup. No change in functionality is intended. Signed-off-by: Chris Venteicher ---

[libvirt] [PATCH v5 19/36] qemu_monitor: Make monitor callbacks optional

2018-12-02 Thread Chris Venteicher
Qemu process code for capababilities doesn't use monitor callbacks and defines empty callback functions. Allow NULL to be passed to qemuMonitorOpen for callbacks and remove the empty functions from the QMP process code. Signed-off-by: Chris Venteicher --- src/qemu/qemu_monitor.c | 4 ++--

[libvirt] [PATCH v5 18/36] qemu_process: Catch process free before process stop

2018-12-02 Thread Chris Venteicher
Catch execution paths where qemuProcessQmpFree is called before qemuProcessQmpStop then report error and force stop before proceeding. Also added public function header and debug message. Signed-off-by: Chris Venteicher --- src/qemu/qemu_process.c | 17 - 1 file changed, 16

[libvirt] [PATCH v5 29/36] qemu_monitor: Support query-cpu-model-baseline QMP command

2018-12-02 Thread Chris Venteicher
Introduce monitor functions to use QEMU to compute baseline cpu from an input of two cpu models. Signed-off-by: Chris Venteicher --- src/qemu/qemu_monitor.c | 12 src/qemu/qemu_monitor.h | 6 src/qemu/qemu_monitor_json.c | 60

[libvirt] [PATCH v5 31/36] qemu_driver: Decouple code for baseline using libvirt

2018-12-02 Thread Chris Venteicher
Create utility function encapsulating code to calculate hypervisor baseline cpu using the local libvirt utility functions. Similar function encapsulating code to calculating hypervisor baseline using QEMU QMP messages will be introduced in later commit. Patch is a cut and paste of existing code

[libvirt] [PATCH v5 27/36] qemu_capabilities: Introduce CPUModelInfo to virCPUDef function

2018-12-02 Thread Chris Venteicher
Move existing code to convert between cpu model info structures (qemuMonitorCPUModelInfoPtr into virCPUDef) into a reusable function. The new function is used in this and future patches. Signed-off-by: Chris Venteicher --- src/qemu/qemu_capabilities.c | 84 ++--

[libvirt] [PATCH v5 28/36] qemu_capabilities: Introduce virCPUDef to CPUModelInfo function

2018-12-02 Thread Chris Venteicher
Create public function to convert virCPUDef data structure into qemuMonitorCPUModelInfoPtr data structure. There was no existing code to reuse to create this function so this new virQEMUCapsCPUModelInfoFromCPUDef function was based on reversing the action of the existing

[libvirt] [PATCH v5 25/36] qemu_capabilities: Introduce virQEMuCapsMigratablePropsDiff

2018-12-02 Thread Chris Venteicher
Create an augmented CPUModelInfo identifying which props are/aren't migratable based on a diff between migratable and non-migratable inputs. This patch pulls existing logic out of virQEMUCapsProbeQMPHostCPU and wraps the existing logic in a standalone function hopefully simplifying both functions

[libvirt] [PATCH v5 26/36] qemu_monitor: qemuMonitorGetCPUModelExpansion inputs and outputs CPUModelInfo

2018-12-02 Thread Chris Venteicher
A Full CPUModelInfo structure with props is sent to QEMU for expansion. virQEMUCapsProbeQMPHostCPU migratability logic partitioned into new function for clarity. Signed-off-by: Chris Venteicher --- src/qemu/qemu_capabilities.c | 8 +--- src/qemu/qemu_monitor.c | 31

[libvirt] [PATCH v5 24/36] qemu_monitor: Introduce qemuMonitorCPUModelInfo / JSON conversion

2018-12-02 Thread Chris Venteicher
Conversion functions are used convert CPUModelInfo structs into QMP JSON and the reverse. QMP JSON is of form: {"model": {"name": "IvyBridge", "props": {}}} qemuMonitorCPUModelInfoBoolPropAdd is used to add boolean properties to CPUModelInfo struct. qemuMonitorJSONGetCPUModelExpansion makes

[libvirt] [PATCH v5 30/36] qemu_driver: Consolidate code to baseline using libvirt

2018-12-02 Thread Chris Venteicher
Simple cut/paste operations within function qemuConnectBaselineHypervisorCPU to group together code specific to computing baseline using only libvirt utility functions. This is done in anticipation of creating new utility functions for 1) baseline using libvirt utilities (this code) 2) baseline

[libvirt] [PATCH v5 32/36] qemu_driver: Identify using libvirt as a distinct way to compute baseline

2018-12-02 Thread Chris Venteicher
Hypervisor baseline cpu can be computed locally using libvirt utility functions or remotely using QEMU QMP commands. Likewise, cpu feature expansion can be computed locally using libvirt utility functions or remotely using QEMU QMP commands. This patch identifies using libvirt as a distinct case

[libvirt] [PATCH v5 35/36] qemu_driver: Remove unsupported props in expanded hypervisor baseline output

2018-12-02 Thread Chris Venteicher
Hypervisor baseline has an expansion mode where the cpu property / feature list is fully expanded to list all supported (true) features. The output (expanded) cpu model should not list properties that are false (unsupported.) QEMU expansion output enumerates both true (supported) and false

[libvirt] [PATCH v5 36/36] qemu_monitor: Default props to migratable when expanding cpu model

2018-12-02 Thread Chris Venteicher
QEMU only returns migratable props when expanding model unless explicitly told to also include non-migratable props. Props will be marked migratable when we are certain QEMU returned only migratable props resulting in consistent information and expansion output for s390 that is consistent with

[libvirt] [PATCH v5 34/36] qemu_driver: Support feature expansion via QEMU when baselining cpu

2018-12-02 Thread Chris Venteicher
Support using QEMU to do feature expansion when also using QEMU to compute hypervisor baseline. A QEMU process is already created to send the QMP messages to baseline using QEMU. The same QEMU process is used for the CPU feature expansion. QEMU only returns migratable features when expanding CPU

[libvirt] [PATCH v5 33/36] qemu_driver: Support baseline calculation using QEMU

2018-12-02 Thread Chris Venteicher
Add capability to calculate hypervisor baseline using QMP message exchanges with QEMU in addition to existing capability to calculate baseline using libvirt utility functions. A new utility function encapsulates the core logic for interacting with QEMU using QMP baseline messages. The QMP