[libvirt] [PATCH 0/2] Add alias support in sub-commands of virsh
by Han Han
Support to set alias with --alias in virsh attach-disk and
attach-interface.
Han Han (2):
virsh: Support alias in attach-disk
virsh: Support alias in attach-interface
tools/virsh-domain.c | 30 ++++++++++++++++++++++++++++--
tools/virsh.pod | 7 +++++--
2 files changed, 33 insertions(+), 4 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] util: remove unused variable inside virFileReadValueString().
by Julio Faracco
The commit 69b937f0358 introduced VIR_AUTOFREE and this macro removed
VIR_FREE. This change showed that 'str' variable was not being used
inside this method. This commit removes this unused variable.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/util/virfile.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 6b94885a87..1faeebbdb5 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -4228,7 +4228,6 @@ int
virFileReadValueString(char **value, const char *format, ...)
{
int ret;
- VIR_AUTOFREE(char *) str = NULL;
VIR_AUTOFREE(char *) path = NULL;
va_list ap;
--
2.17.1
6 years, 5 months
[libvirt] [PATCH v4 00/31] use GNU C's cleanup attribute in src/util (batch I)
by Sukrit Bhatnagar
This series of patches first introduces a new set of macros which help
in using GNU C's __attribute__((cleanup)) in the code.
Then a few syntax-check rules are added which help in ensuring correct
usage of the newly introduced cleanup macros.
Then the patches modify a few files in src/util to use VIR_AUTOFREE
and VIR_AUTOPTR for automatic freeing of memory and get rid of some
VIR_FREE macro invocations and *Free function calls.
Sukrit Bhatnagar (31):
util: alloc: add macros for implementing automatic cleanup
functionality
cfg.mk: variable initialization when declared with cleanup macro
util: string: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: command: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: command: remove redundant include directive
util: command: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: command: use VIR_AUTOPTR for aggregate types
util: file: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: file: remove redundant include directive
util: file: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: file: use VIR_AUTOPTR for aggregate types
util: authconfig: define cleanup function using
VIR_DEFINE_AUTOPTR_FUNC
util: authconfig: remove redundant include directive
util: authconfig: use VIR_AUTOFREE instead of VIR_FREE for scalar
types
util: auth: remove redundant include directive
util: auth: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: auth: use VIR_AUTOPTR for aggregate types
util: json: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: json: remove redundant include directive
util: json: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: json: use VIR_AUTOPTR for aggregate types
util: bitmap: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
util: bitmap: remove redundant include directive
util: bitmap: use VIR_AUTOPTR for aggregate types
util: iohelper: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: arptable: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: audit: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: fcp: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: eventpoll: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: filecache: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: identity: use VIR_AUTOFREE instead of VIR_FREE for scalar types
cfg.mk | 11 ++
src/util/iohelper.c | 4 +-
src/util/viralloc.h | 42 ++++++
src/util/virarptable.c | 14 +-
src/util/viraudit.c | 3 +-
src/util/virauth.c | 61 +++------
src/util/virauthconfig.c | 35 ++---
src/util/virauthconfig.h | 3 +
src/util/virbitmap.c | 8 +-
src/util/virbitmap.h | 3 +
src/util/vircommand.c | 51 +++-----
src/util/vircommand.h | 2 +
src/util/vireventpoll.c | 7 +-
src/util/virfcp.c | 20 +--
src/util/virfile.c | 327 ++++++++++++++++-------------------------------
src/util/virfile.h | 3 +
src/util/virfilecache.c | 35 ++---
src/util/viridentity.c | 52 ++++----
src/util/virjson.c | 68 +++-------
src/util/virjson.h | 3 +
src/util/virstring.h | 5 +
21 files changed, 292 insertions(+), 465 deletions(-)
--
1.8.3.1
6 years, 5 months
[libvirt] [PATCH 0/4] Fix and improve hugepage code
by Pavel Hrdina
Pavel Hrdina (4):
tests: Add additional hugepage tests to cover current state
conf: Move hugepage XML validation check out of qemu_command
conf: Move hugepages validation out of XML parser
conf: Introduce virDomainDefPostParseMemtune
src/conf/domain_conf.c | 134 +++++++++++++-----
src/qemu/qemu_command.c | 34 -----
tests/qemuxml2argvdata/hugepages-pages10.args | 26 ++++
tests/qemuxml2argvdata/hugepages-pages10.xml | 30 ++++
tests/qemuxml2argvdata/hugepages-pages9.xml | 31 ++++
.../seclabel-dynamic-none-relabel.xml | 2 +-
tests/qemuxml2argvtest.c | 14 +-
.../qemuxml2xmloutdata/hugepages-pages10.xml | 30 ++++
tests/qemuxml2xmloutdata/hugepages-pages4.xml | 1 -
.../seclabel-dynamic-none-relabel.xml | 2 +-
tests/qemuxml2xmltest.c | 2 +-
11 files changed, 228 insertions(+), 78 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hugepages-pages10.args
create mode 100644 tests/qemuxml2argvdata/hugepages-pages10.xml
create mode 100644 tests/qemuxml2argvdata/hugepages-pages9.xml
create mode 100644 tests/qemuxml2xmloutdata/hugepages-pages10.xml
delete mode 120000 tests/qemuxml2xmloutdata/hugepages-pages4.xml
--
2.17.1
6 years, 5 months
[libvirt] [REPOST PATCHv2 0/2] Alter qemu live/cold device attach algorithm
by John Ferlan
REPOST of:
https://www.redhat.com/archives/libvir-list/2018-June/msg00965.html
Resolves conflicts with commit 5e9b150f and 4ad54a417 (adding @live and
restoring the @action to virDomainDefCompatibleDevice method).
The only change from the previous posting is an update to the commit
message in patch 1 to futher describe why the alteration is being done
and what the comparable is.
John Ferlan (2):
qemu: Check for existing hostdev address for cold attach device
qemu: Use the correct vm def on cold attach
src/qemu/qemu_driver.c | 58 +++++++++++++++++++++++++-------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
--
2.14.4
6 years, 5 months
[libvirt] [PATCH 0/2] Fix libvirt for kernels without DM support
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (2):
virDevMapperGetTargetsImpl: Be tolerant to kernels without DM support
qemu_cgroup: Allow/disallow devmapper control iff available
src/qemu/qemu_cgroup.c | 36 +++++++++++++++++++-----------------
src/util/virdevmapper.c | 8 +++++++-
2 files changed, 26 insertions(+), 18 deletions(-)
--
2.16.4
6 years, 5 months
[libvirt] [PATCH v2] virnetdevtap: Don't crash on !ifname in virNetDevTapInterfaceStats
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1595184
Some domain <interfaces/> do not have a name (because they are
not TAP devices). Therefore, if
virNetDevTapInterfaceStats(net->ifname, ...) is called an instant
crash occurs. In Linux version of the function strlen() is called
over the name and in BSD version STREQ() is called.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
- changed the error message
- fixed check in BSD version
src/util/virnetdevtap.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index bd0710ad2e..3118ca18e8 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -691,6 +691,12 @@ virNetDevTapInterfaceStats(const char *ifname,
FILE *fp;
char line[256], *colon;
+ if (!ifname) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Interface name not provided"));
+ return -1;
+ }
+
fp = fopen("/proc/net/dev", "r");
if (!fp) {
virReportSystemError(errno, "%s",
@@ -768,6 +774,12 @@ virNetDevTapInterfaceStats(const char *ifname,
struct if_data *ifd;
int ret = -1;
+ if (!ifname) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Interface name not provided"));
+ return -1;
+ }
+
if (getifaddrs(&ifap) < 0) {
virReportSystemError(errno, "%s",
_("Could not get interface list"));
--
2.16.4
6 years, 5 months
[libvirt] [PATCH 0/6] tests: qemu: Fix testing QMP commands against the schema
by Peter Krempa
I was trying to add some new commands and made a typo. The tests did not
catch it. I must have messed up something when sending the original
schema validation impl.
Peter Krempa (6):
tests: qemuschema: Fix copy-paste error in function name
tests: qemuschema: Add line break to debug message
tests: qemumonitorutils: Don't crash on wrong monitor command
tests: qemumonitorjson: Raise the necessary debug level for QAPI
schema checks
tests: qemumonitorjson: Fix schema testing of monitor commands
tests: qemumonitorjson: Do QMP schema validation for DO_TEST_GEN
tests/qemumonitorjsontest.c | 10 ++++++----
tests/qemumonitortestutils.c | 3 ++-
tests/testutilsqemuschema.c | 10 +++++-----
3 files changed, 13 insertions(+), 10 deletions(-)
--
2.16.2
6 years, 5 months
[libvirt] [PATCH] virnetdevtap: Don't crash on !ifname in virNetDevTapInterfaceStats
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1595184
Some domain <interfaces/> do not have a name (because they are
not TAP devices). Therefore, if
virNetDevTapInterfaceStats(net->ifname, ...) is called an instant
crash occurs. In Linux version of the function strlen() is called
over the name and in BSD version STREQ() is called.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virnetdevtap.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index bd0710ad2e..2123ffe718 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -691,6 +691,12 @@ virNetDevTapInterfaceStats(const char *ifname,
FILE *fp;
char line[256], *colon;
+ if (!ifname) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Interface not found"));
+ return -1;
+ }
+
fp = fopen("/proc/net/dev", "r");
if (!fp) {
virReportSystemError(errno, "%s",
@@ -781,7 +787,7 @@ virNetDevTapInterfaceStats(const char *ifname,
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
- if (STREQ(ifa->ifa_name, ifname)) {
+ if (STREQ_NULLABLE(ifa->ifa_name, ifname)) {
ifd = (struct if_data *)ifa->ifa_data;
if (swapped) {
stats->tx_bytes = ifd->ifi_ibytes;
--
2.16.4
6 years, 5 months
[libvirt] [jenkins-ci PATCH] guests: Stop using search() as a filter
by Andrea Bolognani
Recent versions of Ansible complain about this, and suggest
to replace 'result|search' with 'result is search'.
Since f17097c7af59, however, we've been including operating
system information in the inventory: this allows us to drop
our use of search() entirely.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/tasks/bootstrap.yml | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/guests/tasks/bootstrap.yml b/guests/tasks/bootstrap.yml
index 24848c8..d7abb86 100644
--- a/guests/tasks/bootstrap.yml
+++ b/guests/tasks/bootstrap.yml
@@ -2,21 +2,19 @@
- name: Bootstrap the pkgng package manager
raw: env ASSUME_ALWAYS_YES=YES pkg bootstrap
when:
- - inventory_hostname|search('freebsd')
+ - package_format == 'pkg'
- name: Bootstrap Ansible
raw: yum install -y python2
when:
- - ( inventory_hostname|search('centos') or
- inventory_hostname|search('fedora') )
+ - package_format == 'rpm'
- name: Bootstrap Ansible
raw: apt-get install -y python
when:
- - ( inventory_hostname|search('debian') or
- inventory_hostname|search('ubuntu') )
+ - package_format == 'deb'
- name: Bootstrap Ansible
raw: pkg install -y python2
when:
- - inventory_hostname|search('freebsd')
+ - package_format == 'pkg'
--
2.17.1
6 years, 5 months