[PATCH] docs: Small fixes for daemons.rst

2021-06-04 Thread Jim Fehlig
Remove some dupicate text and replace in incorrect occurance of monolithic with modular. Signed-off-by: Jim Fehlig --- docs/daemons.rst | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/daemons.rst b/docs/daemons.rst index 2cd6b47c2a..8a05ee77a7 100644 ---

[PATCH 3/3] libxl: Support firmware autoselection

2021-06-04 Thread Jim Fehlig
Xen only supports one firmware, making autoselection easy to implement. In fact, is probably preferable in the Xen driver, where libxl supports a firmware setting with accepted values such as bios, ovmf, uefi (currently same semantics as ovmf), seabios, etc. Signed-off-by: Jim Fehlig ---

[PATCH 2/3] libxl: Forbid domain definition with secure boot enabled

2021-06-04 Thread Jim Fehlig
Xen+ovmf does not support secure boot. Fail domain def validation if secure boot is enabled. Signed-off-by: Jim Fehlig --- src/libxl/libxl_domain.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 9630f12568..14d000511a

[PATCH 0/3] libxl: A few firmware improvments

2021-06-04 Thread Jim Fehlig
Upstream ovmf will be removing support for Xen in the traditional ovmf package, moving it to a separate OvmfXen package https://bugzilla.tianocore.org/show_bug.cgi?id=2122 This motivated me to verify the impact on libvirt+ovmf+xen. Fortunately it is minimal since the new OvmfXen package is

[PATCH 1/3] libxl: Introduce domain def validate callback

2021-06-04 Thread Jim Fehlig
Introduce libxlDomainDefValidate and move the existing validation check from libxlDomainDefPostParse. Additional validation will be introduced in subsequent patches. Signed-off-by: Jim Fehlig --- src/libxl/libxl_domain.c | 27 ++- 1 file changed, 18 insertions(+), 9

[libvirt PATCH v2 2/7] nodedev: implement virNodeDevice(Get|Set)Autostart()

2021-06-04 Thread Jonathon Jongsma
Implement autostart functionality for mediated devices. Signed-off-by: Jonathon Jongsma --- src/conf/node_device_conf.h | 1 + src/conf/virnodedeviceobj.c | 16 src/conf/virnodedeviceobj.h | 6 ++ src/libvirt_private.syms | 2 +

[libvirt PATCH v2 0/7] Enable autostarting mediated devices

2021-06-04 Thread Jonathon Jongsma
This series replaces the initial patch that was recently reverted. It implements the autostart feature using a new virNodeDeviceGet/SetAutostart() API that is consistent with how other libvirt objects handle autostart. It also adds a counterpart virsh command nodedev-autostart. In order to easily

Re: [libvirt PATCH 2/7] nodedev: implement virNodeDevice(Get|Set)Autostart()

2021-06-04 Thread Jonathon Jongsma
On Fri, Jun 4, 2021 at 3:07 AM Daniel P. Berrangé wrote: > > On Thu, Jun 03, 2021 at 03:11:51PM -0500, Jonathon Jongsma wrote: > > Implement autostart functionality for mediated devices. > > > > Signed-off-by: Jonathon Jongsma > > --- > > src/conf/virnodedeviceobj.c | 16 > >

Re: [libvirt PATCH v2] docs: introduce stubs for new libvirt Go packages

2021-06-04 Thread Andrea Bolognani
On Fri, Jun 04, 2021 at 03:46:59PM +0100, Daniel P. Berrangé wrote: > += > +Libvirt Go Language API (semver, with Go modules) > += "with Go modules support", perhaps? > +The `Go

[PATCH] remote: remove/annotate unused variables

2021-06-04 Thread Daniel P . Berrangé
Fixes commit 48f66cfe3ee51baf64f06f1f89dda52af6f4d9d6 Fixes commit fcdcf8f70cf5d6657086e2889124d0e1a7332a29 Signed-off-by: Daniel P. Berrangé --- src/remote/remote_driver.c | 3 --- src/rpc/virnetsocket.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git

Re: [PATCH] ch: set shared drivers

2021-06-04 Thread Daniel P . Berrangé
On Fri, Jun 04, 2021 at 02:50:52PM +, Wei Liu wrote: > We want to use those shared drivers provided by libvirt to avoid > implementing our own. > > Signed-off-by: Wei Liu > --- > src/ch/ch_driver.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé

[PATCH] ch: set driver to NULL after freeing it

2021-06-04 Thread Daniel P . Berrangé
If the chStateInitialize method fails, we call chStateCleanup which free's all global state. It fails to set the global 'ch_driver' to NULL, however, so a later attempt to open the cloud hypervisor driver will succeed and then crash attempting to access freed memory. Signed-off-by: Daniel P.

Re: Libvirt CI for running functional tests

2021-06-04 Thread Praveen K Paladugu
Erik, Thanks for this detailed response. It answers many questions we had about CI for libvirt. On 6/2/2021 3:32 AM, Erik Skultety wrote: On Thu, May 27, 2021 at 11:17:04AM -0500, Praveen K Paladugu wrote: Hi, While developing cloud-hypervisor driver for libvirt, we re-fitted

[PATCH] ch: set shared drivers

2021-06-04 Thread Wei Liu
We want to use those shared drivers provided by libvirt to avoid implementing our own. Signed-off-by: Wei Liu --- src/ch/ch_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index 7d1e97098aef..f1f88ad30cf5 100644 ---

[libvirt PATCH v2] docs: introduce stubs for new libvirt Go packages

2021-06-04 Thread Daniel P . Berrangé
Currently we expose libvirt Go packages at libvirt.org/libvirt-go libvirt.org/libvirt-go-xml These packages have not supported Go modules historically and when we tried to introduce modules, we hit the problem that we're not using semver for versioning. The only way around this is to

Re: [PATCH 0/6] Be tolerant to CH_CMD missing

2021-06-04 Thread Daniel P . Berrangé
On Fri, Jun 04, 2021 at 03:10:39PM +0200, Michal Privoznik wrote: > See 4/6 for more info. The rest is just cleanup. > > Michal Prívozník (6): > ch_conf: Move error reporting into chExtractVersionInfo() > chExtractVersionInfo: Don't check for retversion != NULL > ch_conf: Dissolve

[PATCH 3/6] ch_conf: Dissolve chExtractVersionInfo() in chExtractVersion()

2021-06-04 Thread Michal Privoznik
After previous patches, there's not much value in chExtractVersion(). Rename chExtractVersionInfo() to chExtractVersion() and have it use virCHDriver directly. Signed-off-by: Michal Privoznik --- src/ch/ch_conf.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff

[PATCH 1/6] ch_conf: Move error reporting into chExtractVersionInfo()

2021-06-04 Thread Michal Privoznik
If chExtractVersionInfo() fails, in some cases it reports error and in some it doesn't. Fix those places and drop reporting error from chExtractVersion() which would just overwrite more specific error. Signed-off-by: Michal Privoznik --- src/ch/ch_conf.c | 15 +-- 1 file changed, 9

[PATCH 5/6] chExtractVersion: use g_auto*

2021-06-04 Thread Michal Privoznik
There are two variables that can be freed automatically: @cmd (which allows us to drop explicit virCommandFree() call at the end of the function) and @help which was never freed (and thus leaked). Signed-off-by: Michal Privoznik --- src/ch/ch_conf.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[PATCH 4/6] ch_driver: Don't error out if CH_CMD was not found

2021-06-04 Thread Michal Privoznik
The CH driver needs "cloud-hypervisor" binary. And if none was found then the initialization of the driver fails as chStateInitialize() returns VIR_DRV_STATE_INIT_ERROR. This in turn means that whole daemon fails to initialize. Let's return VIR_DRV_STATE_INIT_SKIPPED in this particular case, which

[PATCH 0/6] Be tolerant to CH_CMD missing

2021-06-04 Thread Michal Privoznik
See 4/6 for more info. The rest is just cleanup. Michal Prívozník (6): ch_conf: Move error reporting into chExtractVersionInfo() chExtractVersionInfo: Don't check for retversion != NULL ch_conf: Dissolve chExtractVersionInfo() in chExtractVersion() ch_driver: Don't error out if CH_CMD was

[PATCH 6/6] chExtractVersion: Drop @ret

2021-06-04 Thread Michal Privoznik
After previous patches, the @ret variable and the 'cleanup' label are redundant. Remove them. Signed-off-by: Michal Privoznik --- src/ch/ch_conf.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c index c67c815d45..5f156dfe44

[PATCH 2/6] chExtractVersionInfo: Don't check for retversion != NULL

2021-06-04 Thread Michal Privoznik
The only caller, chExtractVersion() passes not NULL. Therefore, it's redundant to check for NULL. Signed-off-by: Michal Privoznik --- src/ch/ch_conf.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c index d900ebc7dd..706e5f0ba4

Re: [PATCH v1 00/10] capabilities: Expose HMAT

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 10:36:01AM +0200, Michal Privoznik wrote: We allow configuring HMAT for domains since v6.6.0-rc1~249 (and friends). Basically, HMAT is more fine grained description of interconnects of NUMA nodes than basic NUMA distances. The former describes bandwidths and latencies

Re: [PATCH v1 10/10] vircaps2xmltest: Introduce HMAT test case

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 10:36:11AM +0200, Michal Privoznik wrote: This test was generated on a guest with the following NUMA configuration:

Re: [PATCH v1 09/10] capabilities: Expose NUMA interconnects

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 10:36:10AM +0200, Michal Privoznik wrote: Links between NUMA nodes can have different latencies and bandwidths. This info is newly defined in ACPI 6.2 under Heterogeneous Memory Attribute Table (HMAT) table. Linux kernel learned how to report these values under sysfs and

Re: [PATCH v1 06/10] capabilities: Expose NUMA memory side cache

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 10:36:07AM +0200, Michal Privoznik wrote: Memory on a NUMA node can have a side caches. Configuring these for a domain was implemented in v6.6.0-rc1~249 and friends. However, up until now mgmt applications did not really know what values to pass because we were not

Re: [PATCH 3/3] virfile: Use g_canonicalize_file() to simplify virFileAbsPath()

2021-06-04 Thread Martin Kletzander
On Fri, Jun 04, 2021 at 07:38:42PM +0800, Luke Yue wrote: On Fri, 2021-06-04 at 12:28 +0200, Martin Kletzander wrote: On Mon, May 31, 2021 at 09:48:24AM +0800, Luke Yue wrote: > Though the comment says that the function may return -1 on error, > but it > seems that now it will never return -1

Re: [PATCH 2/3] virfile: Simplify virFindFileInPath() with g_find_program_in_path()

2021-06-04 Thread Martin Kletzander
On Fri, Jun 04, 2021 at 07:29:36PM +0800, Luke Yue wrote: On Fri, 2021-06-04 at 12:26 +0200, Martin Kletzander wrote: On Mon, May 31, 2021 at 09:48:23AM +0800, Luke Yue wrote: > The behavior is a little bit different when using > g_find_program_in_path(), when the `file` contains a relative

[libvirt PATCH] meson: Ask rst2html to strip comments

2021-06-04 Thread Andrea Bolognani
They can be problematic: in particular, the rst files generated by keycodemapdb's keymap-gen contain things like To re-generate, run: keymap-gen --lang=rst --title=virkeycode-osx [...] which result in xsltproc later choking with [1/12] Generating virkeyname-osx.html with a meson_exe.py

[PATCH] docs: formatdomain: Document disk serial truncation status quo

2021-06-04 Thread Peter Krempa
Disk serials are truncated arbitrarily and silently by qemu depending on the device type and how they are configured. Since changing the current state would lead to more regressions than we have now, document that the truncation is arbitrary. Signed-off-by: Peter Krempa ---

Re: [PATCH 3/3] virfile: Use g_canonicalize_file() to simplify virFileAbsPath()

2021-06-04 Thread Luke Yue
On Fri, 2021-06-04 at 12:28 +0200, Martin Kletzander wrote: > On Mon, May 31, 2021 at 09:48:24AM +0800, Luke Yue wrote: > > Though the comment says that the function may return -1 on error, > > but it > > seems that now it will never return -1 now. So just use > > g_canonicalize_file() > > to

Re: How to hot plugin a new vhost-user-blk-pci device to running VM?

2021-06-04 Thread Peter Krempa
On Fri, Jun 04, 2021 at 19:22:31 +0800, 梁朝军 wrote: > Hi Guys: > > Who can help me ? What does this issue mean? When I attach a network I hit > this issue. > > libvirt: QEMU Driver error : internal error: unable to execute QEMU command > 'netdev_add': Invalid parameter type for 'vhost',

Re: [PATCH 2/3] virfile: Simplify virFindFileInPath() with g_find_program_in_path()

2021-06-04 Thread Luke Yue
On Fri, 2021-06-04 at 12:26 +0200, Martin Kletzander wrote: > On Mon, May 31, 2021 at 09:48:23AM +0800, Luke Yue wrote: > > The behavior is a little bit different when using > > g_find_program_in_path(), when the `file` contains a relative path, > > the > > original function would return a

Re: [libvirt PATCH 2/2] docs: add missing docs for some sound devices

2021-06-04 Thread Peter Krempa
On Fri, Jun 04, 2021 at 12:12:35 +0100, Daniel P. Berrangé wrote: > Closes: https://gitlab.com/libvirt/libvirt/-/issues/173 > Signed-off-by: Daniel P. Berrangé > --- > docs/formatdomain.rst | 16 +--- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git

Re: How to hot plugin a new vhost-user-blk-pci device to running VM?

2021-06-04 Thread 梁朝军
Hi Guys: Who can help me ? What does this issue mean? When I attach a network I hit this issue. libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'netdev_add': Invalid parameter type for 'vhost', expected: boolean Thanks! > 在 2021年5月24日,下午7:08,Daniel P. Berrangé

Re: [libvirt PATCH 1/2] docs: tweak heading name for element

2021-06-04 Thread Peter Krempa
On Fri, Jun 04, 2021 at 12:12:34 +0100, Daniel P. Berrangé wrote: > The element is configuring exclusively a backend, not a device. > > Signed-off-by: Daniel P. Berrangé > --- > docs/formatdomain.rst | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Peter Krempa

[libvirt PATCH 2/2] docs: add missing docs for some sound devices

2021-06-04 Thread Daniel P . Berrangé
Closes: https://gitlab.com/libvirt/libvirt/-/issues/173 Signed-off-by: Daniel P. Berrangé --- docs/formatdomain.rst | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index c18d802f18..89f677048d 100644 ---

[libvirt PATCH 1/2] docs: tweak heading name for element

2021-06-04 Thread Daniel P . Berrangé
The element is configuring exclusively a backend, not a device. Signed-off-by: Daniel P. Berrangé --- docs/formatdomain.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index afee69ac97..c18d802f18 100644 ---

[libvirt PATCH 0/2] docs: small fixes to audio docs

2021-06-04 Thread Daniel P . Berrangé
Daniel P. Berrangé (2): docs: tweak heading name for element docs: add missing docs for some sound devices docs/formatdomain.rst | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) -- 2.31.1

Re: [PATCH 3/3] virfile: Use g_canonicalize_file() to simplify virFileAbsPath()

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 09:48:24AM +0800, Luke Yue wrote: Though the comment says that the function may return -1 on error, but it seems that now it will never return -1 now. So just use g_canonicalize_file() to simplify the implementation. Yeah, that is a leftover from before we started

Re: [PATCH 2/3] virfile: Simplify virFindFileInPath() with g_find_program_in_path()

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 09:48:23AM +0800, Luke Yue wrote: The behavior is a little bit different when using g_find_program_in_path(), when the `file` contains a relative path, the original function would return a absolute path, but the g_find_program_in_path() would probably return a relative

Re: [PATCH v2] Add basic driver for the Cloud-Hypervisor

2021-06-04 Thread Daniel P . Berrangé
On Wed, May 12, 2021 at 10:01:31AM -0700, William Douglas wrote: > Cloud-Hypervisor is a KVM virtualization using hypervisor. It > functions similarly to qemu and the libvirt Cloud-Hypervisor driver > uses a very similar structure to the libvirt driver. > > The biggest difference from the libvirt

Re: [PATCH 1/3] virfile: Use g_build_filename() when building paths

2021-06-04 Thread Martin Kletzander
On Mon, May 31, 2021 at 09:48:22AM +0800, Luke Yue wrote: The g_build_filename() would decide which separator to use instead of hardcoding in g_strdup_printf(). Even though most of these are not going to be used on that wide range of platforms, it is still nice to be consistent and

Re: [libvirt PATCH 7/7] virsh: add nodedev-info

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:56PM -0500, Jonathon Jongsma wrote: > This is currently the only way to view the 'autostart' property for a > node device. > > Signed-off-by: Jonathon Jongsma > --- > docs/manpages/virsh.rst | 12 > tools/virsh-nodedev.c | 68

Re: [libvirt PATCH 6/7] nodedev: Implement virNodeDeviceIsPersistent()/IsActive()

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:55PM -0500, Jonathon Jongsma wrote: > Implement these new API functions in the nodedev driver. > > Signed-off-by: Jonathon Jongsma > --- > src/node_device/node_device_driver.c | 50 > src/node_device/node_device_driver.h | 6 >

Re: [libvirt PATCH 5/7] api: add virNodeDeviceIsPersistent()/IsActive()

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:54PM -0500, Jonathon Jongsma wrote: > These two public APIs are implemented for almost all other objects that > have a concept of persistent definition and activatability. Now that we > have node devices (mdevs) that can be defined and inactive, it will be > useful to

Re: [libvirt PATCH 4/7] virsh: add nodedev-autostart

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:53PM -0500, Jonathon Jongsma wrote: > Add ability to set node devices to autostart on boot or parent device > availability. > > Signed-off-by: Jonathon Jongsma > --- > docs/manpages/virsh.rst | 15 + > tools/virsh-nodedev.c | 71

Re: [libvirt PATCH 3/7] nodedev: Add tests for mdevctl autostart command

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:52PM -0500, Jonathon Jongsma wrote: > Signed-off-by: Jonathon Jongsma > --- > .../nodedevmdevctldata/mdevctl-autostart.argv | 8 +++ > tests/nodedevmdevctltest.c| 54 +++ > 2 files changed, 62 insertions(+) > create mode 100644

Re: [libvirt PATCH 1/7] api: add virNodeDevice(Get|Set)Autostart()

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:50PM -0500, Jonathon Jongsma wrote: > This will allow persistent mediated devices to be configured to be > restarted automatically when the host reboots. > > Signed-off-by: Jonathon Jongsma > --- > include/libvirt/libvirt-nodedev.h | 6 +++ > src/driver-nodedev.h

Re: [libvirt PATCH 2/7] nodedev: implement virNodeDevice(Get|Set)Autostart()

2021-06-04 Thread Daniel P . Berrangé
On Thu, Jun 03, 2021 at 03:11:51PM -0500, Jonathon Jongsma wrote: > Implement autostart functionality for mediated devices. > > Signed-off-by: Jonathon Jongsma > --- > src/conf/virnodedeviceobj.c | 16 > src/conf/virnodedeviceobj.h | 6 ++ > src/libvirt_private.syms