[libvirt] [PATCH v2] storage_backend_rbd: check the return value of rados_conf_set
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
We forget to check the return value of rados_conf_set.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
v2: add another missing return value check
src/storage/storage_backend_rbd.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 718c4d6..85ff99b 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -159,13 +159,27 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
* Operations in librados will return -ETIMEDOUT when the timeout is reached.
*/
VIR_DEBUG("Setting RADOS option client_mount_timeout to %s", client_mount_timeout);
- rados_conf_set(ptr->cluster, "client_mount_timeout", client_mount_timeout);
+ if (rados_conf_set(ptr->cluster, "client_mount_timeout", client_mount_timeout) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "client_mount_timeout");
+ goto cleanup;
VIR_DEBUG("Setting RADOS option rados_mon_op_timeout to %s", mon_op_timeout);
- rados_conf_set(ptr->cluster, "rados_mon_op_timeout", mon_op_timeout);
+ if (rados_conf_set(ptr->cluster, "rados_mon_op_timeout", mon_op_timeout) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "rados_mon_op_timeout");
+ goto cleanup;
+ }
VIR_DEBUG("Setting RADOS option rados_osd_op_timeout to %s", osd_op_timeout);
- rados_conf_set(ptr->cluster, "rados_osd_op_timeout", osd_op_timeout);
+ if (rados_conf_set(ptr->cluster, "rados_osd_op_timeout", osd_op_timeout) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "rados_osd_op_timeout");
+ goto cleanup;
+ }
/*
* Librbd supports creating RBD format 2 images. We no longer have to invoke
@@ -173,7 +187,12 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
* This leaves us to simply use rbd_create() and use the default behavior of librbd
*/
VIR_DEBUG("Setting RADOS option rbd_default_format to %s", rbd_default_format);
- rados_conf_set(ptr->cluster, "rbd_default_format", rbd_default_format);
+ if (rados_conf_set(ptr->cluster, "rbd_default_format", rbd_default_format) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "rbd_default_format");
+ goto cleanup;
+ }
ptr->starttime = time(0);
if ((r = rados_connect(ptr->cluster)) < 0) {
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH] vsh: Fix the incorrect environment variable prefix in error message
by Erik Skultety
Unlike the other error messages in vshInitDebug, this one relied on a hardcoded
name of a variable instead of using the prefix of the tool calling the init
routine.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1393854
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Pushed under trivial rule.
tools/vsh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index f7ba070..3ba09dd 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -3016,8 +3016,8 @@ vshInitDebug(vshControl *ctl)
int debug;
if (virStrToLong_i(debugEnv, NULL, 10, &debug) < 0 ||
debug < VSH_ERR_DEBUG || debug > VSH_ERR_ERROR) {
- vshError(ctl, "%s",
- _("VSH_DEBUG not set with a valid numeric value"));
+ vshError(ctl, _("%s_DEBUG not set with a valid numeric value"),
+ ctl->env_prefix);
} else {
ctl->debug = debug;
}
--
2.5.5
8 years, 1 month
[libvirt] FOSDEM 2017: Call For Proposals -- Virtualization & IaaS DevRoom
by Kashyap Chamarthy
=======================================================================
The call for proposals is now open for the Virtualization & IaaS devroom
at the upcoming FOSDEM 2017, to be hosted on February 4, 2017.
This year will mark FOSDEM’s 17th anniversary as one of the
longest-running free and open source software developer events,
attracting thousands of developers and users from all over the world.
FOSDEM will be held once again in Brussels, Belgium, on February 4 & 5,
2017.
---------------
Important Dates
---------------
Submission deadline: 18 November 2016
Acceptance notifications: 04 December 2016
Final schedule announcement: 11 December 2016
Devroom: 04 February 2017 (one day)
-----------------
About the Devroom
-----------------
The Virtualization & IaaS devroom will feature session topics such as
open source hypervisors and virtual machine managers such as Xen
Project, KVM, QEMU, bhyve, and VirtualBox, and
Infrastructure-as-a-Service projects such as Apache CloudStack,
OpenStack, oVirt, OpenNebula, and Ganeti.
This devroom will host presentations that focus on topics of shared
interest, such as KVM; libvirt; shared storage; virtualized networking;
cloud security; clustering and high availability; interfacing with
multiple hypervisors; hyperconverged deployments; and scaling across
hundreds or thousands of servers.
Presentations in this devroom will be aimed at developers working on
these platforms who are looking to collaborate and improve shared
infrastructure or solve common problems. We seek topics that encourage
dialog between projects and continued work post-FOSDEM.
--------------------
Submit Your Proposal
--------------------
All submissions must be made via the Pentabarf event planning site.
https://penta.fosdem.org/submission/FOSDEM17
If you have not used Pentabarf before, you will need to create an
account. If you submitted proposals for FOSDEM in previous years, you
can use your existing account.
After creating the account, select Create Event to start the submission
process. Make sure to select Virtualisation and IaaS devroom from the
Track list. Please fill out all the required fields, and provide a
meaningful abstract and description of your proposed session.
---------------------
Submission Guidelines
---------------------
- We expect more proposals than we can possibly accept, so it is vitally
important that you submit your proposal on or before the deadline.
Late submissions are unlikely to be considered.
- All presentation slots are 45 minutes, with 35 minutes planned for
presentations, and 10 minutes for Q&A.
- All presentations will be recorded and made available under Creative
Commons licenses. In the Submission notes field, please indicate that
you agree that your presentation will be licensed under the
CC-By-SA-4.0 or CC-By-4.0 license and that you agree to have your
presentation recorded. For example:
"If my presentation is accepted for FOSDEM, I hereby agree to
license all recordings, slides, and other associated materials under
the Creative Commons Attribution Share-Alike 4.0 International
License. Sincerely, <NAME>."
- In the Submission notes field, please also confirm that if your talk
is accepted, you will be able to attend FOSDEM and deliver your
presentation. We will not consider proposals from prospective speakers
who are unsure whether they will be able to secure funds for travel
and lodging to attend FOSDEM. (Sadly, we are not able to offer travel
funding for prospective speakers.)
-------------------
Call for Volunteers
-------------------
We are also looking for volunteers to help run the devroom. We need
assistance watching time for the speakers, and helping with video for
the devroom. Please contact Brian Proffitt (bkp at redhat.com), for more
information.
----------
Questions?
----------
If you have any questions about this devroom, please send your questions
to our devroom mailing list.
iaas-virt-devroom(a)lists.fosdem.org
You can also subscribe to the list to receive updates about important
dates, session announcements, and to connect with other attendees.
=======================================================================
--
/kashyap
8 years, 1 month
[libvirt] [PATCH] qemu: fix one reboot scenario
by Maxim Nestratov
Both qemuDomainReboot and qemuDomainShutdownFlags do the following if
they were called to reboot:
1. use agent and call qemuAgentShutdown
2. then if the above function doesn't succeed, try qemuMonitorSystemPowerdown
When the first step is called, it resets fakeReboot flag, while the second one,
opposite to that, sets it. Thus, in case we tried to use agent to reboot a
guest and failed for some reason, we end up with fakeReboot flag set. After that,
as qemuMonitorSystemPowerdown function was called, libvirt is notified with POWERDOWN.
The problem is that there is no callback routine set for it. The lack of monitor event
reaction leads to incorrect logic and guest doesn't restart or reboot correctly.
The patch simply sets domainPowerdown monitor callback to qemuProcessHandleShutdown as
powerdown event processing is actually equal to shutdown.
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/qemu/qemu_process.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 04b25fe..0de9fa5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1630,6 +1630,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
.diskSecretLookup = qemuProcessFindVolumeQcowPassphrase,
.domainEvent = qemuProcessHandleEvent,
.domainShutdown = qemuProcessHandleShutdown,
+ .domainPowerdown = qemuProcessHandleShutdown,
.domainStop = qemuProcessHandleStop,
.domainResume = qemuProcessHandleResume,
.domainReset = qemuProcessHandleReset,
--
2.4.11
8 years, 1 month
[libvirt] [PATCH] qemu: Remove erroneously placed comments for numerical ordering
by John Ferlan
Commit id '74bbb8c2ec' seems to have mismerged a bit - adding 240 comments
out of place. Just clean that up.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushed as trivial
src/qemu/qemu_capabilities.c | 3 +--
src/qemu/qemu_capabilities.h | 2 --
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 5a3004d..ad98d68 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -351,8 +351,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"ivshmem-doorbell", /* 240 */
"query-qmp-schema",
-
- "gluster.debug_level", /* 240 */
+ "gluster.debug_level",
);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 02014c0..9163572 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -386,8 +386,6 @@ typedef enum {
/* 240 */
QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL, /* -device ivshmem-doorbell */
QEMU_CAPS_QUERY_QMP_SCHEMA, /* query-qmp-schema command */
-
- /* 240 */
QEMU_CAPS_GLUSTER_DEBUG_LEVEL, /* -drive gluster.debug_level={0..9} */
QEMU_CAPS_LAST /* this must always be the last item */
--
2.7.4
8 years, 1 month
[libvirt] [PATCH] qemu: Make sure shmem memory is shared
by Martin Kletzander
Even though using /dev/shm/asdf as the backend, we still need to make
the mapping shared. The original patch forgot to add that parameter.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1392031
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_command.c | 1 +
tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index caa80e74c26a..d3f99d34c67f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8565,6 +8565,7 @@ qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem)
virJSONValueObjectCreate(&ret,
"s:mem-path", mem_path,
"U:size", shmem->size,
+ "b:share", true,
NULL);
VIR_FREE(mem_path);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args b/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args
index 7abc7f8c4be5..688b7c7f63e2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args
@@ -18,13 +18,13 @@ QEMU_AUDIO_DRV=none \
-boot c \
-usb \
-object memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/shmem0,\
-size=4194304 \
+size=4194304,share=yes \
-device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,bus=pci.0,addr=0x3 \
-object memory-backend-file,id=shmmem-shmem1,mem-path=/dev/shm/shmem1,\
-size=134217728 \
+size=134217728,share=yes \
-device ivshmem-plain,id=shmem1,memdev=shmmem-shmem1,bus=pci.0,addr=0x5 \
-object memory-backend-file,id=shmmem-shmem2,mem-path=/dev/shm/shmem2,\
-size=268435456 \
+size=268435456,share=yes \
-device ivshmem-plain,id=shmem2,memdev=shmmem-shmem2,bus=pci.0,addr=0x4 \
-device ivshmem-doorbell,id=shmem3,chardev=charshmem3,ioeventfd=on,bus=pci.0,\
addr=0x6 \
--
2.10.2
8 years, 1 month
[libvirt] [PATCH 0/2 v2] List only online cpus for vcpupin/emulatorpin when vcpu placement static
by Nitesh Konkar
Currently when the vcpu placement is static and
cpuset is not specified, CPU Affinity shows 0..
CPUMAX. This patchset will result in display of
only online CPU's under CPU Affinity on linux.
Nitesh Konkar (2):
conf: List only online cpus for virsh vcpupin
conf: List only online cpus for virsh emulatorpin
src/conf/domain_conf.c | 8 +++++++-
src/qemu/qemu_driver.c | 4 ++++
2 files changed, 11 insertions(+), 1 deletion(-)
--
2.1.0
8 years, 1 month
[libvirt] [PATCH] qemu_capabilities: fix build with for old gcc
by Pavel Hrdina
../../src/qemu/qemu_capabilities.c:3757: error: declaration of
'basename' shadows a global declaration [-Wshadow]
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under build-breaker rule.
Sigh, I've just noticed the $subject.
src/qemu/qemu_capabilities.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ab1fc09..5a3004d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3754,7 +3754,7 @@ virQEMUCapsQMPSchemaObjectGetType(const char *field,
static virJSONValuePtr
-virQEMUCapsQMPSchemaTraverse(const char *basename,
+virQEMUCapsQMPSchemaTraverse(const char *baseName,
char **query,
virHashTablePtr schema)
{
@@ -3762,7 +3762,7 @@ virQEMUCapsQMPSchemaTraverse(const char *basename,
const char *metatype;
do {
- if (!(base = virHashLookup(schema, basename)))
+ if (!(base = virHashLookup(schema, baseName)))
return NULL;
if (!*query)
@@ -3773,25 +3773,25 @@ virQEMUCapsQMPSchemaTraverse(const char *basename,
/* flatten arrays by default */
if (STREQ(metatype, "array")) {
- if (!(basename = virJSONValueObjectGetString(base, "element-type")))
+ if (!(baseName = virJSONValueObjectGetString(base, "element-type")))
return NULL;
continue;
} else if (STREQ(metatype, "object")) {
if (**query == '+')
- basename = virQEMUCapsQMPSchemaObjectGetType("variants",
+ baseName = virQEMUCapsQMPSchemaObjectGetType("variants",
*query + 1,
"case", base);
else
- basename = virQEMUCapsQMPSchemaObjectGetType("members",
+ baseName = virQEMUCapsQMPSchemaObjectGetType("members",
*query,
"name", base);
- if (!basename)
+ if (!baseName)
return NULL;
} else if (STREQ(metatype, "command") ||
STREQ(metatype, "event")) {
- if (!(basename = virJSONValueObjectGetString(base, *query)))
+ if (!(baseName = virJSONValueObjectGetString(base, *query)))
return NULL;
} else {
/* alternates, basic types and enums can't be entered */
--
2.10.2
8 years, 1 month
[libvirt] [PATCH] xen: remove legacy hack for RHEL-5 Xen
by Daniel P. Berrange
We dropped support for RHEL-5 vintage Xen a while ago,
but forgot to remove some of the hacks for it.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 8 --------
src/xen/xen_hypervisor.c | 6 +-----
src/xen/xm_internal.c | 9 ++-------
3 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9e26b8c..b4292ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -634,14 +634,6 @@ fi
AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes")
AC_MSG_RESULT($with_sysctl)
-dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
-AC_ARG_WITH([rhel5-api],
- [AS_HELP_STRING([--with-rhel5-api=@<:@ARG@:>@],
- [build for the RHEL-5 API @<:@default=no@:>@])])
-if test x"$with_rhel5_api" = x"yes"; then
- AC_DEFINE([WITH_RHEL5_API], [1], [whether building for the RHEL-5 API])
-fi
-
AC_PATH_PROG([IP_PATH], [ip], /sbin/ip, [/usr/sbin:$PATH])
AC_DEFINE_UNQUOTED([IP_PATH], "$IP_PATH", [path to ip binary])
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 79b25b3..0177f83 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -120,11 +120,7 @@ typedef privcmd_hypercall_t hypercall_t;
# define __HYPERVISOR_domctl 36
#endif
-#ifdef WITH_RHEL5_API
-# define SYS_IFACE_MIN_VERS_NUMA 3
-#else
-# define SYS_IFACE_MIN_VERS_NUMA 4
-#endif
+#define SYS_IFACE_MIN_VERS_NUMA 4
static int xen_ioctl_hypercall_cmd;
static struct xenHypervisorVersions hv_versions = {
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 10c9097..fba814a 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -55,13 +55,8 @@
VIR_LOG_INIT("xen.xm_internal");
-#ifdef WITH_RHEL5_API
-# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
-# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2
-#else
-# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
-# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
-#endif
+#define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
+#define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
/* The true Xen limit varies but so far is always way
less than 1024, which is the Linux kernel limit according
--
2.9.3
8 years, 1 month
[libvirt] [PATCH] configure: remove fallback check for parted
by Daniel P. Berrange
Since we no longer support building on RHEL-5, we can
drop the non-pkg-config based check for parted.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index b4292ba..3ff4c42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1869,18 +1869,6 @@ if test "$with_storage_disk" = "yes" ||
PKG_CHECK_MODULES([LIBPARTED], [libparted >= $PARTED_REQUIRED], [],
[PARTED_FOUND=no])
fi
- if test "$PARTED_FOUND" = "no"; then
- # RHEL-5 vintage parted is missing pkg-config files
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- PARTED_FOUND=yes
- AC_CHECK_HEADER([parted/parted.h],,[PARTED_FOUND=no])
- AC_CHECK_LIB([uuid], [uuid_generate],,[PARTED_FOUND=no])
- AC_CHECK_LIB([parted], [ped_device_read],,[PARTED_FOUND=no])
- LIBPARTED_LIBS="-luuid -lparted"
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
- fi
if test "$with_storage_disk" = "yes" &&
test "$PARTED_FOUND" != "yes"; then
--
2.9.3
8 years, 1 month