[PATCH] News: Several apparmor improvements at v6.8.0
by jgao
From: jgao <jgao(a)redhat.com>
Add news about apparmor about the improvements.
Signed-off-by: jgao <jgao(a)redhat.com>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 905deba5a8..1db8648536 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -154,6 +154,11 @@ v6.8.0 (2020-10-01)
taking an external snapshot now preserves the cluser size of the original
top image to preserve any performance tuning done on the original image.
+ * apparmor: Several improvements
+
+ Add support for virtiofs filesystem,allowing qemu load old shared objects after
+ upgrades.
+
* **Bug fixes**
* qemu: Various (i)SCSI backed hostdev fixes
--
2.21.3
4 years, 1 month
[PATCH] convert char pointers to use g_autofree
by Ryan Gahagan
From: bschoney <bschoney(a)utexas.edu>
additional conversions to the GLib API in src/util per issue #11.
Please let me know if there are additional changes I should make in the files updated so far.
I intend to submit work on additional files, and I want to be sure the changes so far are correct.
Related issue: https://gitlab.com/libvirt/libvirt/-/issues/11
Signed-off-by: bschoney <bschoney(a)utexas.edu>
---
src/util/vircgroupv1.c | 3 +--
src/util/virhostcpu.c | 4 +---
src/util/virlockspace.c | 6 ++----
src/util/virmacmap.c | 3 +--
src/util/virresctrl.c | 25 ++++++++-----------------
src/util/virsysinfo.c | 9 +++------
6 files changed, 16 insertions(+), 34 deletions(-)
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
index 731e9d61d4..984cd50409 100644
--- a/src/util/vircgroupv1.c
+++ b/src/util/vircgroupv1.c
@@ -1549,7 +1549,7 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
unsigned long long *unevictable)
{
int ret = -1;
- char *stat = NULL;
+ g_autofree char *stat = NULL;
char *line = NULL;
unsigned long long cacheVal = 0;
unsigned long long activeAnonVal = 0;
@@ -1614,7 +1614,6 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
ret = 0;
cleanup:
- VIR_FREE(stat);
return ret;
}
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index c531d65f86..4f6c3390ce 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -87,7 +87,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
int *nparams)
{
const char *sysctl_name;
- long *cpu_times;
+ g_autofree long *cpu_times = NULL;
struct clockinfo clkinfo;
size_t i, j, cpu_times_size, clkinfo_size;
int cpu_times_num, offset, hz, stathz, ret = -1;
@@ -172,8 +172,6 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
ret = 0;
cleanup:
- VIR_FREE(cpu_times);
-
return ret;
}
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index b90e13f506..71d5dfb83e 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -515,7 +515,7 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -538,7 +538,6 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
@@ -547,7 +546,7 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -575,7 +574,6 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c
index f9047d0fb1..e68742de10 100644
--- a/src/util/virmacmap.c
+++ b/src/util/virmacmap.c
@@ -129,7 +129,7 @@ static int
virMacMapLoadFile(virMacMapPtr mgr,
const char *file)
{
- char *map_str = NULL;
+ g_autofree char *map_str = NULL;
virJSONValuePtr map = NULL;
int map_str_len = 0;
size_t i;
@@ -189,7 +189,6 @@ virMacMapLoadFile(virMacMapPtr mgr,
ret = 0;
cleanup:
- VIR_FREE(map_str);
virJSONValueFree(map);
return ret;
}
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index d3087b98c1..1c2d175295 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -709,7 +709,7 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
{
int ret = -1;
int rv = -1;
- char *featurestr = NULL;
+ g_autofree char *featurestr = NULL;
char **features = NULL;
size_t nfeatures = 0;
virResctrlInfoMongrpPtr info_monitor = NULL;
@@ -771,7 +771,6 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
ret = 0;
cleanup:
- VIR_FREE(featurestr);
g_strfreev(features);
VIR_FREE(info_monitor);
return ret;
@@ -1736,7 +1735,7 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
const char *groupname,
virResctrlAllocPtr *alloc)
{
- char *schemata = NULL;
+ g_autofree char *schemata = NULL;
int rv = virFileReadValueString(&schemata,
SYSFS_RESCTRL_PATH "/%s/schemata",
groupname);
@@ -1753,11 +1752,9 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
if (virResctrlAllocParse(resctrl, *alloc, schemata) < 0)
goto error;
- VIR_FREE(schemata);
return 0;
error:
- VIR_FREE(schemata);
virObjectUnref(*alloc);
*alloc = NULL;
return -1;
@@ -2354,8 +2351,8 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc,
const char *machinename)
{
- char *schemata_path = NULL;
- char *alloc_str = NULL;
+ g_autofree char *schemata_path = NULL;
+ g_autofree char *alloc_str = NULL;
int ret = -1;
int lockfd = -1;
@@ -2403,8 +2400,6 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virResctrlUnlock(lockfd);
- VIR_FREE(alloc_str);
- VIR_FREE(schemata_path);
return ret;
}
@@ -2413,8 +2408,8 @@ static int
virResctrlAddPID(const char *path,
pid_t pid)
{
- char *tasks = NULL;
- char *pidstr = NULL;
+ g_autofree char *tasks = NULL;
+ g_autofree char *pidstr = NULL;
int ret = 0;
if (!path) {
@@ -2436,8 +2431,6 @@ virResctrlAddPID(const char *path,
ret = 0;
cleanup:
- VIR_FREE(tasks);
- VIR_FREE(pidstr);
return ret;
}
@@ -2657,8 +2650,8 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
size_t i = 0;
unsigned long long val = 0;
g_autoptr(DIR) dirp = NULL;
- char *datapath = NULL;
- char *filepath = NULL;
+ g_autofree char *datapath = NULL;
+ g_autofree char *filepath = NULL;
struct dirent *ent = NULL;
virResctrlMonitorStatsPtr stat = NULL;
@@ -2737,8 +2730,6 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
ret = 0;
cleanup:
- VIR_FREE(datapath);
- VIR_FREE(filepath);
virResctrlMonitorStatsFree(stat);
return ret;
}
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 217f842a37..e1336bf566 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -532,9 +532,9 @@ static int
virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
{
const char *tmp_base;
- char *manufacturer = NULL;
- char *procline = NULL;
- char *ncpu = NULL;
+ g_autofree char *manufacturer = NULL;
+ g_autofree char *procline = NULL;
+ g_autofree char *ncpu = NULL;
int result = -1;
virSysinfoProcessorDefPtr processor;
@@ -593,9 +593,6 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
result = 0;
error:
- VIR_FREE(manufacturer);
- VIR_FREE(procline);
- VIR_FREE(ncpu);
return result;
}
--
2.29.0
4 years, 1 month
[PATCH] convert char pointers to use g_autofree
by Ryan Gahagan
From: bschoney <bschoney(a)utexas.edu>
additional conversions to the GLib API in src/util per issue #11.
Please let me know if there are additional changes I should make in the files updated so far.
I intend to submit work on additional files, and I want to be sure the changes so far are correct.
Related issue: https://gitlab.com/libvirt/libvirt/-/issues/11
Signed-off-by: bschoney <bschoney(a)utexas.edu>
---
src/util/vircgroupv1.c | 3 +--
src/util/virhostcpu.c | 4 +---
src/util/virlockspace.c | 6 ++----
src/util/virmacmap.c | 3 +--
src/util/virresctrl.c | 25 ++++++++-----------------
src/util/virsysinfo.c | 9 +++------
6 files changed, 16 insertions(+), 34 deletions(-)
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
index 731e9d61d4..984cd50409 100644
--- a/src/util/vircgroupv1.c
+++ b/src/util/vircgroupv1.c
@@ -1549,7 +1549,7 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
unsigned long long *unevictable)
{
int ret = -1;
- char *stat = NULL;
+ g_autofree char *stat = NULL;
char *line = NULL;
unsigned long long cacheVal = 0;
unsigned long long activeAnonVal = 0;
@@ -1614,7 +1614,6 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
ret = 0;
cleanup:
- VIR_FREE(stat);
return ret;
}
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index c531d65f86..4f6c3390ce 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -87,7 +87,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
int *nparams)
{
const char *sysctl_name;
- long *cpu_times;
+ g_autofree long *cpu_times = NULL;
struct clockinfo clkinfo;
size_t i, j, cpu_times_size, clkinfo_size;
int cpu_times_num, offset, hz, stathz, ret = -1;
@@ -172,8 +172,6 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
ret = 0;
cleanup:
- VIR_FREE(cpu_times);
-
return ret;
}
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 2731d46dfc..c88a24be36 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -515,7 +515,7 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -538,7 +538,6 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
@@ -547,7 +546,7 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -575,7 +574,6 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c
index 2d203e72af..70b148acac 100644
--- a/src/util/virmacmap.c
+++ b/src/util/virmacmap.c
@@ -129,7 +129,7 @@ static int
virMacMapLoadFile(virMacMapPtr mgr,
const char *file)
{
- char *map_str = NULL;
+ g_autofree char *map_str = NULL;
virJSONValuePtr map = NULL;
int map_str_len = 0;
size_t i;
@@ -189,7 +189,6 @@ virMacMapLoadFile(virMacMapPtr mgr,
ret = 0;
cleanup:
- VIR_FREE(map_str);
virJSONValueFree(map);
return ret;
}
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index d3087b98c1..1c2d175295 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -709,7 +709,7 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
{
int ret = -1;
int rv = -1;
- char *featurestr = NULL;
+ g_autofree char *featurestr = NULL;
char **features = NULL;
size_t nfeatures = 0;
virResctrlInfoMongrpPtr info_monitor = NULL;
@@ -771,7 +771,6 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
ret = 0;
cleanup:
- VIR_FREE(featurestr);
g_strfreev(features);
VIR_FREE(info_monitor);
return ret;
@@ -1736,7 +1735,7 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
const char *groupname,
virResctrlAllocPtr *alloc)
{
- char *schemata = NULL;
+ g_autofree char *schemata = NULL;
int rv = virFileReadValueString(&schemata,
SYSFS_RESCTRL_PATH "/%s/schemata",
groupname);
@@ -1753,11 +1752,9 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
if (virResctrlAllocParse(resctrl, *alloc, schemata) < 0)
goto error;
- VIR_FREE(schemata);
return 0;
error:
- VIR_FREE(schemata);
virObjectUnref(*alloc);
*alloc = NULL;
return -1;
@@ -2354,8 +2351,8 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc,
const char *machinename)
{
- char *schemata_path = NULL;
- char *alloc_str = NULL;
+ g_autofree char *schemata_path = NULL;
+ g_autofree char *alloc_str = NULL;
int ret = -1;
int lockfd = -1;
@@ -2403,8 +2400,6 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virResctrlUnlock(lockfd);
- VIR_FREE(alloc_str);
- VIR_FREE(schemata_path);
return ret;
}
@@ -2413,8 +2408,8 @@ static int
virResctrlAddPID(const char *path,
pid_t pid)
{
- char *tasks = NULL;
- char *pidstr = NULL;
+ g_autofree char *tasks = NULL;
+ g_autofree char *pidstr = NULL;
int ret = 0;
if (!path) {
@@ -2436,8 +2431,6 @@ virResctrlAddPID(const char *path,
ret = 0;
cleanup:
- VIR_FREE(tasks);
- VIR_FREE(pidstr);
return ret;
}
@@ -2657,8 +2650,8 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
size_t i = 0;
unsigned long long val = 0;
g_autoptr(DIR) dirp = NULL;
- char *datapath = NULL;
- char *filepath = NULL;
+ g_autofree char *datapath = NULL;
+ g_autofree char *filepath = NULL;
struct dirent *ent = NULL;
virResctrlMonitorStatsPtr stat = NULL;
@@ -2737,8 +2730,6 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
ret = 0;
cleanup:
- VIR_FREE(datapath);
- VIR_FREE(filepath);
virResctrlMonitorStatsFree(stat);
return ret;
}
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 217f842a37..e1336bf566 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -532,9 +532,9 @@ static int
virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
{
const char *tmp_base;
- char *manufacturer = NULL;
- char *procline = NULL;
- char *ncpu = NULL;
+ g_autofree char *manufacturer = NULL;
+ g_autofree char *procline = NULL;
+ g_autofree char *ncpu = NULL;
int result = -1;
virSysinfoProcessorDefPtr processor;
@@ -593,9 +593,6 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
result = 0;
error:
- VIR_FREE(manufacturer);
- VIR_FREE(procline);
- VIR_FREE(ncpu);
return result;
}
--
2.29.0
4 years, 1 month
[PATCH 5/5] Fixed error where char** not being promoted to const
by Ryan Gahagan
Signed-off-by: Ryan Gahagan <rgahagan(a)cs.utexas.edu>
---
tools/virsh-domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 8abca1b65e..10ff7175a2 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -227,7 +227,7 @@ static const vshCmdOptDef opts_attach_disk[] = {
{.name = "source-protocol",
.type = VSH_OT_STRING,
.help = N_("protocol used by disk device source")
- }
+ },
{.name = "source-name",
.type = VSH_OT_STRING,
.help = N_("name of disk device source")
@@ -629,7 +629,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
vshCommandOptStringReq(ctl, cmd, "targetbus", &targetbus) < 0 ||
vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0 ||
vshCommandOptStringReq(ctl, cmd, "sourcetype", &stype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-host-name", &host_name) < 0 ||
+ vshCommandOptStringReq(ctl, cmd, "source-host-name", (const char **) &host_name) < 0 ||
vshCommandOptStringReq(ctl, cmd, "source-host-transport", &host_transport) < 0 ||
vshCommandOptStringReq(ctl, cmd, "source-host-socket", &host_socket) < 0)
goto cleanup;
--
2.29.0
4 years, 1 month
[PATCH] qemu: virtiofs: Add pool element to limit thread pool
by Masayoshi Mizuma
From: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
virtiofsd has --thread-pool-size=NUM option to limit the
thread pool size. It will be useful to tune the performance.
Add pool element to use the option like as:
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs' queue='1024'/>
<binary path='/usr/libexec/virtiofsd' xattr='on' pool='32'/>
<source dir='/path'/>
<target dir='mount_tag'/>
</filesystem>
Signed-off-by: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
---
docs/formatdomain.rst | 6 ++++--
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 12 ++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_virtiofs.c | 3 +++
5 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index bfa80e4bc2..0f66af5dc3 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3070,7 +3070,7 @@ A directory on the host that can be accessed directly from the guest.
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs' queue='1024'/>
- <binary path='/usr/libexec/virtiofsd' xattr='on'>
+ <binary path='/usr/libexec/virtiofsd' xattr='on' pool='32'>
<cache mode='always'/>
<lock posix='on' flock='on'/>
</binary>
@@ -3188,7 +3188,9 @@ A directory on the host that can be accessed directly from the guest.
the use of filesystem extended attributes. Caching can be tuned via the
``cache`` element, possible ``mode`` values being ``none`` and ``always``.
Locking can be controlled via the ``lock`` element - attributes ``posix`` and
- ``flock`` both accepting values ``on`` or ``off``. ( :since:`Since 6.2.0` )
+ ``flock`` both accepting values ``on`` or ``off``. ( :since:`Since 6.2.0` ).
+ Thread pool size limit can be tuned via the ``pool`` element.
+ ( :since:`Since 6.9.0` )
``source``
The resource on the host that is being accessed in the guest. The ``name``
attribute must be used with ``type='template'``, and the ``dir`` attribute
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index c25a742581..cd5de2ba80 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2839,6 +2839,11 @@
<ref name="virOnOff"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="pool">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
<optional>
<element name="cache">
<optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index efa5ac527b..9d06f8c75f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11588,6 +11588,7 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
g_autofree char *cache = virXPathString("string(./binary/cache/@mode)", ctxt);
g_autofree char *posix_lock = virXPathString("string(./binary/lock/@posix)", ctxt);
g_autofree char *flock = virXPathString("string(./binary/lock/@flock)", ctxt);
+ g_autofree char *thread_pool_size = virXPathString("string(./binary/@pool)", ctxt);
int val;
if (queue_size && virStrToLong_ull(queue_size, NULL, 10, &def->queue_size) < 0) {
@@ -11597,6 +11598,14 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
goto error;
}
+ if (thread_pool_size &&
+ virStrToLong_ull(thread_pool_size, NULL, 10, &def->thread_pool_size) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("cannot parse thread pool size '%s' for virtiofs"),
+ thread_pool_size);
+ goto error;
+ }
+
if (binary)
def->binary = virFileSanitizePath(binary);
@@ -26191,6 +26200,9 @@ virDomainFSDefFormat(virBufferPtr buf,
virTristateSwitchTypeToString(def->xattr));
}
+ if (def->thread_pool_size)
+ virBufferAsprintf(&binaryAttrBuf, " pool='%llu'", def->thread_pool_size);
+
if (def->cache != VIR_DOMAIN_FS_CACHE_MODE_DEFAULT) {
virBufferAsprintf(&binaryBuf, "<cache mode='%s'/>\n",
virDomainFSCacheModeTypeToString(def->cache));
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cd344716a3..98ab0a51c7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -860,6 +860,7 @@ struct _virDomainFSDef {
bool symlinksResolved;
char *binary;
unsigned long long queue_size;
+ unsigned long long thread_pool_size;
virTristateSwitch xattr;
virDomainFSCacheMode cache;
virTristateSwitch posix_lock;
diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index 2e239cad66..e35c278a1b 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -126,6 +126,9 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfigPtr cfg,
virCommandPassFD(cmd, *fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
*fd = -1;
+ if (fs->thread_pool_size)
+ virCommandAddArgFormat(cmd, "--thread-pool-size=%llu", fs->thread_pool_size);
+
virCommandAddArg(cmd, "-o");
virBufferAddLit(&opts, "source=");
virQEMUBuildBufferEscapeComma(&opts, fs->src->path);
--
2.27.0
4 years, 1 month
[PATCH] lxc: Cleanup after failed startup
by Michal Privoznik
If starting an container fails, the virLXCProcessStop() is
called. But since vm->def->id is not set until libvirt_lxc is
spawned (the domain's ID is PID of that process),
virLXCProcessStop() returns early as virDomainObjIsActive()
returns false. But doing so leaves behind resources reserved for
the containers during the startup process. Most notably, hostdevs
are not re-attached to the host, the domain's transient XML is
not removed, etc.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/lxc/lxc_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index c5a710fc3f..08c82b0e9a 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -855,7 +855,7 @@ int virLXCProcessStop(virLXCDriverPtr driver,
vm->def->name, (int)vm->pid, (int)reason);
if (!virDomainObjIsActive(vm)) {
VIR_DEBUG("VM '%s' not active", vm->def->name);
- return 0;
+ goto cleanup;
}
priv = vm->privateData;
--
2.26.2
4 years, 1 month
[PATCH 0/2] qemu: migration corner case fix and cleanup
by Nikolay Shirokovskiy
Nikolay Shirokovskiy (2):
qemu: fix qemuMigrationSrcCleanup to use qemuMigrationJobFinish
qemu: don't needlessly unset close callback during perform phase
src/qemu/qemu_migration.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
--
1.8.3.1
4 years, 1 month
[PATCH] virGDBusBusInit: Properly check for error when looking up D-Bus address
by Michal Privoznik
The virGDBusBusInit is supposed to return a reference to
requested bus type (system/session) or, if non-shared bus is
requested then create a new bus of the type. As an argument, it
gets a double pointer to GError which is passed to all g_dbus_*()
calls which allocate it on failure. Pretty standard approach.
However, since it is a double pointer we must dereference the
first level to see if the value is NULL. IOW:
if (*error)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virgdbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virgdbus.c b/src/util/virgdbus.c
index 4360a6acff..19fd7e2fe4 100644
--- a/src/util/virgdbus.c
+++ b/src/util/virgdbus.c
@@ -55,7 +55,7 @@ virGDBusBusInit(GBusType type, GError **error)
return g_bus_get_sync(type, NULL, error);
} else {
address = g_dbus_address_get_for_bus_sync(type, NULL, error);
- if (error)
+ if (*error)
return NULL;
return g_dbus_connection_new_for_address_sync(address,
G_DBUS_CONNECTION_FLAGS_NONE,
--
2.26.2
4 years, 1 month
[libvirt PATCH] Revert "Revert "spec: Simplify setting features off by default""
by Andrea Bolognani
As explained in the original commit (31d687a3218c), these values
are actually unaffected by the corresponding _without_* macros
and so we can leave out the additional processing / obfuscation.
This reverts commit ae23a87d85cfc2a964123d9bd44157a411428c0a.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
libvirt.spec.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 84515cc7de..2a4324b974 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -98,14 +98,14 @@
%define with_numactl 0%{!?_without_numactl:1}
# A few optional bits off by default, we enable later
-%define with_fuse 0%{!?_without_fuse:0}
-%define with_sanlock 0%{!?_without_sanlock:0}
-%define with_numad 0%{!?_without_numad:0}
-%define with_firewalld_zone 0%{!?_without_firewalld:0}
-%define with_libssh2 0%{!?_without_libssh2:0}
-%define with_wireshark 0%{!?_without_wireshark:0}
-%define with_libssh 0%{!?_without_libssh:0}
-%define with_dmidecode 0%{!?_without_dmidecode:0}
+%define with_fuse 0
+%define with_sanlock 0
+%define with_numad 0
+%define with_firewalld_zone 0
+%define with_libssh2 0
+%define with_wireshark 0
+%define with_libssh 0
+%define with_dmidecode 0
# Finally set the OS / architecture specific special cases
--
2.26.2
4 years, 1 month
[PATCH v2 00/12] Replace virHashTable by GHashTable
by Peter Krempa
Our hash table API was surprisingly close to glibs.
v2:
- pushed ACK'd patch
- typo fix
- rebased on current master
- hashing function not replaced as our has random initialization
Peter Krempa (12):
virhashtest: testHashGetItems: Remove test case for sorting by value
util: hash: Rewrite sorting of elements in virHashGetItems
util: hash: Introduce virHashForEachSorted
Use virHashForEachSorted in tested code
tests: remove virdeterministichashmock.so
util: hash: Add delete-safe hash iterator
util: hash: Use virHashForEachSafe in places which might delete the
element
util: hash: Don't use 'const' with virHashTablePtr
util: hash: Reimplement virHashTable using GHashTable
util: hash: Retire 'virHashTable' in favor of 'GHashTable'
util: hash: Add deprecation notices for functions which have
g_hash_table replacements
tests: Remove 'virhashtest'
src/conf/backup_conf.c | 2 +-
src/conf/domain_addr.h | 2 +-
src/conf/domain_conf.c | 12 +-
src/conf/domain_conf.h | 2 +-
src/conf/nwfilter_conf.h | 2 +-
src/conf/nwfilter_ipaddrmap.c | 2 +-
src/conf/nwfilter_params.c | 34 +-
src/conf/nwfilter_params.h | 18 +-
src/conf/snapshot_conf.c | 2 +-
src/conf/virchrdev.c | 4 +-
src/conf/virdomainmomentobjlist.c | 4 +-
src/conf/virdomainobjlist.c | 6 +-
src/conf/virinterfaceobj.c | 2 +-
src/conf/virnetworkobj.c | 8 +-
src/conf/virnodedeviceobj.c | 2 +-
src/conf/virnwfilterbindingdef.h | 2 +-
src/conf/virnwfilterbindingobjlist.c | 4 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 14 +-
src/hyperv/hyperv_driver.c | 4 +-
src/hyperv/hyperv_wmi.c | 18 +-
src/hyperv/hyperv_wmi.h | 12 +-
src/hypervisor/virclosecallbacks.c | 2 +-
src/libvirt_private.syms | 2 +
src/libxl/libxl_logger.c | 2 +-
src/locking/lock_daemon.c | 4 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 6 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 19 +-
src/nwfilter/nwfilter_gentech_driver.c | 36 +-
src/nwfilter/nwfilter_gentech_driver.h | 2 +-
src/nwfilter/nwfilter_learnipaddr.c | 4 +-
src/nwfilter/nwfilter_tech_driver.h | 2 +-
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_backup.c | 14 +-
src/qemu/qemu_backup.h | 2 +-
src/qemu/qemu_block.c | 42 +-
src/qemu/qemu_block.h | 18 +-
src/qemu/qemu_blockjob.c | 6 +-
src/qemu/qemu_capabilities.c | 8 +-
src/qemu/qemu_checkpoint.c | 6 +-
src/qemu/qemu_checkpoint.h | 2 +-
src/qemu/qemu_conf.c | 4 +-
src/qemu/qemu_conf.h | 2 +-
src/qemu/qemu_domain.c | 8 +-
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_driver.c | 24 +-
src/qemu/qemu_interop_config.c | 13 +-
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_migration_cookie.c | 2 +-
src/qemu/qemu_monitor.c | 28 +-
src/qemu/qemu_monitor.h | 20 +-
src/qemu/qemu_monitor_json.c | 50 +-
src/qemu/qemu_monitor_json.h | 22 +-
src/qemu/qemu_process.c | 18 +-
src/qemu/qemu_qapi.c | 14 +-
src/qemu/qemu_qapi.h | 6 +-
src/qemu/qemu_snapshot.c | 16 +-
src/rpc/virnetdaemon.c | 13 +-
src/security/security_selinux.c | 2 +-
src/util/virfilecache.c | 2 +-
src/util/virhash.c | 571 ++++++++----------
src/util/virhash.h | 47 +-
src/util/viriptables.c | 4 +-
src/util/virlockspace.c | 4 +-
src/util/virmacmap.c | 4 +-
src/util/virstoragefile.c | 8 +-
src/util/virsystemd.c | 2 +-
tests/meson.build | 2 -
tests/nwfilterxml2firewalltest.c | 24 +-
tests/qemublocktest.c | 26 +-
tests/qemuhotplugtest.c | 6 +-
tests/qemumigparamstest.c | 4 +-
tests/qemumonitorjsontest.c | 30 +-
tests/qemumonitortestutils.c | 6 +-
tests/qemumonitortestutils.h | 4 +-
tests/qemusecuritymock.c | 4 +-
.../blockjob-blockdev-in.xml | 116 ++--
tests/qemuxml2argvtest.c | 4 +-
tests/qemuxml2xmltest.c | 5 +-
tests/testutilsqemu.c | 6 +-
tests/testutilsqemu.h | 4 +-
tests/testutilsqemuschema.c | 10 +-
tests/testutilsqemuschema.h | 8 +-
tests/virdeterministichashmock.c | 36 --
tests/virhashdata.h | 284 ---------
tests/virhashtest.c | 564 -----------------
tests/virmacmaptest.c | 2 +-
87 files changed, 690 insertions(+), 1682 deletions(-)
delete mode 100644 tests/virdeterministichashmock.c
delete mode 100644 tests/virhashdata.h
delete mode 100644 tests/virhashtest.c
--
2.26.2
4 years, 1 month