[PATCH] virthreadpool: create threads from the newly expanded workers
by Wei Gong
when the thread pool is dynamically expanded, threads should
not be created from the existing workers; they should be created
from the newly expanded workers
Signed-off-by: Wei Gong <gongwei833x(a)gmail.com>
---
src/util/virthreadpool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c
index d45fa92061..6140b7a0a3 100644
--- a/src/util/virthreadpool.c
+++ b/src/util/virthreadpool.c
@@ -199,7 +199,7 @@ virThreadPoolExpand(virThreadPool *pool, size_t gain, bool priority)
else
name = g_strdup(pool->jobName);
- if (virThreadCreateFull(&(*workers)[i],
+ if (virThreadCreateFull(&(*workers)[*curWorkers - gain + i],
false,
virThreadPoolWorker,
name,
--
2.32.1 (Apple Git-133)
8 months, 1 week
[libvirt PATCH 0/3] qemu: virtiofs: fixes for session mode
by Ján Tomko
Ján Tomko (3):
qemu: virtiofs: do not crash if cgroups are missing
qemu: virtiofs: set correct label when creating the socket
qemu: virtiofs: error out if getting the group or user name fails
src/qemu/qemu_virtiofs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
2.44.0
8 months, 1 week
[PATCH v2] openvz_conf: Use g_autofree
by Rayhan Faizel
Signed-off-by: Rayhan Faizel <rayhan.faizel(a)gmail.com>
---
src/openvz/openvz_conf.c | 60 ++++++++++++----------------------------
1 file changed, 17 insertions(+), 43 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index eab3f748d0..4dbaef356c 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -163,7 +163,7 @@ openvzReadNetworkConf(virDomainDef *def,
{
int ret;
virDomainNetDef *net = NULL;
- char *temp = NULL;
+ g_autofree char *temp = NULL;
char *token, *saveptr = NULL;
/*parse routing network configuration*
@@ -258,12 +258,9 @@ openvzReadNetworkConf(virDomainDef *def,
}
}
- VIR_FREE(temp);
-
return 0;
error:
- VIR_FREE(temp);
virDomainNetDefFree(net);
return -1;
}
@@ -276,7 +273,7 @@ openvzReadFSConf(virDomainDef *def,
int ret;
virDomainFSDef *fs = NULL;
g_autofree char *veid_str = NULL;
- char *temp = NULL;
+ g_autofree char *temp = NULL;
const char *param;
unsigned long long barrier, limit;
@@ -337,11 +334,8 @@ openvzReadFSConf(virDomainDef *def,
VIR_APPEND_ELEMENT(def->fss, def->nfss, fs);
- VIR_FREE(temp);
-
return 0;
error:
- VIR_FREE(temp);
virDomainFSDefFree(fs);
return -1;
}
@@ -351,7 +345,7 @@ static int
openvzReadMemConf(virDomainDef *def, int veid)
{
int ret = -1;
- char *temp = NULL;
+ g_autofree char *temp = NULL;
unsigned long long barrier, limit;
const char *param;
long kb_per_pages;
@@ -411,7 +405,6 @@ openvzReadMemConf(virDomainDef *def, int veid)
ret = 0;
error:
- VIR_FREE(temp);
return ret;
}
@@ -549,7 +542,7 @@ openvzWriteConfigParam(const char * conf_file, const char *param, const char *va
g_autofree char *temp_file = NULL;
int temp_fd = -1;
FILE *fp;
- char *line = NULL;
+ g_autofree char *line = NULL;
size_t line_size = 0;
temp_file = g_strdup_printf("%s.tmp", conf_file);
@@ -586,12 +579,9 @@ openvzWriteConfigParam(const char * conf_file, const char *param, const char *va
if (rename(temp_file, conf_file) < 0)
goto error;
- VIR_FREE(line);
-
return 0;
error:
- VIR_FREE(line);
VIR_FORCE_FCLOSE(fp);
VIR_FORCE_CLOSE(temp_fd);
if (temp_file)
@@ -602,14 +592,13 @@ openvzWriteConfigParam(const char * conf_file, const char *param, const char *va
int
openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value)
{
- char *conf_file;
+ g_autofree char *conf_file = NULL;
int ret;
if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0)
return -1;
ret = openvzWriteConfigParam(conf_file, param, value);
- VIR_FREE(conf_file);
return ret;
}
@@ -622,7 +611,7 @@ openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value)
int
openvzReadConfigParam(const char *conf_file, const char *param, char **value)
{
- char *line = NULL;
+ g_autofree char *line = NULL;
size_t line_size = 0;
FILE *fp;
int err = 0;
@@ -652,7 +641,6 @@ openvzReadConfigParam(const char *conf_file, const char *param, char **value)
/* keep going - last entry wins */
}
}
- VIR_FREE(line);
VIR_FORCE_FCLOSE(fp);
return err ? -1 : *value ? 1 : 0;
@@ -672,21 +660,20 @@ openvzReadConfigParam(const char *conf_file, const char *param, char **value)
int
openvzReadVPSConfigParam(int vpsid, const char *param, char **value)
{
- char *conf_file;
+ g_autofree char *conf_file = NULL;
int ret;
if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0)
return -1;
ret = openvzReadConfigParam(conf_file, param, value);
- VIR_FREE(conf_file);
return ret;
}
static int
openvz_copyfile(char* from_path, char* to_path)
{
- char *line = NULL;
+ g_autofree char *line = NULL;
size_t line_size = 0;
FILE *fp;
int copy_fd;
@@ -715,12 +702,9 @@ openvz_copyfile(char* from_path, char* to_path)
if (VIR_CLOSE(copy_fd) < 0)
goto error;
- VIR_FREE(line);
-
return 0;
error:
- VIR_FREE(line);
VIR_FORCE_FCLOSE(fp);
VIR_FORCE_CLOSE(copy_fd);
return -1;
@@ -734,10 +718,10 @@ openvz_copyfile(char* from_path, char* to_path)
int
openvzCopyDefaultConfig(int vpsid)
{
- char *confdir = NULL;
- char *default_conf_file = NULL;
- char *configfile_value = NULL;
- char *conf_file = NULL;
+ g_autofree char *confdir = NULL;
+ g_autofree char *default_conf_file = NULL;
+ g_autofree char *configfile_value = NULL;
+ g_autofree char *conf_file = NULL;
int ret = -1;
if (openvzReadConfigParam(VZ_CONF_FILE, "CONFIGFILE", &configfile_value) < 0)
@@ -758,10 +742,6 @@ openvzCopyDefaultConfig(int vpsid)
ret = 0;
cleanup:
- VIR_FREE(confdir);
- VIR_FREE(default_conf_file);
- VIR_FREE(configfile_value);
- VIR_FREE(conf_file);
return ret;
}
@@ -771,7 +751,7 @@ openvzCopyDefaultConfig(int vpsid)
static int
openvzLocateConfFileDefault(int vpsid, char **conffile, const char *ext)
{
- char *confdir;
+ g_autofree char *confdir = NULL;
int ret = 0;
confdir = openvzLocateConfDir();
@@ -780,7 +760,6 @@ openvzLocateConfFileDefault(int vpsid, char **conffile, const char *ext)
*conffile = g_strdup_printf("%s/%d.%s", confdir, vpsid, ext ? ext : "conf");
- VIR_FREE(confdir);
return ret;
}
@@ -828,8 +807,8 @@ openvz_readline(int fd, char *ptr, int maxlen)
static int
openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
{
- char *conf_file;
- char *line = NULL;
+ g_autofree char *conf_file = NULL;
+ g_autofree char *line = NULL;
size_t line_size = 0;
char *saveptr = NULL;
char *uuidbuf;
@@ -868,9 +847,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
}
retval = 0;
cleanup:
- VIR_FREE(line);
VIR_FORCE_FCLOSE(fp);
- VIR_FREE(conf_file);
return retval;
}
@@ -881,7 +858,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
int
openvzSetDefinedUUID(int vpsid, unsigned char *uuid)
{
- char *conf_file;
+ g_autofree char *conf_file = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
FILE *fp = NULL;
int ret = -1;
@@ -912,7 +889,6 @@ openvzSetDefinedUUID(int vpsid, unsigned char *uuid)
ret = 0;
cleanup:
VIR_FORCE_FCLOSE(fp);
- VIR_FREE(conf_file);
return ret;
}
@@ -941,7 +917,7 @@ static int openvzAssignUUIDs(void)
{
g_autoptr(DIR) dp = NULL;
struct dirent *dent;
- char *conf_dir;
+ g_autofree char *conf_dir = NULL;
int vpsid;
char *ext;
int ret = 0;
@@ -951,7 +927,6 @@ static int openvzAssignUUIDs(void)
return -1;
if (virDirOpenQuiet(&dp, conf_dir) < 0) {
- VIR_FREE(conf_dir);
return 0;
}
@@ -964,7 +939,6 @@ static int openvzAssignUUIDs(void)
openvzSetUUID(vpsid);
}
- VIR_FREE(conf_dir);
return ret;
}
--
2.34.1
8 months, 1 week
Re: [PATCH v2] Remove VIR_FREE in favor of g_autofree in some
functions in libvrit-domain.c
by Peter Krempa
On Tue, Mar 12, 2024 at 17:58:08 +0000, m kamal wrote:
> Thanks a lot for the review, Peter.
>
> The first name I used was by mistake, it's the name of my Github profile, Github desktop probably auto-configured it as the global user name for git on my machine. It's in Arabic so it could confuse many non-Unicode-aware programs or protocols. The other name "m kamal" is just a contraction I wrote when I was subscribing to the mailing list from the web UI, I didn't realize it's important.
Technically that is not important as it can be overriden by using a From
line similarly to your first subscription. The only important bit is
what will be recorded in the GIT history, you're free to use any other
version in other communication.
>
> I will change my configured name in the .gitpublish config to be the longer name "Mostafa Mahmoud", that's the first 2 names of my legal name, it appears that most names here are also 2 names. If there is also a way to change my forum name "m kamal" please let me know.a
If by 'forum' you mean the mailing list you should be able to change
that in https://lists.libvirt.org/user-profile/ once you log in.
>
> Sorry for any inconvenience. One last question: After the patch got your approval, is there something on my end to do so that it gets merged? Will it automatically gets picked up by the Gitlab CI pipeline somehow?
Depending on whether you want to test if you configured your environment
propely you can either send a v3 with updated autorship and sign-off, or
just reply with the full format you're intending to use and I can modify
this patch and push it.
Pushing is done by one of the maintainers, which would be me since I've
reviewed it.
8 months, 1 week
[PATCH 0/2] Use g_autofree annotatins instead of VIR_FREE
by Karim Taha
Substitute VIR_FREE with g_autofree annotations in openvz_driver.c and
node_device_driver.c whenever possible.
The remaining instances of VIR_FREE are used to free return values
in case of error.
Kariiem (2):
openvz_driver: use g_autofree instead of VIR_FREE in openvz_driver.c
node_device: use g_autofree instead of VIR_FREE in
node_device_driver.c
src/node_device/node_device_driver.c | 4 +---
src/openvz/openvz_driver.c | 15 ++++-----------
2 files changed, 5 insertions(+), 14 deletions(-)
--
2.44.0
8 months, 1 week
[PATCH 0/2] Use g_autofree instead of VIR_FREE
by Karim Taha
Substiute VIR_FREE with g_autofree annotations in openvz_driver.c and
node_device_driver.c, whenever possbile.
The remaining instances cannot be changed, they are used to free return
values in case of error.
Kariiem (2):
openvz_driver: use g_autofree instead of VIR_FREE in openvz_driver.c
node_device: use g_autofree instead of VIR_FREE in
node_device_driver.c
src/node_device/node_device_driver.c | 4 +---
src/openvz/openvz_driver.c | 15 ++++-----------
2 files changed, 5 insertions(+), 14 deletions(-)
--
2.44.0
8 months, 1 week
Re: [PATCH v2] Remove VIR_FREE in favor of g_autofree in some
functions in libvrit-domain.c
by m kamal
Please advise on what actions (if any) should be taken so that the changes in the patch is merged into main.
Cheers,
Mostafa Mahmoud.
________________________________
From: m kamal <recenum(a)outlook.com>
Sent: Tuesday, March 12, 2024 5:58 PM
To: Peter Krempa <pkrempa(a)redhat.com>
Cc: devel(a)lists.libvirt.org <devel(a)lists.libvirt.org>
Subject: Re: [PATCH v2] Remove VIR_FREE in favor of g_autofree in some functions in libvrit-domain.c
Thanks a lot for the review, Peter.
The first name I used was by mistake, it's the name of my Github profile, Github desktop probably auto-configured it as the global user name for git on my machine. It's in Arabic so it could confuse many non-Unicode-aware programs or protocols. The other name "m kamal" is just a contraction I wrote when I was subscribing to the mailing list from the web UI, I didn't realize it's important.
I will change my configured name in the .gitpublish config to be the longer name "Mostafa Mahmoud", that's the first 2 names of my legal name, it appears that most names here are also 2 names. If there is also a way to change my forum name "m kamal" please let me know.
Sorry for any inconvenience. One last question: After the patch got your approval, is there something on my end to do so that it gets merged? Will it automatically gets picked up by the Gitlab CI pipeline somehow?
Cheers,
Mostafa Mahmoud.
________________________________
From: Peter Krempa <pkrempa(a)redhat.com>
Sent: Tuesday, March 12, 2024 9:57 AM
To: Mostafa <recenum(a)outlook.com>
Cc: devel(a)lists.libvirt.org <devel(a)lists.libvirt.org>
Subject: Re: [PATCH v2] Remove VIR_FREE in favor of g_autofree in some functions in libvrit-domain.c
On Tue, Mar 12, 2024 at 00:11:28 +0200, Mostafa wrote:
The patch looks good now, but you've used multiple names in various
fields over the two postings and the preference in terms of both
authorship and sign-off is to use a full real name
Used previously:
> From: مصطفي محمود كمال الدين <48567303+moste00(a)users.noreply.github.com>
> From: m kamal <recenum(a)outlook.com>
The one in this patch:
> Signed-off-by: Mostafa <recenum(a)outlook.com>
I don't want to assume anything about foreign names, but the last one
looks more like a nickname or given name only.
> ---
> src/libvirt-domain.c | 32 ++++++++------------------------
> 1 file changed, 8 insertions(+), 24 deletions(-)
For the code:
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
8 months, 1 week
[libvirt PATCH 00/12] Add vmx-* features from qemu
by Tim Wiederhake
For rationale, see patch 3 (cpu_map: No longer ignore vmx- features in
sync_qemu_features_i386.py).
Adding features in bunches (one patch per msr index), as this series
is adding ~100 features.
This also adds cpu features "gds-no" and "amx-complex" and brings
libvirt in sync with qemu commit ad6ef0a42e.
Tim Wiederhake (12):
cpu_map: Add missing feature "gds-no"
cpu_map: Add missing feature "amx-complex"
cpu_map: No longer ignore vmx- features in sync_qemu_features_i386.py
cpu_map: Add missing vmx features from MSR 0x480
cpu_map: Add missing vmx features from MSR 0x485
cpu_map: Add missing vmx features from MSR 0x48B
cpu_map: Add missing vmx features from MSR 0x48C
cpu_map: Add missing vmx features from MSR 0x48D
cpu_map: Add missing vmx features from MSR 0x48E
cpu_map: Add missing vmx features from MSR 0x48F
cpu_map: Add missing vmx features from MSR 0x490
cpu_map: Add missing vmx features from MSR 0x491
src/cpu_map/sync_qemu_features_i386.py | 2 +-
src/cpu_map/x86_features.xml | 295 ++++++++++++++++++
.../x86_64-cpuid-Atom-P5362-enabled.xml | 9 +
.../x86_64-cpuid-Atom-P5362-json.xml | 70 +++++
.../x86_64-cpuid-Cooperlake-enabled.xml | 9 +
.../x86_64-cpuid-Cooperlake-json.xml | 71 +++++
.../x86_64-cpuid-Core-i7-8550U-enabled.xml | 9 +
.../x86_64-cpuid-Core-i7-8550U-json.xml | 68 ++++
...86_64-cpuid-Xeon-Platinum-9242-enabled.xml | 9 +
.../x86_64-cpuid-Xeon-Platinum-9242-json.xml | 71 +++++
...-cpuid-baseline-Cooperlake+Cascadelake.xml | 71 +++++
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 68 ++++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 68 ++++
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 68 ++++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 68 ++++
.../domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 +
.../cpu-host-model.x86_64-4.2.0.args | 2 +-
.../cpu-host-model.x86_64-5.0.0.args | 2 +-
.../cpu-host-model.x86_64-latest.args | 2 +-
20 files changed, 960 insertions(+), 4 deletions(-)
--
2.39.2
8 months, 1 week
[PATCH 00/22] qemu: Fix migration from libvirt older than 9.10.0 when vmx is enabled
by Jiri Denemark
This series fixes a migration regression introduced in 9.10.0 release
which added support for a bunch of vmx-* CPU features. Domains with vmx
feature enabled started by libvirt 9.9.0 or older cannot be migrated to
current releases 9.10.0 and newer.
After this series migration works again with libvirt 9.9.0 and older in
both directions. Migration from the affected releases to the fixed
version works as well, but the other direction remains broken unless the
fix is backported.
See patches 1/22 and 4/22 for more details about the issue and the fix.
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/568
Jiri Denemark (22):
cpu: x86: Add support for adding features to existing CPU models
qemu: domain: Check arch in qemuDomainMakeCPUMigratable
conf: cpu: Introduce virCPUDefListFeatures
qemu: domain: Drop added features from migratable CPU
cpu_map: Do not ignore VMX features in sync_qemu_models script
Add vmx-* features to Broadwell*
Add vmx-* features to Cascadelake*
Add vmx-* features to Conroe
Add vmx-* features to Cooperlake
Add vmx-* features to core{,2}duo
Add vmx-* features to Haswell*
Add vmx-* features to Icelake*
Add vmx-* features to IvyBridge*
Add vmx-* features to kvm*
Add vmx-* features to Nehalem*
Add vmx-* features to Penryn
Add vmx-* features to SandyBridge*
Add vmx-* features to SapphireRapids
Add vmx-* features to Skylake*
Add vmx-* features to Snowridge
Add vmx-* features to Westmere*
NEWS: Document the fix for migration or vmx enabled domains
NEWS.rst | 12 ++
src/conf/cpu_conf.c | 24 ++++
src/conf/cpu_conf.h | 3 +
src/cpu/cpu_x86.c | 69 ++++++++++-
src/cpu/cpu_x86.h | 3 +
src/cpu_map/sync_qemu_models_i386.py | 114 +++++++++++++++++-
src/cpu_map/x86_Broadwell-IBRS.xml | 75 ++++++++++++
src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 75 ++++++++++++
src/cpu_map/x86_Broadwell-noTSX.xml | 75 ++++++++++++
src/cpu_map/x86_Broadwell.xml | 75 ++++++++++++
src/cpu_map/x86_Cascadelake-Server-noTSX.xml | 76 ++++++++++++
src/cpu_map/x86_Cascadelake-Server.xml | 74 ++++++++++++
src/cpu_map/x86_Conroe.xml | 26 ++++
src/cpu_map/x86_Cooperlake.xml | 76 ++++++++++++
src/cpu_map/x86_Haswell-IBRS.xml | 73 +++++++++++
src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 73 +++++++++++
src/cpu_map/x86_Haswell-noTSX.xml | 73 +++++++++++
src/cpu_map/x86_Haswell.xml | 73 +++++++++++
src/cpu_map/x86_Icelake-Server-noTSX.xml | 77 ++++++++++++
src/cpu_map/x86_Icelake-Server.xml | 72 +++++++++++
src/cpu_map/x86_IvyBridge-IBRS.xml | 67 ++++++++++
src/cpu_map/x86_IvyBridge.xml | 67 ++++++++++
src/cpu_map/x86_Nehalem-IBRS.xml | 61 ++++++++++
src/cpu_map/x86_Nehalem.xml | 61 ++++++++++
src/cpu_map/x86_Penryn.xml | 29 +++++
src/cpu_map/x86_SandyBridge-IBRS.xml | 63 ++++++++++
src/cpu_map/x86_SandyBridge.xml | 63 ++++++++++
src/cpu_map/x86_SapphireRapids.xml | 77 ++++++++++++
src/cpu_map/x86_Skylake-Client-IBRS.xml | 71 +++++++++++
src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml | 72 +++++++++++
src/cpu_map/x86_Skylake-Client.xml | 71 +++++++++++
src/cpu_map/x86_Skylake-Server-IBRS.xml | 74 ++++++++++++
src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml | 76 ++++++++++++
src/cpu_map/x86_Skylake-Server.xml | 74 ++++++++++++
src/cpu_map/x86_Snowridge.xml | 76 ++++++++++++
src/cpu_map/x86_Westmere-IBRS.xml | 63 ++++++++++
src/cpu_map/x86_Westmere.xml | 63 ++++++++++
src/cpu_map/x86_core2duo.xml | 26 ++++
src/cpu_map/x86_coreduo.xml | 18 +++
src/cpu_map/x86_kvm32.xml | 18 +++
src/cpu_map/x86_kvm64.xml | 20 +++
src/libvirt_private.syms | 2 +
src/qemu/qemu_domain.c | 60 ++++++++-
src/qemu/qemu_domain.h | 4 +-
src/qemu/qemu_migration_cookie.c | 5 +-
45 files changed, 2487 insertions(+), 12 deletions(-)
--
2.44.0
8 months, 1 week