[libvirt] [glib PATCH 0/3] Add ich9 sound device + _domain_os_get_machine()
by Fabiano Fidêncio
The first patch is needed to properly support Q35 machine type on GNOME
Boxes (or any other app using libvirt-glib) as the ICH9 audio device
should be used together with Q35 machine type,
The second patch is mostly a convenience for the apps and the third one
just adds a test case for the second.
Fabiano Fidêncio (3):
gconfig-domain-sound: Add ich9 sound device
gconfig: add _domain_os_get_machine()
tests: Add testes for _domain_os_{set,get}_machine()
libvirt-gconfig/libvirt-gconfig-domain-os.c | 7 +++++++
libvirt-gconfig/libvirt-gconfig-domain-os.h | 1 +
libvirt-gconfig/libvirt-gconfig-domain-sound.h | 3 ++-
libvirt-gconfig/libvirt-gconfig.sym | 1 +
tests/test-gconfig.c | 2 ++
tests/xml/gconfig-domain-os.xml | 2 +-
6 files changed, 14 insertions(+), 2 deletions(-)
--
2.19.1
6 years, 1 month
[libvirt] [PATCH v2 1/2] add nodeset='all' for interleave mode
by Peng Hao
sometimes we hoped that the memory of vm can be evenly distributed in
all nodes according to interleave mode. But different hosts
has different node number. So we add nodeset='all' for interleave mode.
Signed-off-by: Peng Hao <peng.hao2(a)zte.com.cn>
---
src/conf/numa_conf.c | 77 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 64 insertions(+), 13 deletions(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 97a3ca4..a336a62 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -29,6 +29,9 @@
#include "virnuma.h"
#include "virstring.h"
+#if WITH_NUMACTL
+#include <numa.h>
+#endif
/*
* Distance definitions defined Conform ACPI 2.0 SLIT.
* See include/linux/topology.h
@@ -66,6 +69,7 @@ typedef virDomainNumaNode *virDomainNumaNodePtr;
struct _virDomainNuma {
struct {
bool specified;
+ bool allnode;
virBitmapPtr nodeset;
virDomainNumatuneMemMode mode;
virDomainNumatunePlacement placement;
@@ -259,13 +263,21 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa,
tmp = virXMLPropString(node, "nodeset");
if (tmp) {
- if (virBitmapParse(tmp, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
- goto cleanup;
-
- if (virBitmapIsAllClear(nodeset)) {
+ if (STREQ(tmp, "all") && !virNumaIsAvailable()) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Invalid value of 'nodeset': %s"), tmp);
+ _("Invalid nodeset=%s when numactl is not supported"), tmp);
goto cleanup;
+ } else if (STREQ(tmp, "all") && virNumaIsAvailable()) {
+ numa->memory.allnode = true;
+ } else {
+ if (virBitmapParse(tmp, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
+ goto cleanup;
+
+ if (virBitmapIsAllClear(nodeset)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Invalid value of 'nodeset': %s"), tmp);
+ goto cleanup;
+ }
}
VIR_FREE(tmp);
@@ -319,10 +331,14 @@ virDomainNumatuneFormatXML(virBufferPtr buf,
virBufferAsprintf(buf, "<memory mode='%s' ", tmp);
if (numatune->memory.placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC) {
- if (!(nodeset = virBitmapFormat(numatune->memory.nodeset)))
- return -1;
- virBufferAsprintf(buf, "nodeset='%s'/>\n", nodeset);
- VIR_FREE(nodeset);
+ if (numatune->memory.allnode == true) {
+ virBufferAddLit(buf, "nodeset='all'/>\n");
+ } else {
+ if (!(nodeset = virBitmapFormat(numatune->memory.nodeset)))
+ return -1;
+ virBufferAsprintf(buf, "nodeset='%s'/>\n", nodeset);
+ VIR_FREE(nodeset);
+ }
} else if (numatune->memory.placement) {
tmp = virDomainNumatunePlacementTypeToString(numatune->memory.placement);
virBufferAsprintf(buf, "placement='%s'/>\n", tmp);
@@ -489,6 +505,37 @@ virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune,
return 0;
}
+#if WITH_NUMACTL
+static int
+makeAllnodeBitmap(virDomainNumaPtr numa)
+{
+ size_t i = 0, maxnode = 0;
+ virBitmapPtr bitmap = NULL;
+
+ if ((bitmap = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN)) == NULL)
+ return -1;
+ virBitmapClearAll(bitmap);
+ maxnode = numa_max_node();
+ for (i = 0; i <= maxnode; i++) {
+ if (virBitmapSetBit(bitmap, i) < 0) {
+ virBitmapFree(bitmap);
+ return -1;
+ }
+ }
+
+ virBitmapFree(numa->memory.nodeset);
+ numa->memory.nodeset = bitmap;
+
+ return 0;
+}
+#else
+static int
+makeAllnodeBitmap(virDomainNumaPtr numa)
+{
+ return -1;
+}
+#endif
+
int
virDomainNumatuneSet(virDomainNumaPtr numa,
bool placement_static,
@@ -538,20 +585,28 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
}
if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_DEFAULT) {
- if (numa->memory.nodeset || placement_static)
+ if (numa->memory.nodeset || placement_static || numa->memory.allnode)
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC;
else
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO;
}
if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC &&
- !numa->memory.nodeset) {
+ !numa->memory.nodeset && !numa->memory.allnode) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("nodeset for NUMA memory tuning must be set "
"if 'placement' is 'static'"));
goto cleanup;
}
+ if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC &&
+ mode == VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE &&
+ numa->memory.allnode && virNumaIsAvailable()) {
+
+ if (makeAllnodeBitmap(numa) < 0)
+ goto cleanup;
+ }
+
/* setting nodeset when placement auto is invalid */
if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO &&
numa->memory.nodeset) {
--
1.8.3.1
6 years, 1 month
Re: [libvirt] [Qemu-devel] [PATCH v2 0/3] HMP/snapshot changes - do not use ID anymore
by Markus Armbruster
Cc: libvir-list for review of the compatibility argument below.
Daniel Henrique Barboza <danielhb413(a)gmail.com> writes:
> Hey David,
>
> On 9/21/18 9:29 AM, Dr. David Alan Gilbert wrote:
>> * Daniel Henrique Barboza (danielhb413(a)gmail.com) wrote:
>>> changes in v2:
>>> - removed the "RFC" marker;
>>> - added a new patch (patch 2) that removes
>>> bdrv_snapshot_delete_by_id_or_name from the code;
>>> - made changes in patch 1 as suggested by Murilo;
>>> - previous patch set link:
>>> https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg04658.html
>>>
>>>
>>> It is not uncommon to see bugs being opened by testers that attempt to
>>> create VM snapshots using HMP. It turns out that "0" and "1" are quite
>>> common snapshot names and they trigger a lot of bugs. I gave an example
>>> in the commit message of patch 1, but to sum up here: QEMU treats the
>>> input of savevm/loadvm/delvm sometimes as 'ID', sometimes as 'name'. It
>>> is documented as such, but this can lead to strange situations.
>>>
>>> Given that it is strange for an API to consider a parameter to be 2 fields
>>> at the same time, and inadvently treating them as one or the other, and
>>> that removing the ID field is too drastic, my idea here is to keep the
>>> ID field for internal control, but do not let the user set it.
>>>
>>> I guess there's room for discussion about considering this change an API
>>> change or not. It doesn't affect users of HMP and it doesn't affect Libvirt,
>>> but simplifying the meaning of the parameters of savevm/loadvm/delvm.
>> Can you clarify a couple of things:
>> a) What is it about libvirt's use that means it's OK ? Does it never
>> use numeric tags?
>
> I am glad you asked because my understanding in how Libvirt was dealing
> with snapshots was wrong, and I just looked into it further to answer your
> question. Luckily, this series fixes the situation for Libvirt as well.
>
> I was misled by the fact that Libvirt does not show the same symptoms
> we see in
> QEMU of this problem, but the bug is there. Here's a quick test with
> Libvirt with
> "0" and "1" as snapshot names, considering a VM named with no snapshots,
> using QEMU 2.12 and Libvirt 4.0.0:
>
> - create the "0" snapshot:
>
> $ sudo virsh snapshot-create-as --name 0 dhb
> Domain snapshot 0 created
>
> $ sudo virsh snapshot-list dhb
> Name Creation Time State
> ------------------------------------------------------------
> 0 2018-09-24 15:47:56 -0400 running
>
> $ sudo virsh qemu-monitor-command dhb --hmp info snapshots
> List of snapshots present on all disks:
> ID TAG VM SIZE DATE VM CLOCK
> -- 0 405M 2018-09-24 15:47:56 00:04:20.867
>
>
> - created the "1" snapshot. Here, Libvirt shows both snapshots with
> snapshot-list,
> but the snapshot was erased inside QEMU:
>
> $ sudo virsh snapshot-create-as --name 1 dhb
> Domain snapshot 1 created
> $
> $ sudo virsh snapshot-list dhb
> Name Creation Time State
> ------------------------------------------------------------
> 0 2018-09-24 15:47:56 -0400 running
> 1 2018-09-24 15:50:09 -0400 running
>
> $ sudo virsh qemu-monitor-command dhb --hmp info snapshots
> List of snapshots present on all disks:
> ID TAG VM SIZE DATE VM CLOCK
> -- 1 404M 2018-09-24 15:50:10 00:05:36.226
>
>
> This is where I stopped checking out Libvirt at first, concluding
> wrongly that it
> was immune to the bug.
>
> Libvirt does not throw an error when trying to apply snapshot 0. In
> fact, it acts
> like everything went fine:
>
> $ sudo virsh snapshot-revert dhb 0
>
> $ echo $?
> 0
Is that a libvirt bug?
> Reverting back to snapshot "1" works as intended, restoring the VM
> state when it
> was created.
>
>
> (perhaps this is something we should let Libvirt be aware of ...)
>
>
>
> This series fixes this behavior because the snapshot 0 isn't erased
> from QEMU, allowing
> Libvirt to successfully restore it.
>
>
>> b) After this series are you always guaranteed to be able to fix
>> any existing oddly named snapshots?
>
> The oddly named snapshots that already exists can be affected by the
> semantic
> change in loadvm and delvm, in a way that the user can't load/del
> using the snap
> ID, just the tag. Aside from that, I don't see any side effects with
> existing
> snapshots and this patch series.
Do all snapshots have a tag that is unique within their image? Even
snapshots created by old versions of QEMU?
6 years, 1 month
[libvirt] [PATCH] virfiletest: Load mock on Linux only
by Michal Privoznik
The mock is built on Linux only. Therefore we should load it only
on Linux too. This fixes the FreeBSD build.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/virfiletest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/virfiletest.c b/tests/virfiletest.c
index d5102b1cc4..1f2be74c8d 100644
--- a/tests/virfiletest.c
+++ b/tests/virfiletest.c
@@ -460,4 +460,8 @@ mymain(void)
return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
+#ifdef __linux__
VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virfilemock.so")
+#else
+VIR_TEST_MAIN(mymain)
+#endif
--
2.18.0
6 years, 1 month
[libvirt] [PATCH 00/30] syntax: Remove spaces after casts
by Martin Kletzander
According to previous discussions it looks like this is the preferred way
of casting. One difference to the previous one is that this time I
tuned the regexp a bit so that it doesn't match some macros and
assignments and it also matches structs.
Feel free to require squashing of some small patches together.
Martin Kletzander (30):
examples/: Remove spaces after casts
access/: Remove spaces after casts
admin/: Remove spaces after casts
conf/: Remove spaces after casts
cpu/: Remove spaces after casts
esx/: Remove spaces after casts
hyperv/: Remove spaces after casts
libxl/: Remove spaces after casts
locking/: Remove spaces after casts
lxc/: Remove spaces after casts
network/: Remove spaces after casts
nwfilter/: Remove spaces after casts
phyp/: Remove spaces after casts
qemu/: Remove spaces after casts
remote/: Remove spaces after casts
rpc/: Remove spaces after casts
security/: Remove spaces after casts
storage/: Remove spaces after casts
test/: Remove spaces after casts
uml/: Remove spaces after casts
util/: Remove spaces after casts
vbox/: Remove spaces after casts
vmx/: Remove spaces after casts
vz/: Remove spaces after casts
xenapi/: Remove spaces after casts
xenconfig/: Remove spaces after casts
tests/: Remove spaces after casts
tools/: Remove spaces after casts
Remove spaces after casts in rest of the files
Prohibit space after cast
cfg.mk | 6 +
docs/hacking.html.in | 9 +
examples/object-events/event-test.c | 34 +-
src/access/viraccessdriverpolkit.c | 2 +-
src/admin/admin_remote.c | 54 +--
src/admin/admin_server_dispatch.c | 8 +-
src/conf/cpu_conf.c | 6 +-
src/conf/device_conf.c | 2 +-
src/conf/domain_audit.c | 4 +-
src/conf/domain_conf.c | 88 ++--
src/conf/interface_conf.c | 4 +-
src/conf/network_conf.c | 4 +-
src/conf/nwfilter_params.c | 4 +-
src/conf/storage_conf.c | 48 +-
src/conf/virchrdev.c | 4 +-
src/conf/virnodedeviceobj.c | 4 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 4 +-
src/cpu/cpu_ppc64.c | 4 +-
src/esx/esx_driver.c | 2 +-
src/hyperv/hyperv_driver.c | 8 +-
src/hyperv/hyperv_wmi.c | 24 +-
src/internal.h | 4 +-
src/libvirt-domain.c | 4 +-
src/libvirt-host.c | 2 +-
src/libvirt-lxc.c | 4 +-
src/libvirt-stream.c | 4 +-
src/libxl/libxl_conf.c | 4 +-
src/locking/lock_driver_sanlock.c | 28 +-
src/lxc/lxc_cgroup.c | 2 +-
src/lxc/lxc_controller.c | 4 +-
src/lxc/lxc_domain.c | 4 +-
src/lxc/lxc_driver.c | 4 +-
src/lxc/lxc_monitor.c | 2 +-
src/lxc/lxc_native.c | 4 +-
src/lxc/lxc_process.c | 4 +-
src/network/bridge_driver.c | 4 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 6 +-
src/phyp/phyp_driver.c | 2 +-
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_alias.c | 2 +-
src/qemu/qemu_block.c | 2 +-
src/qemu/qemu_capabilities.c | 20 +-
src/qemu/qemu_command.c | 18 +-
src/qemu/qemu_domain.c | 32 +-
src/qemu/qemu_domain_address.c | 12 +-
src/qemu/qemu_driver.c | 68 +--
src/qemu/qemu_hostdev.c | 2 +-
src/qemu/qemu_hotplug.c | 8 +-
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_monitor_json.c | 4 +-
src/qemu/qemu_parse_command.c | 6 +-
src/qemu/qemu_process.c | 10 +-
src/remote/remote_daemon_dispatch.c | 50 +-
src/remote/remote_daemon_stream.c | 2 +-
src/remote/remote_driver.c | 620 ++++++++++++-------------
src/remote/remote_protocol.x | 18 +-
src/rpc/virnetclientstream.c | 4 +-
src/rpc/virnetserverclient.c | 2 +-
src/rpc/virnetserverprogram.c | 2 +-
src/rpc/virnetsocket.c | 6 +-
src/security/security_apparmor.c | 6 +-
src/security/security_dac.c | 42 +-
src/security/security_selinux.c | 14 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend_fs.c | 2 +-
src/storage/storage_backend_gluster.c | 6 +-
src/storage/storage_backend_logical.c | 2 +-
src/storage/storage_backend_vstorage.c | 6 +-
src/storage/storage_driver.c | 6 +-
src/storage/storage_util.c | 44 +-
src/test/test_driver.c | 4 +-
src/uml/uml_driver.c | 6 +-
src/util/iohelper.c | 2 +-
src/util/viralloc.h | 12 +-
src/util/virarptable.c | 2 +-
src/util/viratomic.h | 14 +-
src/util/virbitmap.c | 4 +-
src/util/virbuffer.c | 2 +-
src/util/vircgroup.c | 10 +-
src/util/vircommand.c | 4 +-
src/util/virdnsmasq.c | 2 +-
src/util/virfdstream.c | 6 +-
src/util/virfile.c | 46 +-
src/util/virfirmware.c | 4 +-
src/util/virhostcpu.c | 2 +-
src/util/virhostmem.c | 8 +-
src/util/viridentity.c | 2 +-
src/util/virjson.c | 4 +-
src/util/virlog.c | 8 +-
src/util/virmacaddr.c | 2 +-
src/util/virmacmap.c | 2 +-
src/util/virnetdev.c | 4 +-
src/util/virnetdevtap.c | 2 +-
src/util/virobject.c | 2 +-
src/util/virpidfile.c | 6 +-
src/util/virpolkit.c | 4 +-
src/util/virprocess.c | 26 +-
src/util/virresctrl.c | 4 +-
src/util/virsexpr.c | 8 +-
src/util/virstoragefile.c | 8 +-
src/util/virstring.c | 14 +-
src/util/virsysinfo.c | 2 +-
src/util/virsystemd.c | 4 +-
src/util/virthreadjob.c | 4 +-
src/util/virthreadpool.c | 4 +-
src/util/virtime.c | 4 +-
src/util/virutil.c | 26 +-
src/util/virutil.h | 6 +-
src/util/virxml.c | 30 +-
src/vbox/vbox_common.c | 4 +-
src/vbox/vbox_tmpl.c | 2 +-
src/vmx/vmx.c | 4 +-
src/vz/vz_utils.h | 2 +-
src/xenapi/xenapi_driver.c | 4 +-
src/xenconfig/xen_common.c | 4 +-
src/xenconfig/xen_xl.c | 2 +-
tests/domaincapstest.c | 4 +-
tests/qemuhotplugtest.c | 2 +-
tests/qemumonitorjsontest.c | 42 +-
tests/qemuxml2argvtest.c | 4 +-
tests/testutils.c | 2 +-
tests/testutils.h | 2 +-
tests/testutilshostcpus.h | 88 ++--
tests/virbitmaptest.c | 4 +-
tests/vircaps2xmltest.c | 2 +-
tests/virfiletest.c | 18 +-
tests/virfilewrapper.c | 2 +-
tests/virhashtest.c | 8 +-
tests/virhostcputest.c | 2 +-
tests/virhostdevtest.c | 2 +-
tests/virpcimock.c | 2 +-
tests/virpcitest.c | 2 +-
tests/virresctrltest.c | 2 +-
tests/virschematest.c | 2 +-
tests/virstoragetest.c | 42 +-
tests/virstringtest.c | 12 +-
tests/virusbmock.c | 2 +-
tools/nss/libvirt_nss.c | 14 +-
tools/virsh-domain-monitor.c | 14 +-
tools/virsh-domain.c | 16 +-
tools/virsh-interface.c | 12 +-
tools/virsh-network.c | 10 +-
tools/virsh-nodedev.c | 14 +-
tools/virsh-nwfilter.c | 6 +-
tools/virsh-pool.c | 36 +-
tools/virsh-secret.c | 6 +-
tools/virsh-util.c | 4 +-
tools/virsh-volume.c | 16 +-
tools/virt-admin.c | 4 +-
tools/vsh.c | 18 +-
152 files changed, 1097 insertions(+), 1082 deletions(-)
--
2.17.0
6 years, 1 month
[libvirt] [PATCH v3] virfile: fix cast-align error
by Bjoern Walk
From: Marc Hartmayer <mhartmay(a)linux.ibm.com>
On s390x the struct member f_type of statsfs is hard coded to 'unsigned
int'. Change virFileIsSharedFixFUSE() to take a 'long long int' and use
a temporary to avoid pointer-casting.
This fixes the following error:
../../src/util/virfile.c:3578:38: error: cast increases required alignment of target type [-Werror=cast-align]
virFileIsSharedFixFUSE(path, (long *) &sb.f_type);
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk(a)linux.ibm.com>
---
src/util/virfile.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 2a7e8710..067ca569 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3466,7 +3466,7 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
static int
virFileIsSharedFixFUSE(const char *path,
- long *f_type)
+ long long *f_type)
{
char *dirpath = NULL;
const char **mounts = NULL;
@@ -3537,6 +3537,7 @@ virFileIsSharedFSType(const char *path,
char *p;
struct statfs sb;
int statfs_ret;
+ long long f_type = 0;
if (VIR_STRDUP(dirpath, path) < 0)
return -1;
@@ -3573,32 +3574,34 @@ virFileIsSharedFSType(const char *path,
return -1;
}
- if (sb.f_type == FUSE_SUPER_MAGIC) {
+ f_type = sb.f_type;
+
+ if (f_type == FUSE_SUPER_MAGIC) {
VIR_DEBUG("Found FUSE mount for path=%s. Trying to fix it", path);
- virFileIsSharedFixFUSE(path, (long *) &sb.f_type);
+ virFileIsSharedFixFUSE(path, &f_type);
}
VIR_DEBUG("Check if path %s with FS magic %lld is shared",
- path, (long long int)sb.f_type);
+ path, f_type);
if ((fstypes & VIR_FILE_SHFS_NFS) &&
- (sb.f_type == NFS_SUPER_MAGIC))
+ (f_type == NFS_SUPER_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_GFS2) &&
- (sb.f_type == GFS2_MAGIC))
+ (f_type == GFS2_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_OCFS) &&
- (sb.f_type == OCFS2_SUPER_MAGIC))
+ (f_type == OCFS2_SUPER_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_AFS) &&
- (sb.f_type == AFS_FS_MAGIC))
+ (f_type == AFS_FS_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_SMB) &&
- (sb.f_type == SMB_SUPER_MAGIC))
+ (f_type == SMB_SUPER_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_CIFS) &&
- (sb.f_type == CIFS_SUPER_MAGIC))
+ (f_type == CIFS_SUPER_MAGIC))
return 1;
return 0;
--
2.17.0
6 years, 1 month
[libvirt] [PATCH 0/4] Couple of virFileIsShared* fixes
by Michal Privoznik
This patch [1] got me looking into the code. I've found couple of issues
which I'm fixing and also I'm introducing couple of new test cases.
1: https://www.redhat.com/archives/libvir-list/2018-October/msg00513.html
Michal Prívozník (4):
virfiletest: Fix test name prefix for virFileInData test
virfiletst: Test virFileIsSharedFS
virFileIsSharedFSType: Detect direct mount points
virfile: Rework virFileIsSharedFixFUSE
src/util/virfile.c | 66 ++++++---------
tests/Makefile.am | 7 +-
tests/virfiledata/mounts3.txt | 35 ++++++++
tests/virfilemock.c | 154 ++++++++++++++++++++++++++++++++++
tests/virfiletest.c | 64 +++++++++++++-
5 files changed, 284 insertions(+), 42 deletions(-)
create mode 100644 tests/virfiledata/mounts3.txt
create mode 100644 tests/virfilemock.c
--
2.18.0
6 years, 1 month
[libvirt] [OCaml] Reset of the libvirt-ocaml repository
by Pino Toscano
Hi libvirt developers and users,
TL;DR: you need to clone again the libvirt-ocaml repository, if you had
one already
Due to the way the repository was converted from another SCM in the
past, some of the metadata of older commits was broken, and this made
the repository unusable with more strict git configurations (e.g. as
used on GitHub). You can read more details about this in
https://www.redhat.com/archives/libvir-list/2018-September/msg00214.html
The ocaml-libvirt repository from Rich Jones' website was fixed, and
replaced the existing libvirt-ocaml on libvirt.org. The libvirt-ocaml
repository is the official home now (or again) for the OCaml bindings
of libvirt.
This means that you need to clone again the libvirt-ocaml repository,
in case you had already a clone of this repository. In case you had
pending work on it, make sure to carry it over from an old clone to a
newer clone.
As usual, if you have patches for libvirt-ocaml, feel free to send them
to libvir-list, tagging them as [ocaml].
--
Pino Toscano
6 years, 1 month
[libvirt] [dbus PATCH] maint: fix compiler errors for FreeBSD
by Katerina Koukiou
We were facing such errors:
* error: unused function 'glib_slistautoptr_cleanup_virtDBusConnect
Moving the G_DEFINE_AUTOPTR_CLEANUP_FUNC macros in the header files
fixes the issue.
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
src/connect.c | 3 +--
src/connect.h | 5 +++++
src/network.c | 4 +---
src/network.h | 6 ++++++
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/connect.c b/src/connect.c
index f0da1dd..f8f76a2 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -1995,7 +1995,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
static GDBusInterfaceInfo *interfaceInfo = NULL;
-static void
+void
virtDBusConnectFree(virtDBusConnect *connect)
{
if (connect->connection)
@@ -2011,7 +2011,6 @@ virtDBusConnectFree(virtDBusConnect *connect)
g_free(connect->storageVolPath);
g_free(connect);
}
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virtDBusConnect, virtDBusConnectFree);
void
virtDBusConnectNew(virtDBusConnect **connectp,
diff --git a/src/connect.h b/src/connect.h
index 961b115..829bd57 100644
--- a/src/connect.h
+++ b/src/connect.h
@@ -44,3 +44,8 @@ virtDBusConnectOpen(virtDBusConnect *connect,
void
virtDBusConnectListFree(virtDBusConnect **connectList);
+
+void
+virtDBusConnectFree(virtDBusConnect *connect);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virtDBusConnect, virtDBusConnectFree);
diff --git a/src/network.c b/src/network.c
index f3d5472..95ecdc7 100644
--- a/src/network.c
+++ b/src/network.c
@@ -3,7 +3,7 @@
#include <libvirt/libvirt.h>
-static void
+void
virtDBusNetworkDHCPLeaseListFree(virNetworkDHCPLeasePtr *leases)
{
for (gint i = 0; leases[i] != NULL; i++)
@@ -12,8 +12,6 @@ virtDBusNetworkDHCPLeaseListFree(virNetworkDHCPLeasePtr *leases)
g_free(leases);
}
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDHCPLeasePtr, virtDBusNetworkDHCPLeaseListFree);
-
static virNetworkPtr
virtDBusNetworkGetVirNetwork(virtDBusConnect *connect,
const gchar *objectPath,
diff --git a/src/network.h b/src/network.h
index fc53b28..0012585 100644
--- a/src/network.h
+++ b/src/network.h
@@ -1,9 +1,15 @@
#pragma once
#include "connect.h"
+#include <libvirt/libvirt.h>
#define VIRT_DBUS_NETWORK_INTERFACE "org.libvirt.Network"
void
virtDBusNetworkRegister(virtDBusConnect *connect,
GError **error);
+
+void
+virtDBusNetworkDHCPLeaseListFree(virNetworkDHCPLeasePtr *leases);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDHCPLeasePtr, virtDBusNetworkDHCPLeaseListFree);
--
2.17.1
6 years, 1 month