[libvirt PATCH] docs: introduce stubs for new libvirt Go packages
by 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 introduce new packages under a different
namespace, that will have the exact same code, but be tagged with a
different version numbering scheme.
This change proposes:
libvirt.org/go/libvirt
libvirt.org/go/libvirtxml
Note the hyphen is removed so that the import basename matches the
Go package name.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
The corresponding repos exist
https://gitlab.com/libvirt/libvirt-go-module
https://gitlab.com/libvirt/libvirt-go-xml-module
but I'm leaving them empty until we've completed this release, then
I'll populate with content matching 7.4.0, minus the existing tags.
This change should also wait until after the release.
docs/go/libvirt.rst | 13 +++++++++++
docs/go/libvirtxml.rst | 10 ++++++++
docs/go/meson.build | 53 ++++++++++++++++++++++++++++++++++++++++++
docs/meson.build | 1 +
4 files changed, 77 insertions(+)
create mode 100644 docs/go/libvirt.rst
create mode 100644 docs/go/libvirtxml.rst
create mode 100644 docs/go/meson.build
diff --git a/docs/go/libvirt.rst b/docs/go/libvirt.rst
new file mode 100644
index 0000000000..46250691c1
--- /dev/null
+++ b/docs/go/libvirt.rst
@@ -0,0 +1,13 @@
+=======================
+Libvirt Go Language API
+=======================
+
+The `Go <https://golang.org/>`__ package ``libvirt.org/go/libvirt`` provides
+`CGo <https://golang.org/cmd/cgo/>`__ binding from the OS native Libvirt API.
+
+In general the Go representation is a direct 1-1 mapping from native API
+concepts to Go, so the native API documentation should serve as a reference
+for most behaviour.
+
+For details of Go specific behaviour consult the
+`Go package documentation <https://pkg.go.dev/libvirt.org/go/libvirt>`__.
diff --git a/docs/go/libvirtxml.rst b/docs/go/libvirtxml.rst
new file mode 100644
index 0000000000..7583433f56
--- /dev/null
+++ b/docs/go/libvirtxml.rst
@@ -0,0 +1,10 @@
+==========================
+Libvirt Go XML parsing API
+==========================
+
+The `Go <https://golang.org/>`__ package ``libvirt.org/go/libvirtxml`` provides
+annotated Go struct definitions for parsing (and formatting) XML documents used
+with libvirt APIs.
+
+For details of Go specific behaviour consult the
+`Go package documentation <https://pkg.go.dev/libvirt.org/go/libvirtxml>`__.
diff --git a/docs/go/meson.build b/docs/go/meson.build
new file mode 100644
index 0000000000..99fa1b074a
--- /dev/null
+++ b/docs/go/meson.build
@@ -0,0 +1,53 @@
+docs_go_files = [
+ 'libvirt',
+ 'libvirtxml',
+]
+
+html_xslt_gen_xslt = subsite_xsl
+html_xslt_gen_install_dir = docs_html_dir / 'go'
+html_xslt_gen = []
+
+foreach name : docs_go_files
+ rst_file = '@0@.rst'.format(name)
+
+ html_xslt_gen += {
+ 'name': name,
+ 'file': docs_rst2html_gen.process(rst_file),
+ 'source': 'docs/go' / rst_file,
+ }
+endforeach
+
+# keep the XSLT processing code block in sync with docs/meson.build
+
+# --- begin of XSLT processing ---
+
+foreach data : html_xslt_gen
+ html_filename = data['name'] + '.html'
+
+ html_file = custom_target(
+ html_filename,
+ input: data.get('file', data['name'] + '.html.in'),
+ output: html_filename,
+ command: [
+ xsltproc_prog,
+ '--stringparam', 'pagesrc', data.get('source', ''),
+ '--stringparam', 'builddir', meson.build_root(),
+ '--stringparam', 'timestamp', docs_timestamp,
+ '--nonet',
+ html_xslt_gen_xslt,
+ '@INPUT@',
+ ],
+ depends: data.get('depends', []),
+ depend_files: [ page_xsl ],
+ capture: true,
+ install: true,
+ install_dir: html_xslt_gen_install_dir,
+ )
+
+ install_web_deps += html_file
+ install_web_files += html_file.full_path() + ':' + html_xslt_gen_install_dir
+endforeach
+
+html_xslt_gen = []
+
+# --- end of XSLT processing ---
diff --git a/docs/meson.build b/docs/meson.build
index f550629d8e..d7afdbd323 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -296,6 +296,7 @@ html_xslt_gen = []
# --- end of XSLT processing ---
subdir('fonts')
+subdir('go')
subdir('html')
subdir('internals')
subdir('js')
--
2.31.1
3 years, 5 months
[PATCH] qemuProcessSetupDisksTransientSnapshot: Skip enabling transientOverlayCreated flag
by Masayoshi Mizuma
From: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
QEMU_DOMAIN_DISK_PRIVATE(disk)->transientOverlayCreated flag
gets true unexpectedly on qemuProcessSetupDisksTransientSnapshot() when
the disk has <transient shareBacking='yes'> option.
The flag should be enabled on qemuDomainAttachDiskGeneric() after the
overlay setup is completed.
Skip enabling transientOverlayCreated for the disk here.
Fixes: 75871da0ecb8b552f9e304d0f83e216839bbf82d
Signed-off-by: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
---
src/qemu/qemu_process.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9b069fe7ce..c37687f249 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7039,7 +7039,8 @@ qemuProcessSetupDisksTransientSnapshot(virDomainObj *vm,
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDef *domdisk = vm->def->disks[i];
- if (!domdisk->transient)
+ if (!domdisk->transient ||
+ domdisk->transientShareBacking == VIR_TRISTATE_BOOL_YES)
continue;
QEMU_DOMAIN_DISK_PRIVATE(domdisk)->transientOverlayCreated = true;
--
2.27.0
3 years, 5 months
[libvirt PATCH 00/10] remote: various refactoring & bugs for remote driver
by Daniel P. Berrangé
This is in prep for switching to use the modular daemons by default. In
testing that setup I hit a couple of minor bugs.
Daniel P. Berrangé (10):
remote: use absolute path to check for daemons
remote: stop checking for errors from socket allocations
remote: move open flags enum to sockets header
remote: consistently use flags for passing ro/user/autostart props
remote: change socket helper to return full daemon path
remote: don't populate daemon path if autostart is not required
rpc: remove "spawnDaemon" parameter
remote: move proxy/mode defaults after URI parsing
remote: fix regression connecting to remote session daemon
remote: use virtproxyd if no URI is given
src/admin/admin_remote.c | 2 +-
src/locking/lock_driver_lockd.c | 1 -
src/logging/log_manager.c | 1 -
src/lxc/lxc_monitor.c | 2 +-
src/qemu/qemu_migration.c | 3 +-
src/remote/remote_daemon_dispatch.c | 4 +-
src/remote/remote_driver.c | 135 ++++++++++++----------------
src/remote/remote_sockets.c | 95 +++++++++++++-------
src/remote/remote_sockets.h | 15 ++--
src/remote/remote_ssh_helper.c | 16 ++--
src/rpc/virnetclient.c | 5 +-
src/rpc/virnetclient.h | 3 +-
src/rpc/virnetsocket.c | 26 ++----
src/rpc/virnetsocket.h | 3 +-
tests/virnetsockettest.c | 4 +-
15 files changed, 157 insertions(+), 158 deletions(-)
--
2.31.1
3 years, 5 months
Entering freeze for libvirt-7.4.0
by Jiri Denemark
I have just tagged v7.4.0-rc1 in the repository and pushed signed
tarballs and source RPMs to https://libvirt.org/sources/
Please give the release candidate some testing and in case you find a
serious issue which should have a fix in the upcoming release, feel
free to reply to this thread to make sure the issue is more visible.
If you have not done so yet, please update NEWS.rst to document any
significant change you made since the last release.
Thanks,
Jirka
3 years, 5 months
[libvirt PATCH 0/2] Revert mdev autostart support
by Jonathon Jongsma
As Daniel Berrange mentioned, the method of supporting autostart for node
devices was not consistent with other libvirt objects. This patch series
reverts this feature before it gets into a release. I will submit a follow-up
patch soon which adds the feature back with a consistent API.
Jonathon Jongsma (2):
Partial Revert of "tests: nodedevxml2xmltest: test more mdev files"
nodedev: Revert auto-start property for mdevs
docs/formatnode.html.in | 10 ---------
docs/schemas/nodedev.rng | 11 ----------
src/conf/node_device_conf.c | 21 +------------------
src/conf/node_device_conf.h | 12 -----------
src/libvirt_private.syms | 2 --
src/node_device/node_device_driver.c | 7 +------
.../mdevctl-list-multiple.out.xml | 4 ----
tests/nodedevschemadata/mdev_autostart.xml | 10 ---------
tests/nodedevschemadata/mdev_manual.xml | 10 ---------
...v_3627463d_b7f0_4fea_b468_f1da537d301b.xml | 10 +--------
tests/nodedevxml2xmlout/mdev_autostart.xml | 11 ----------
...v_d069d019_36ea_4111_8f0a_8c9a70e21366.xml | 1 -
...v_d2441d39_495e_4243_ad9f_beb3f14c23d9.xml | 1 -
...v_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml | 11 +---------
...v_fedc4916_1ca8_49ac_b176_871d16c13076.xml | 1 -
tests/nodedevxml2xmlout/mdev_manual.xml | 11 ----------
tests/nodedevxml2xmltest.c | 2 --
17 files changed, 4 insertions(+), 131 deletions(-)
delete mode 100644 tests/nodedevschemadata/mdev_autostart.xml
delete mode 100644 tests/nodedevschemadata/mdev_manual.xml
mode change 100644 => 120000 tests/nodedevxml2xmlout/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml
delete mode 100644 tests/nodedevxml2xmlout/mdev_autostart.xml
mode change 100644 => 120000 tests/nodedevxml2xmlout/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml
delete mode 100644 tests/nodedevxml2xmlout/mdev_manual.xml
--
2.31.1
3 years, 5 months
[PATCH for 7.4.0] virCapabilitiesHostNUMAInitReal: Don't jump over cleanup
by Michal Privoznik
In one of my recent commits I've done some renaming. But whilst
doing so I also mistakenly replaced 'goto cleanup' with 'return
-1' in virCapabilitiesHostNUMAInitReal() which was incorrect.
Fixes: fe25224fdaa53bbeceed3ddeef1b3a150665e656
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/capabilities.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 1290c9c15d..2f9a1e7d1f 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -1623,7 +1623,7 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps)
}
if (virCapabilitiesGetNUMADistances(n, &distances, &ndistances) < 0)
- return -1;
+ goto cleanup;
if (virCapabilitiesGetNUMAPagesInfo(n, &pageinfo, &npageinfo) < 0)
goto cleanup;
--
2.31.1
3 years, 5 months
[PATCH] qemuDomainAttachDiskGenericTransient: Add NULL check in case the overlay disk already exists
by Masayoshi Mizuma
From: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
When <transient shareBacking='yes'> is set to a disk and the overlay
disk already exists because of something abnormal, libvirt is terminated
by Segmentation fault.
# virsh start Test0
error: Disconnected from qemu:///system due to end of file
error: Failed to start domain 'Test0'
error: End of file while reading data: Input/output error
Add NULL check for snapdiskdef so that the rollback can work correctly.
Signed-off-by: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
---
src/qemu/qemu_hotplug.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9ff6175dd3..0640cdd9f7 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -695,7 +695,9 @@ qemuDomainAttachDiskGenericTransient(virDomainObj *vm,
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
g_autoptr(virDomainSnapshotDiskDef) snapdiskdef = NULL;
- snapdiskdef = qemuSnapshotGetTransientDiskDef(disk, vm->def->name);
+ if (!(snapdiskdef = qemuSnapshotGetTransientDiskDef(disk, vm->def->name)))
+ return NULL;
+
snapctxt = qemuSnapshotDiskContextNew(1, vm, asyncJob);
if (qemuSnapshotDiskPrepareOne(snapctxt, disk, snapdiskdef,
--
2.27.0
3 years, 5 months
[PATCH V5] libxl: adjust handling of libxl_device_nic objects
by Jim Fehlig
libxl objects are supposed to be initialized and disposed. Adjust
libxlMakeNic to use an already initialized object owned by the caller.
Adjust libxlMakeNicList to initialize the list of objects, before they
are filled by libxlMakeNic. The libxl_domain_config object passed to
libxlMakeNicList is owned by the caller and will be disposed with
libxl_domain_config_dispose, which also disposes embedded objects such
as libxl_device_nic.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_conf.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 91cebf1498..fc4268db01 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1313,8 +1313,6 @@ libxlMakeNic(virDomainDef *def,
return -1;
}
- libxl_device_nic_init(x_nic);
-
virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
/*
@@ -1502,6 +1500,7 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config)
size_t nnics = def->nnets;
libxl_device_nic *x_nics;
size_t i, nvnics = 0;
+ int ret = -1;
x_nics = g_new0(libxl_device_nic, nnics);
@@ -1509,8 +1508,9 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config)
if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
continue;
+ libxl_device_nic_init(&x_nics[nvnics]);
if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics], false))
- goto error;
+ goto out;
/*
* The devid (at least right now) will not get initialized by
* libxl in the setup case but is required for starting the
@@ -1521,18 +1521,14 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config)
nvnics++;
}
+ ret = 0;
+ out:
VIR_SHRINK_N(x_nics, nnics, nnics - nvnics);
d_config->nics = x_nics;
d_config->num_nics = nvnics;
- return 0;
-
- error:
- for (i = 0; i < nnics; i++)
- libxl_device_nic_dispose(&x_nics[i]);
- VIR_FREE(x_nics);
- return -1;
+ return ret;
}
int
--
2.31.1
3 years, 6 months
[PATCH v4] libxl: adjust handling of libxl_device_nic objects
by Olaf Hering
libxl objects are supposed to be initialized and disposed.
Adjust libxlMakeNic to use an already initialized object, it is owned by
the caller.
Adjust libxlMakeNicList to initialize the list of objects, before they
are filled by libxlMakeNic. In case of error the objects are disposed
by libxl_domain_config_dispose.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
src/libxl/libxl_conf.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 2ecbcf6911..c672bafbe9 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1335,8 +1335,6 @@ libxlMakeNic(virDomainDef *def,
return -1;
}
- libxl_device_nic_init(x_nic);
-
virMacAddrGetRaw(&l_nic->mac, x_nic->mac);
/*
@@ -1531,8 +1529,9 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config)
if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
continue;
+ libxl_device_nic_init(&x_nics[nvnics]);
if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics], false))
- goto error;
+ return -1;
/*
* The devid (at least right now) will not get initialized by
* libxl in the setup case but is required for starting the
@@ -1549,12 +1548,6 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config)
d_config->num_nics = nvnics;
return 0;
-
- error:
- for (i = 0; i < nnics; i++)
- libxl_device_nic_dispose(&x_nics[i]);
- VIR_FREE(x_nics);
- return -1;
}
int
3 years, 6 months
[PATCH RESEND v3 0/8] cleanup meson checks for runtime binaries
by Pavel Hrdina
Recent attempt to add a lot of meson options to specify different
runtime paths motivated me enough to cleanup this from meson.
Changes in v3:
- some patches were already pushed
- removed patch that moved virFindFileInPath from testutilsqemu.c
Changes in v2:
- split and rework patch 16/17 to address review comments
- added a new patch to cleanup libvirt.spec.in file
Pavel Hrdina (8):
virfile: introduce virFindFileInPathFull()
qemu_conf: use virFindFileInPathFull for runtime binaries
meson: drop check for runtime binary dependencies
meson: move iscsiadm check into storage_iscsi condition
meson: stop setting runtime binaries defines during compilation
meson: use runtime binaries to only resolve features with "auto" value
meson: optional_programs should be used only for building libvirt
libvirt.spec: drop no longer required build dependencies
libvirt.spec.in | 31 ----
meson.build | 214 +++++++++----------------
src/bhyve/bhyve_command.c | 4 +
src/libvirt_private.syms | 2 +-
src/locking/lock_driver_lockd.c | 12 +-
src/network/bridge_driver.c | 2 +
src/node_device/node_device_driver.c | 2 +
src/qemu/qemu_conf.c | 23 ++-
src/storage/storage_backend_logical.c | 13 ++
src/storage/storage_backend_sheepdog.c | 2 +
src/storage/storage_backend_zfs.c | 3 +
src/storage/storage_util.c | 2 +
src/storage/storage_util.h | 6 +
src/util/virdnsmasq.c | 1 +
src/util/virfile.c | 16 +-
src/util/virfile.h | 5 +-
src/util/virfirewall.h | 4 +
src/util/viriscsi.h | 2 +
src/util/virkmod.h | 3 +
src/util/virnetdevbandwidth.h | 2 +
src/util/virnetdevip.c | 2 +
src/util/virnetdevmidonet.c | 2 +
src/util/virnetdevopenvswitch.c | 2 +
src/util/virnuma.c | 1 +
src/util/virsysinfo.c | 1 +
src/util/virutil.c | 2 +
tests/testutilsqemu.c | 3 +-
tests/virfirewallmock.c | 3 +-
28 files changed, 173 insertions(+), 192 deletions(-)
--
2.31.1
3 years, 6 months