[libvirt] [PATCH v4 0/6] vz: change vz driver to be stateful driver and other enhancements
by Maxim Nestratov
There is no benefit in providing two ways of connecting to vz driver:
by connecting via daemon and directly from client. Both ways finally
come to a host where vz daemon sits. Always connecting via daemon allows
us to have a single list of domains and share it among all connections.
Since v1:
removed patch "z: remove close callback implementations"
building fixed
close callback functions are added to libvirt_private.syms
reworked not to lose event subscribers when connections drop
Since v2:
removed "vz: change vzConnectIsAlive behavior"
addressed mostly all comments on previous series
changed "vz: build driver as module and don't register it on client's side"
Since v3:
removed privileged check in vzStateInitialize, we will not work in non-
privileged mode anyway, while skipping initialization is not correct
because cleanup function will be called anyway
prlsdkNewDomainByHandle changed to check for domain presense in the list
under lock
Maxim Nestratov (6):
vz: build driver as module and don't register it on client's side
vz: introduce new vzDriver lockable structure and use it
vz: fix possible vzDomainDefineXMLFlags and prlsdkNewDomainByHandle race
vz: implement connectGetSysinfo hypervisor callback
vz: remove vzDriverLock/Unlock function
vz: minor cleanup
daemon/Makefile.am | 4 +
daemon/libvirtd.c | 9 ++
src/Makefile.am | 19 ++-
src/libvirt.c | 7 -
src/libvirt_private.syms | 7 +
src/vz/vz_driver.c | 384 +++++++++++++++++++++++++++++------------------
src/vz/vz_sdk.c | 211 +++++++++++++-------------
src/vz/vz_sdk.h | 30 ++--
src/vz/vz_utils.c | 27 ++--
src/vz/vz_utils.h | 34 +++--
10 files changed, 431 insertions(+), 301 deletions(-)
--
2.4.3
8 years, 7 months
[libvirt] [PATCH v2] vz: simplify getting strings from vz sdk
by Nikolay Shirokovskiy
changes from v1:
================
1. move from macros to helper function as former is too heavy weigth for the task
2. squash fixed and variable length patches into one
3. rebase on master, so latest boot order patches can get benefits too
Nikolay Shirokovskiy (1):
vz: simplify getting strings from vzsdk
src/vz/vz_sdk.c | 208 ++++++++++++++++++--------------------------------------
1 file changed, 68 insertions(+), 140 deletions(-)
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] Fix various shadowed declarations
by Martin Kletzander
I tried compiling libvirt with older gcc and probably because I used
different configure options I got some shadowed declarations.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_migration.c | 6 +++---
src/storage/storage_backend_zfs.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d0055a27e24c..68a8fa892e17 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5943,7 +5943,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
int rc;
qemuDomainJobInfoPtr jobInfo = NULL;
bool inPostCopy = false;
- bool kill = true;
+ bool doKill = true;
VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
"cookieout=%p, cookieoutlen=%p, flags=%lx, retcode=%d",
@@ -6091,7 +6091,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
}
if (inPostCopy) {
- kill = false;
+ doKill = false;
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY);
@@ -6151,7 +6151,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
if (!dom &&
!(flags & VIR_MIGRATE_OFFLINE) &&
virDomainObjIsActive(vm)) {
- if (kill) {
+ if (doKill) {
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
QEMU_ASYNC_JOB_MIGRATION_IN,
VIR_QEMU_PROCESS_STOP_MIGRATED);
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index c66a808ab7b4..5c0c1fce5d4b 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -51,7 +51,7 @@ static int
virStorageBackendZFSVolModeNeeded(void)
{
virCommandPtr cmd = NULL;
- int ret = -1, exit = -1;
+ int ret = -1, exit_code = -1;
char *error = NULL;
/* 'zfs get' without arguments prints out
@@ -63,8 +63,8 @@ virStorageBackendZFSVolModeNeeded(void)
virCommandAddEnvString(cmd, "LC_ALL=C");
virCommandSetErrorBuffer(cmd, &error);
- ret = virCommandRun(cmd, &exit);
- if ((ret < 0) || (exit != 2)) {
+ ret = virCommandRun(cmd, &exit_code);
+ if ((ret < 0) || (exit_code != 2)) {
VIR_WARN("Command 'zfs get' either failed "
"to run or exited with unexpected status");
goto cleanup;
--
2.8.1
8 years, 7 months
[libvirt] [PATCH] build: fix build on RHEL-6
by Pavel Hrdina
GCC in RHEL-6 complains about listen:
../../src/conf/domain_conf.c:23718: error: declaration of 'listen' shadows a global declaration [-Wshadow]
/usr/include/sys/socket.h:204: error: shadowed declaration is here [-Wshadow]
This renames all the listen to gListen.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under build breaker rule.
src/conf/domain_conf.c | 12 ++++++------
src/libxl/libxl_conf.c | 16 ++++++++--------
src/qemu/qemu_command.c | 28 ++++++++++++++--------------
src/qemu/qemu_migration.c | 6 +++---
src/vbox/vbox_common.c | 10 +++++-----
src/vmx/vmx.c | 8 ++++----
src/vz/vz_sdk.c | 8 ++++----
src/xenconfig/xen_common.c | 14 +++++++-------
src/xenconfig/xen_sxpr.c | 16 ++++++++--------
src/xenconfig/xen_xl.c | 8 ++++----
10 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 446fbc5..12a3a50 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23715,21 +23715,21 @@ int
virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
const char *address)
{
- virDomainGraphicsListenDef listen;
+ virDomainGraphicsListenDef gListen;
- memset(&listen, 0, sizeof(listen));
+ memset(&gListen, 0, sizeof(gListen));
- listen.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS;
+ gListen.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS;
- if (VIR_STRDUP(listen.address, address) < 0)
+ if (VIR_STRDUP(gListen.address, address) < 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.address);
+ VIR_FREE(gListen.address);
return -1;
}
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index a2ef1bd..30f2ce9 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1424,7 +1424,7 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
libxl_device_vfb *x_vfb)
{
unsigned short port;
- virDomainGraphicsListenDefPtr listen = NULL;
+ virDomainGraphicsListenDefPtr gListen = NULL;
libxl_device_vfb_init(x_vfb);
@@ -1451,11 +1451,11 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
}
x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
- if ((listen = virDomainGraphicsGetListen(l_vfb, 0)) &&
- listen->address) {
+ if ((gListen = virDomainGraphicsGetListen(l_vfb, 0)) &&
+ gListen->address) {
/* libxl_device_vfb_init() does VIR_STRDUP("127.0.0.1") */
VIR_FREE(x_vfb->vnc.listen);
- if (VIR_STRDUP(x_vfb->vnc.listen, listen->address) < 0)
+ if (VIR_STRDUP(x_vfb->vnc.listen, gListen->address) < 0)
return -1;
}
if (VIR_STRDUP(x_vfb->vnc.passwd, l_vfb->data.vnc.auth.passwd) < 0)
@@ -1539,7 +1539,7 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
for (i = 0; i < def->ngraphics; i++) {
virDomainGraphicsDefPtr l_vfb = def->graphics[i];
unsigned short port;
- virDomainGraphicsListenDefPtr listen = NULL;
+ virDomainGraphicsListenDefPtr gListen = NULL;
if (l_vfb->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
continue;
@@ -1553,9 +1553,9 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
}
b_info->u.hvm.spice.port = l_vfb->data.spice.port;
- if ((listen = virDomainGraphicsGetListen(l_vfb, 0)) &&
- listen->address &&
- VIR_STRDUP(b_info->u.hvm.spice.host, listen->address) < 0)
+ if ((gListen = virDomainGraphicsGetListen(l_vfb, 0)) &&
+ gListen->address &&
+ VIR_STRDUP(b_info->u.hvm.spice.host, gListen->address) < 0)
return -1;
if (VIR_STRDUP(b_info->u.hvm.keymap, l_vfb->data.spice.keymap) < 0)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index da99e5c..31e5408 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7212,7 +7212,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
const char *domainLibDir)
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
- virDomainGraphicsListenDefPtr listen = NULL;
+ virDomainGraphicsListenDefPtr gListen = NULL;
const char *listenAddr = NULL;
char *netAddr = NULL;
bool escapeAddr;
@@ -7241,18 +7241,18 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
goto error;
}
- if ((listen = virDomainGraphicsGetListen(graphics, 0))) {
+ if ((gListen = virDomainGraphicsGetListen(graphics, 0))) {
- switch (listen->type) {
+ switch (gListen->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
- listenAddr = listen->address;
+ listenAddr = gListen->address;
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
- if (!listen->network)
+ if (!gListen->network)
break;
- ret = networkGetNetworkAddress(listen->network, &netAddr);
+ ret = networkGetNetworkAddress(gListen->network, &netAddr);
if (ret <= -2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("network-based listen not possible, "
@@ -7265,7 +7265,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
listenAddr = netAddr;
/* store the address we found in the <graphics> element so it
* will show up in status. */
- if (VIR_STRDUP(listen->address, netAddr) < 0)
+ if (VIR_STRDUP(gListen->address, netAddr) < 0)
goto error;
break;
}
@@ -7359,7 +7359,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
virDomainGraphicsDefPtr graphics)
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
- virDomainGraphicsListenDefPtr listen = NULL;
+ virDomainGraphicsListenDefPtr gListen = NULL;
const char *listenAddr = NULL;
char *netAddr = NULL;
int ret;
@@ -7398,18 +7398,18 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
if (port > 0 || tlsPort > 0) {
- if ((listen = virDomainGraphicsGetListen(graphics, 0))) {
+ if ((gListen = virDomainGraphicsGetListen(graphics, 0))) {
- switch (listen->type) {
+ switch (gListen->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
- listenAddr = listen->address;
+ listenAddr = gListen->address;
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
- if (!listen->network)
+ if (!gListen->network)
break;
- ret = networkGetNetworkAddress(listen->network, &netAddr);
+ ret = networkGetNetworkAddress(gListen->network, &netAddr);
if (ret <= -2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("network-based listen not possible, "
@@ -7422,7 +7422,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
listenAddr = netAddr;
/* store the address we found in the <graphics> element so it will
* show up in status. */
- if (VIR_STRDUP(listen->address, listenAddr) < 0)
+ if (VIR_STRDUP(gListen->address, listenAddr) < 0)
goto error;
break;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d0055a2..e72c874 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -314,7 +314,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
{
qemuMigrationCookieGraphicsPtr mig = NULL;
const char *listenAddr;
- virDomainGraphicsListenDefPtr listen = virDomainGraphicsGetListen(def, 0);
+ virDomainGraphicsListenDefPtr gListen = virDomainGraphicsGetListen(def, 0);
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (VIR_ALLOC(mig) < 0)
@@ -324,7 +324,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
if (mig->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
mig->port = def->data.vnc.port;
- if (!listen || !(listenAddr = listen->address))
+ if (!gListen || !(listenAddr = gListen->address))
listenAddr = cfg->vncListen;
#ifdef WITH_GNUTLS
@@ -339,7 +339,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
else
mig->tlsPort = -1;
- if (!listen || !(listenAddr = listen->address))
+ if (!gListen || !(listenAddr = gListen->address))
listenAddr = cfg->spiceListen;
#ifdef WITH_GNUTLS
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 5ffb493..0cead10 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -1578,7 +1578,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
char *guiDisplay = NULL;
char *sdlDisplay = NULL;
size_t i = 0;
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
for (i = 0; i < def->ngraphics; i++) {
IVRDxServer *VRDxServer = NULL;
@@ -1606,15 +1606,15 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
VIR_DEBUG("VRDP set to allow multiple connection");
}
- if ((listen = virDomainGraphicsGetListen(def->graphics[i], 0)) &&
- listen->address) {
+ if ((gListen = virDomainGraphicsGetListen(def->graphics[i], 0)) &&
+ gListen->address) {
PRUnichar *netAddressUtf16 = NULL;
- VBOX_UTF8_TO_UTF16(listen->address, &netAddressUtf16);
+ VBOX_UTF8_TO_UTF16(gListen->address, &netAddressUtf16);
gVBoxAPI.UIVRDxServer.SetNetAddress(data, VRDxServer,
netAddressUtf16);
VIR_DEBUG("VRDP listen address is set to: %s",
- listen->address);
+ gListen->address);
VBOX_UTF16_FREE(netAddressUtf16);
}
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 65b31c8..8c4b4bb 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -3403,7 +3403,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
int
virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
{
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
@@ -3425,10 +3425,10 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
def->data.vnc.port);
}
- if ((listen = virDomainGraphicsGetListen(def, 0)) &&
- listen->address) {
+ if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
+ gListen->address) {
virBufferAsprintf(buffer, "RemoteDisplay.vnc.ip = \"%s\"\n",
- listen->address);
+ gListen->address);
}
if (def->data.vnc.keymap != NULL) {
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 5d27afd..f0c7f3f 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2712,7 +2712,7 @@ static int prlsdkCheckFSUnsupportedParams(virDomainFSDefPtr fs)
static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
{
virDomainGraphicsDefPtr gr;
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
PRL_RESULT pret;
int ret = -1;
@@ -2735,10 +2735,10 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
prlsdkCheckRetGoto(pret, cleanup);
}
- if ((listen = virDomainGraphicsGetListen(gr, 0))) {
- if (!listen->address)
+ if ((gListen = virDomainGraphicsGetListen(gr, 0))) {
+ if (!gListen->address)
goto cleanup;
- pret = PrlVmCfg_SetVNCHostName(sdkdom, listen->address);
+ pret = PrlVmCfg_SetVNCHostName(sdkdom, gListen->address);
prlsdkCheckRetGoto(pret, cleanup);
}
diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 340e488..e1d9cf6 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -1628,7 +1628,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
def->graphics[0]->data.sdl.xauth) < 0)
return -1;
} else {
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
if (xenConfigSetInt(conf, "sdl", 0) < 0)
return -1;
@@ -1645,9 +1645,9 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
def->graphics[0]->data.vnc.port - 5900) < 0)
return -1;
- if ((listen = virDomainGraphicsGetListen(def->graphics[0], 0)) &&
- listen->address &&
- xenConfigSetString(conf, "vnclisten", listen->address) < 0)
+ if ((gListen = virDomainGraphicsGetListen(def->graphics[0], 0)) &&
+ gListen->address &&
+ xenConfigSetString(conf, "vnclisten", gListen->address) < 0)
return -1;
if (def->graphics[0]->data.vnc.auth.passwd &&
@@ -1674,7 +1674,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
virBufferAsprintf(&buf, ",xauthority=%s",
def->graphics[0]->data.sdl.xauth);
} else {
- virDomainGraphicsListenDefPtr listen
+ virDomainGraphicsListenDefPtr gListen
= virDomainGraphicsGetListen(def->graphics[0], 0);
virBufferAddLit(&buf, "type=vnc");
@@ -1683,8 +1683,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
if (!def->graphics[0]->data.vnc.autoport)
virBufferAsprintf(&buf, ",vncdisplay=%d",
def->graphics[0]->data.vnc.port - 5900);
- if (listen && listen->address)
- virBufferAsprintf(&buf, ",vnclisten=%s", listen->address);
+ if (gListen && gListen->address)
+ virBufferAsprintf(&buf, ",vnclisten=%s", gListen->address);
if (def->graphics[0]->data.vnc.auth.passwd)
virBufferAsprintf(&buf, ",vncpasswd=%s",
def->graphics[0]->data.vnc.auth.passwd);
diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c
index 7211314..2677510 100644
--- a/src/xenconfig/xen_sxpr.c
+++ b/src/xenconfig/xen_sxpr.c
@@ -1523,7 +1523,7 @@ static int
xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
virBufferPtr buf)
{
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
@@ -1551,9 +1551,9 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
virBufferAsprintf(buf, "(vncdisplay %d)", def->data.vnc.port-5900);
}
- if ((listen = virDomainGraphicsGetListen(def, 0)) &&
- listen->address)
- virBufferAsprintf(buf, "(vnclisten '%s')", listen->address);
+ if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
+ gListen->address)
+ virBufferAsprintf(buf, "(vnclisten '%s')", gListen->address);
if (def->data.vnc.auth.passwd)
virBufferAsprintf(buf, "(vncpasswd '%s')", def->data.vnc.auth.passwd);
if (def->data.vnc.keymap)
@@ -1579,7 +1579,7 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
static int
xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, virBufferPtr buf)
{
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
@@ -1604,9 +1604,9 @@ xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, virBufferPtr buf)
virBufferAsprintf(buf, "(vncdisplay %d)", def->data.vnc.port-5900);
}
- if ((listen = virDomainGraphicsGetListen(def, 0)) &&
- listen->address)
- virBufferAsprintf(buf, "(vnclisten '%s')", listen->address);
+ if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
+ gListen->address)
+ virBufferAsprintf(buf, "(vnclisten '%s')", gListen->address);
if (def->data.vnc.auth.passwd)
virBufferAsprintf(buf, "(vncpasswd '%s')", def->data.vnc.auth.passwd);
if (def->data.vnc.keymap)
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index b72e255..b5d4da1 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -837,7 +837,7 @@ xenFormatXLDomainDisks(virConfPtr conf, virDomainDefPtr def)
static int
xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
{
- virDomainGraphicsListenDefPtr listen;
+ virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsDefPtr graphics;
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
@@ -854,9 +854,9 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
if (xenConfigSetInt(conf, "spice", 1) < 0)
return -1;
- if ((listen = virDomainGraphicsGetListen(graphics, 0)) &&
- listen->address &&
- xenConfigSetString(conf, "spicehost", listen->address) < 0)
+ if ((gListen = virDomainGraphicsGetListen(graphics, 0)) &&
+ gListen->address &&
+ xenConfigSetString(conf, "spicehost", gListen->address) < 0)
return -1;
if (xenConfigSetInt(conf, "spiceport",
--
2.8.1
8 years, 7 months
[libvirt] [PATCH] vz: correct iomode check
by Mikhail Feoktistov
Virtuozzo hypervisor supports native iomode.
So we should allow to add disk with iomode "native" or "default".
---
src/vz/vz_utils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
index fed48a5..a89cf73 100644
--- a/src/vz/vz_utils.c
+++ b/src/vz/vz_utils.c
@@ -332,9 +332,10 @@ vzCheckDiskUnsupportedParams(virDomainDiskDefPtr disk)
return -1;
}
- if (disk->iomode) {
+ if (disk->iomode != VIR_DOMAIN_DISK_IO_DEFAULT &&
+ disk->iomode != VIR_DOMAIN_DISK_IO_NATIVE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Setting disk io mode is not "
+ _("Only native iomode is "
"supported by vz driver."));
return -1;
}
--
1.8.3.1
8 years, 7 months
[libvirt] [PATCH] rpc: daemon: Fix virtlog/virtlock daemon reload
by Cole Robinson
Trying to reload/SIGUSR1 virtlogd or virtlockd fails with:
error : virNetDaemonRun:747 : internal error: Not all servers restored, cannot run server
Commit 252610f7 changed the daemon state json to allow tracking
multiple servers. However it missed clearing dmn->srvObject after
the json is empty, like the previous code paths handled. Later on in
virNewDaemonRun, dmn->srvObject is expected to be empty otherwise we
throw the above error.
https://bugzilla.redhat.com/show_bug.cgi?id=1311013
---
src/rpc/virnetdaemon.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index c99914d..dcc89fa 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -293,6 +293,10 @@ virNetDaemonAddServerPostExec(virNetDaemonPtr dmn,
goto error;
}
+ if (virJSONValueObjectKeysNumber(dmn->srvObject) == 0) {
+ virJSONValueFree(dmn->srvObject);
+ dmn->srvObject = NULL;
+ }
}
srv = virNetServerNewPostExecRestart(object,
--
2.7.3
8 years, 7 months
[libvirt] [PATCH 0/2] workaround bogus GCC
by Pavel Hrdina
This combines Eric's and Cole's ideas together with configure check for GCC that
is affected by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602.
Pavel Hrdina (2):
build: cleanup GCC < 4.6 -Wlogical-op workaround
build: add GCC 6.0 -Wlogical-op workaround
m4/virt-compile-warnings.m4 | 22 +++++++++++++++++++++-
src/fdstream.c | 4 ++++
src/internal.h | 22 ++++++++++++++++++++++
src/rpc/virnetsshsession.c | 6 ++++++
src/security/security_selinux.c | 2 ++
src/util/virbuffer.c | 11 +++--------
src/util/virstring.c | 9 +--------
src/util/virsysinfo.c | 13 ++-----------
8 files changed, 61 insertions(+), 28 deletions(-)
--
2.8.1
8 years, 7 months
[libvirt] [PATCH 0/3] qemu: Fix hotplug of guest agent
by Martin Kletzander
Martin Kletzander (3):
qemuhotplugtest: Allow testing of live data
qemu: Move channel path generation out of command creation
qemu: Generate channel target paths on hotplug as well
src/qemu/qemu_command.c | 25 ++--------
src/qemu/qemu_command.h | 5 +-
src/qemu/qemu_domain.c | 19 +++++++
src/qemu/qemu_domain.h | 4 ++
src/qemu/qemu_hotplug.c | 3 ++
src/qemu/qemu_process.c | 12 +++--
tests/qemuhotplugtest.c | 42 ++++++++++++----
.../qemuhotplug-hotplug-base+qemu-agent-detach.xml | 58 ++++++++++++++++++++++
.../qemuhotplug-hotplug-base+qemu-agent.xml | 58 ++++++++++++++++++++++
.../qemuhotplug-qemu-agent-detach.xml | 5 ++
.../qemuhotplugtestdata/qemuhotplug-qemu-agent.xml | 5 ++
11 files changed, 197 insertions(+), 39 deletions(-)
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml
--
2.8.0
8 years, 7 months
[libvirt] [PATCH] QXL: fix reloading of vram64 attribute
by Pavel Hrdina
Commit b4a5fd95 introduced vram64 attribute for QXL video device but
there were two issues. Only function
qemuMonitorJSONUpdateVideoVram64Size should update the vram64 attribute
and also the value is in MiB, not in B.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e140d0e..d068c3d 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1437,17 +1437,6 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon,
}
video->vram = prop.val.ul / 1024;
- if (video->vram64 != 0) {
- if (qemuMonitorJSONGetObjectProperty(mon, path,
- "vram64_size_mb", &prop) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("QOM Object '%s' has no property 'vram64_size_mb'"),
- path);
- return -1;
- }
- video->vram64 = prop.val.ul / 1024;
- }
-
if (qemuMonitorJSONGetObjectProperty(mon, path, "ram_size", &prop) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("QOM Object '%s' has no property 'ram_size'"),
@@ -1509,7 +1498,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon,
path);
return -1;
}
- video->vram64 = prop.val.ul / 1024;
+ video->vram64 = prop.val.ul * 1024;
}
break;
case VIR_DOMAIN_VIDEO_TYPE_VGA:
--
2.8.1
8 years, 7 months
[libvirt] [PATCH 0/2] Fix VIR_TEST_REGENERATE_OUTPUT in tests
by Ján Tomko
Instead of the proper solution of moving all the host-changing
stuff out of qemuBuildCommandLine, separate one helper
for easier mocking.
Ján Tomko (2):
qemuExecuteEthernetScript: move to util
qemuxml2argvtest: do not mock virCommand
src/libvirt_private.syms | 1 +
src/qemu/qemu_interface.c | 29 +----------------------------
src/util/virnetdev.c | 29 +++++++++++++++++++++++++++++
src/util/virnetdev.h | 2 ++
tests/qemuxml2argvmock.c | 7 ++-----
5 files changed, 35 insertions(+), 33 deletions(-)
--
2.7.3
8 years, 7 months