[libvirt] [PATCH 0/4] A series of FreeBSD fixes
by Roman Bogorodskiy
This is a series of a few fixes to FreeBSD build in general and
to the bhyve driver in general.
Pushed that under the build breaker and trivial rule. However, for the
first two fixes I'm not sure that's the best fix possible, so I'm open
for feedback.
Roman Bogorodskiy (4):
nodeinfo: fix build on non-Linux
hostcpu: fix build on FreeBSD
bhyve: add missing virhost(cpu|mem).h headers
bhyve: fix bhyvexml2arg test
src/bhyve/bhyve_driver.c | 2 ++
src/nodeinfo.c | 2 ++
src/util/virhostcpu.c | 4 ++--
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.xml | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.xml | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.xml | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder4.xml | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml | 4 ++--
tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml | 4 ++--
9 files changed, 14 insertions(+), 10 deletions(-)
--
2.7.4
8 years, 6 months
[libvirt] [PATCH] apparmor: Don't scrub environment of virtlogd process
by Guido Günther
otherwise we drop variables like XDG_RUNTIME_DIR with qemu:///session
and libvirtd faild to find virtlogd's socket.
---
examples/apparmor/usr.sbin.libvirtd | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd
index 5d606e6..23f70f5 100644
--- a/examples/apparmor/usr.sbin.libvirtd
+++ b/examples/apparmor/usr.sbin.libvirtd
@@ -45,6 +45,7 @@
/bin/* PUx,
/sbin/* PUx,
/usr/bin/* PUx,
+ /usr/sbin/virtlogd pix,
/usr/sbin/* PUx,
/lib/udev/scsi_id PUx,
/usr/{lib,lib64}/xen-common/bin/xen-toolstack PUx,
--
2.8.1
8 years, 6 months
[libvirt] [ruby-libvirt] Don't make volume upload zero bytes
by Guido Günther
The virStreamSourceFunc internal_sendall currently returns the first
value passed in from the block, which according the ruby-libvirt docs
should be zero:
The send block should return an array of 2 elements; the first element
should be the return code from the block (-1 for error, 0 otherwise)
But according to the libvirt docs of virStreamSourceFunc this indicates
EOF:
Returns: the number of bytes filled, 0 upon end of file, or -1 upon error
So return the size of the buffer to unbreak volume uploads.
---
ext/libvirt/stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/libvirt/stream.c b/ext/libvirt/stream.c
index 1353dc9..c171535 100644
--- a/ext/libvirt/stream.c
+++ b/ext/libvirt/stream.c
@@ -131,7 +131,7 @@ static int internal_sendall(virStreamPtr RUBY_LIBVIRT_UNUSED(st), char *data,
memcpy(data, RSTRING_PTR(buffer), RSTRING_LEN(buffer));
- return NUM2INT(retcode);
+ return RSTRING_LEN(buffer);
}
/*
--
2.8.1
8 years, 6 months
[libvirt] [PATCH 0/3] vz: util: some crash fixes
by Maxim Nestratov
Maxim Nestratov (3):
util: fix crash in virClassIsDerivedFrom for CloseCallbacks objects
vz: fix crash when parsing unexpected disk configuration
util: fix potential crash in virDiskNameParse
src/util/virclosecallbacks.c | 2 ++
src/util/virutil.c | 3 +++
src/vz/vz_sdk.c | 3 +++
3 files changed, 8 insertions(+)
--
1.8.3.1
8 years, 6 months
[libvirt] [PATCH] vz: implementation of domainSetUserPassword callback
by Mikhail Feoktistov
---
.gnulib | 2 +-
src/vz/vz_driver.c | 20 ++++++++++++++++++++
src/vz/vz_sdk.c | 31 +++++++++++++++++++++++++++++++
src/vz/vz_sdk.h | 5 ++++-
4 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/.gnulib b/.gnulib
index 8d807a9..6cc32c6 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 8d807a99c6e8eecd2a9cf7c7b5d48ec0b2c934f8
+Subproject commit 6cc32c63e80bc1a30c521b2f07f2b54909b59892
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 177a57a..b204248 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1252,6 +1252,25 @@ static int vzDomainDetachDevice(virDomainPtr dom, const char *xml)
VIR_DOMAIN_AFFECT_CONFIG | VIR_DOMAIN_AFFECT_LIVE);
}
+static int
+vzDomainSetUserPassword(virDomainPtr domain,
+ const char *user,
+ const char *password,
+ unsigned int flags)
+{
+ virDomainObjPtr dom = NULL;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+ if (!(dom = vzDomObjFromDomain(domain)))
+ return -1;
+
+ ret = prlsdkDomainSetUserPassword(dom, user, password);
+
+ virObjectUnlock(dom);
+ return ret;
+}
+
static unsigned long long
vzDomainGetMaxMemory(virDomainPtr domain)
{
@@ -2716,6 +2735,7 @@ static virHypervisorDriver vzHypervisorDriver = {
.domainIsUpdated = vzDomainIsUpdated, /* 1.2.21 */
.domainGetVcpusFlags = vzDomainGetVcpusFlags, /* 1.2.21 */
.domainGetMaxVcpus = vzDomainGetMaxVcpus, /* 1.2.21 */
+ .domainSetUserPassword = vzDomainSetUserPassword, /* 1.2.16 */
.connectDomainEventRegisterAny = vzConnectDomainEventRegisterAny, /* 1.2.10 */
.connectDomainEventDeregisterAny = vzConnectDomainEventDeregisterAny, /* 1.2.10 */
.nodeGetCPUMap = vzNodeGetCPUMap, /* 1.2.8 */
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7eb78ca..4e06b7f 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3565,6 +3565,37 @@ prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
return 0;
}
+int
+prlsdkDomainSetUserPassword(virDomainObjPtr dom,
+ const char *user,
+ const char *password)
+{
+ int ret = -1;
+ vzDomObjPtr privdom = dom->privateData;
+ PRL_HANDLE job = PRL_INVALID_HANDLE;
+
+ job = PrlVm_BeginEdit(privdom->sdkdom);
+ if (PRL_FAILED(waitJob(job)))
+ goto cleanup;
+
+ job = PrlVm_SetUserPasswd(privdom->sdkdom,
+ user,
+ password,
+ 0);
+
+ if (PRL_FAILED(waitJob(job)))
+ goto cleanup;
+
+ job = PrlVm_CommitEx(privdom->sdkdom, 0);
+ if (PRL_FAILED(waitJob(job)))
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ return ret;
+}
+
static int
prlsdkDoApplyConfig(vzDriverPtr driver,
PRL_HANDLE sdkdom,
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index f570560..a3c423a 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -82,7 +82,10 @@ void
prlsdkDomObjFreePrivate(void *p);
/* memsize is in MiB */
int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize);
-
+int
+prlsdkDomainSetUserPassword(virDomainObjPtr dom,
+ const char *user,
+ const char *password);
virDomainSnapshotObjListPtr prlsdkLoadSnapshots(virDomainObjPtr dom);
int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description);
int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children);
--
1.8.3.1
8 years, 6 months
[libvirt] [PATCH 0/4] vz: error processing fixes
by Maxim Nestratov
Maxim Nestratov (4):
vz: remove unused macro logPrlEventError
vz: return event error code in logPrlEventErrorHelper and use it
vz: fix getJobResultHelper
vz: return correct result for unimplemented ChangeState actions
src/vz/vz_sdk.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--
1.8.3.1
8 years, 6 months
[libvirt] [PATCH] vz: fixed build by including necessary headers
by Maxim Nestratov
After eaf18f4c2 some functions changed their homes
Pushed under build breaking rule
---
src/vz/vz_driver.c | 2 ++
src/vz/vz_sdk.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index d2b3870..ea63ced 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -51,6 +51,8 @@
#include "virstring.h"
#include "cpu/cpu.h"
#include "virtypedparam.h"
+#include "virhostmem.h"
+#include "virhostcpu.h"
#include "vz_driver.h"
#include "vz_utils.h"
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 77b5509..525b039 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -31,6 +31,7 @@
#include "datatypes.h"
#include "domain_conf.h"
#include "virtime.h"
+#include "virhostcpu.h"
#include "vz_sdk.h"
--
2.4.3
8 years, 6 months
[libvirt] [PATCH 0/3] keep subscription to performance events thru domain lifetime
by Nikolay Shirokovskiy
Patches 1-2 are simple preparation steps. Patch 3 do the job.
Nikolay Shirokovskiy (3):
vz: simplify refcount on sdkdom in prlsdkLoadDomain
vz: use consistent naming for different domain object in vz_driver.c
vz: keep subscription to performance events thru domain lifetime
src/vz/vz_driver.c | 182 +++++++++++++++++++++++++++++------------------------
src/vz/vz_sdk.c | 140 ++++++++++++-----------------------------
src/vz/vz_sdk.h | 8 +--
src/vz/vz_utils.c | 10 +--
src/vz/vz_utils.h | 12 +---
5 files changed, 144 insertions(+), 208 deletions(-)
--
1.8.3.1
8 years, 6 months
[libvirt] [PATCH] domain_conf: silence gcc warnings
by Pavel Hrdina
../../src/conf/domain_conf.c:10949: error: declaration of 'socket'
shadows a global declaration [-Wshadow]
../../src/conf/domain_conf.c:24373: error: declaration of 'listen'
shadows a global declaration [-Wshadow]
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
This breaks a build on CentOS 6, pushed under build-breaker rule.
src/conf/domain_conf.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 85f6e31..10e61da 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10946,7 +10946,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
char *type = virXMLPropString(node, "type");
char *address = virXMLPropString(node, "address");
char *network = virXMLPropString(node, "network");
- char *socket = virXMLPropString(node, "socket");
+ char *socketPath = virXMLPropString(node, "socket");
char *fromConfig = virXMLPropString(node, "fromConfig");
char *addressCompat = NULL;
char *socketCompat = NULL;
@@ -11012,16 +11012,16 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
}
if (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) {
- if (socket && socketCompat && STRNEQ(socket, socketCompat)) {
+ if (socketPath && socketCompat && STRNEQ(socketPath, socketCompat)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("graphics 'socket' attribute '%s' must match "
"'socket' attribute of first listen element "
- "(found '%s')"), socketCompat, socket);
+ "(found '%s')"), socketCompat, socketPath);
goto error;
}
- if (!socket) {
- socket = socketCompat;
+ if (!socketPath) {
+ socketPath = socketCompat;
socketCompat = NULL;
}
}
@@ -11045,15 +11045,15 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
network = NULL;
}
- if (socket && socket[0]) {
+ if (socketPath && socketPath[0]) {
if (def->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("'socket' attribute is valid only for listen "
"type 'socket'"));
goto error;
}
- def->socket = socket;
- socket = NULL;
+ def->socket = socketPath;
+ socketPath = NULL;
}
if (fromConfig &&
@@ -11074,7 +11074,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
VIR_FREE(type);
VIR_FREE(address);
VIR_FREE(network);
- VIR_FREE(socket);
+ VIR_FREE(socketPath);
VIR_FREE(fromConfig);
VIR_FREE(addressCompat);
VIR_FREE(socketCompat);
@@ -24368,24 +24368,24 @@ virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
int
virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def,
- const char *socket)
+ const char *socketPath)
{
- virDomainGraphicsListenDef listen;
+ virDomainGraphicsListenDef glisten;
- memset(&listen, 0, sizeof(listen));
+ memset(&glisten, 0, sizeof(glisten));
- listen.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET;
+ glisten.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET;
- if (VIR_STRDUP(listen.socket, socket) < 0)
+ if (VIR_STRDUP(glisten.socket, socketPath) < 0)
goto error;
- if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, listen) < 0)
+ if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, glisten) < 0)
goto error;
return 0;
error:
- VIR_FREE(listen.socket);
+ VIR_FREE(glisten.socket);
return -1;
}
--
2.8.4
8 years, 6 months
[libvirt] [PATCH 0/6] Intorducing storage pool lifecycle event APIs
by Jovanka Gulicoska
Introducing implementation of storage pool event APIs. Code changes
follow network event APIs.
Implemented functions: virStoragePoolEventRegisterAny(),
virStoragePoolEventDeregisterAny(), virStoragePoolLifeCycleEventNew(),
introduced STARTED, STOPPED, DEFINE, UNDEFINE and REFRESHED.
STARTED signal is emiited in storagePoolCreateXML() and storagePoolCreate()
DEFINED signal is emitted in storagePoolDefineXML()
UNDEFINED signal is emitted in storagePoolUndefine()
STOPPED signal is emitted in storagePoolDestroy() and storagePoolRefresh()
REFRESHED signal is emitted in storagePoolRefresh()
There are also test as well as unittests for the new functions and signals.
This is part of a GSOC project: Asynchronous lifecycle events for storage objects
As part of the project there should also be implementation for
storage volume events.
For now there's no signal when volumes are created or deleted,
they can also be implemented, but probably the easiest way is to have
apps watch for REFRESH signal, and later extend storage driver code to
refresh a pool after volume APIs are called.
Jovanka Gulicoska (6):
Introduce storage lifecycle event APIs
conf: add storage_event handling and unittests
unittests and test: implement storage lifecycle event APIs
remote: implement storage lifecycle event APIs
storage: implement storage lifecycle event APIs
event-test: support storage lifecycle event APIs
daemon/libvirtd.h | 2 +
daemon/remote.c | 205 +++++++++++++++++++++++++++++++
examples/object-events/event-test.c | 50 +++++++-
include/libvirt/libvirt-storage.h | 94 ++++++++++++++
src/Makefile.am | 5 +
src/conf/object_event.c | 1 +
src/conf/storage_conf.h | 5 +
src/conf/storage_event.c | 237 ++++++++++++++++++++++++++++++++++++
src/conf/storage_event.h | 60 +++++++++
src/datatypes.h | 13 ++
src/driver-storage.h | 14 +++
src/libvirt-storage.c | 122 +++++++++++++++++++
src/libvirt_private.syms | 5 +
src/libvirt_public.syms | 7 ++
src/remote/remote_driver.c | 133 ++++++++++++++++++++
src/remote/remote_protocol.x | 43 ++++++-
src/remote_protocol-structs | 22 +++-
src/storage/storage_driver.c | 118 ++++++++++++++++++
src/test/test_driver.c | 76 ++++++++++++
tests/objecteventtest.c | 176 ++++++++++++++++++++++++++
20 files changed, 1383 insertions(+), 5 deletions(-)
create mode 100644 src/conf/storage_event.c
create mode 100644 src/conf/storage_event.h
--
2.5.5
8 years, 6 months