[libvirt] [PATCH] Wire up <loader> to set the QEMU BIOS path
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
* src/qemu/qemu_command.c: Wire up -bios with <loader>
* tests/qemuxml2argvdata/qemuxml2argv-bios.args,
tests/qemuxml2argvdata/qemuxml2argv-bios.xml: Expand
existing BIOS test case to cover <loader>
---
src/qemu/qemu_command.c | 9 +++++++++
tests/qemuxml2argvdata/qemuxml2argv-bios.args | 3 ++-
tests/qemuxml2argvdata/qemuxml2argv-bios.xml | 1 +
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ea9431f..c82f5bc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4052,6 +4052,11 @@ qemuBuildCommandLine(virConnectPtr conn,
if (enableKVM)
virCommandAddArg(cmd, "-enable-kvm");
+ if (def->os.loader) {
+ virCommandAddArg(cmd, "-bios");
+ virCommandAddArg(cmd, def->os.loader);
+ }
+
/* Set '-m MB' based on maxmem, because the lower 'memory' limit
* is set post-startup using the balloon driver. If balloon driver
* is not supported, then they're out of luck anyway. Update the
@@ -7581,6 +7586,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
WANT_VALUE();
if (!(def->os.kernel = strdup(val)))
goto no_memory;
+ } else if (STREQ(arg, "-bios")) {
+ WANT_VALUE();
+ if (!(def->os.loader = strdup(val)))
+ goto no_memory;
} else if (STREQ(arg, "-initrd")) {
WANT_VALUE();
if (!(def->os.initrd = strdup(val)))
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios.args b/tests/qemuxml2argvdata/qemuxml2argv-bios.args
index f9727c4..ac98000 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bios.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios.args
@@ -1,5 +1,6 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nodefaults -device sga \
+/usr/bin/qemu -S -M pc -bios /usr/share/seabios/bios.bin \
+-m 1024 -smp 1 -nodefaults -device sga \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
-hda /dev/HostVG/QEMUGuest1 -serial pty \
-usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios.xml b/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
index cfc5587..ac15d45 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios.xml
@@ -6,6 +6,7 @@
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
+ <loader>/usr/share/seabios/bios.bin</loader>
<boot dev='hd'/>
<bootmenu enable='yes'/>
<bios useserial='yes'/>
--
1.7.7.6
12 years, 5 months
[libvirt] [PATCH] qemu: Always set auth_supported for Ceph disks.
by Wido den Hollander
Recently the Ceph project defaulted auth_supported from 'none' to 'cephx'.
When no auth information was set for Ceph disks this would lead to librados defaulting to
'cephx', but there would be no additional authorization information.
We now explicitly set auth_supported to none when passing down arguments to Qemu.
Signed-off-by: Wido den Hollander <wido(a)widodh.nl>
---
src/qemu/qemu_command.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6549f57..1c59695 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1782,6 +1782,8 @@ qemuBuildRBDString(virConnectPtr conn,
disk->auth.username);
goto error;
}
+ } else {
+ virBufferAddLit(opt, ":auth_supported=none");
}
if (disk->nhosts > 0) {
--
1.7.9.5
12 years, 5 months
[libvirt] [PATCH v7 0/8] Add basic driver for Parallels Virtuozzo Server
by Dmitry Guryanov
Parallels Cloud Server is a virtualization solution
that allows users to simultaneously run multiple virtual
machines and containers on the same physical server.
More information can be found here: http://www.parallels.com/products/pcs/
Also beta version of Parallels Cloud Server can be downloaded there.
Dmitry Guryanov (8):
parallels: add driver skeleton
parallels: add functions to list domains and get info
parallels: implement functions for domain life cycle management
parallels: get info about serial ports
parallels: add support of VNC remote display
parallels: implement virDomainDefineXML operation for existing
domains
parallels: add storage driver
parallels: implement VM creation
cfg.mk | 1 +
configure.ac | 23 +
docs/drvparallels.html.in | 28 +
include/libvirt/virterror.h | 2 +-
libvirt.spec.in | 9 +-
mingw32-libvirt.spec.in | 6 +
po/POTFILES.in | 4 +
src/Makefile.am | 15 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/driver.h | 1 +
src/libvirt.c | 9 +
src/parallels/parallels_driver.c | 1309 +++++++++++++++++++++++++++++++++
src/parallels/parallels_driver.h | 75 ++
src/parallels/parallels_storage.c | 1456 +++++++++++++++++++++++++++++++++++++
src/parallels/parallels_utils.c | 131 ++++
src/util/virterror.c | 3 +-
17 files changed, 3072 insertions(+), 4 deletions(-)
create mode 100644 docs/drvparallels.html.in
create mode 100644 src/parallels/parallels_driver.c
create mode 100644 src/parallels/parallels_driver.h
create mode 100644 src/parallels/parallels_storage.c
create mode 100644 src/parallels/parallels_utils.c
12 years, 5 months
[libvirt] [Patch v2] vmware: detect when a domain was shut down from the inside
by Jean-Baptiste Rouault
This patch adds an internal function vmwareUpdateVMStatus to
update the real state of the domain. This function is used in
various places in the driver, in particular to detect when
the domain has been shut down by the user with the "halt"
command.
---
v2:
- Replace internal function vmwareGetVMStatus by vmwareUpdateVMStatus
- Improve vmrun list output parsing
- variable initialization and coding-style fixes
src/vmware/vmware_driver.c | 95 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 8f9d922..53e28e7 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -28,6 +28,7 @@
#include "datatypes.h"
#include "virfile.h"
#include "memory.h"
+#include "util.h"
#include "uuid.h"
#include "command.h"
#include "vmx.h"
@@ -181,6 +182,64 @@ vmwareGetVersion(virConnectPtr conn, unsigned long *version)
}
static int
+vmwareUpdateVMStatus(struct vmware_driver *driver, virDomainObjPtr vm)
+{
+ virCommandPtr cmd;
+ char *outbuf = NULL;
+ char *vmxAbsolutePath = NULL;
+ char *parsedVmxPath = NULL;
+ char *str;
+ char *saveptr = NULL;
+ bool found = false;
+ int oldState = virDomainObjGetState(vm, NULL);
+ int newState;
+ int ret = -1;
+
+ cmd = virCommandNewArgList(VMRUN, "-T", vmw_types[driver->type],
+ "list", NULL);
+ virCommandSetOutputBuffer(cmd, &outbuf);
+ if (virCommandRun(cmd, NULL) < 0)
+ goto cleanup;
+
+ if (virFileResolveAllLinks(((vmwareDomainPtr) vm->privateData)->vmxPath,
+ &vmxAbsolutePath) < 0)
+ goto cleanup;
+
+ for(str = outbuf ; (parsedVmxPath = strtok_r(str, "\n", &saveptr)) != NULL;
+ str = NULL) {
+
+ if (parsedVmxPath[0] != '/')
+ continue;
+
+ if (STREQ(parsedVmxPath, vmxAbsolutePath)) {
+ found = true;
+ /* If the vmx path is in the output, the domain is running or
+ * is paused but we have no way to detect if it is paused or not. */
+ if (oldState == VIR_DOMAIN_PAUSED)
+ newState = oldState;
+ else
+ newState = VIR_DOMAIN_RUNNING;
+ break;
+ }
+ }
+
+ if (!found) {
+ vm->def->id = -1;
+ newState = VIR_DOMAIN_SHUTOFF;
+ }
+
+ virDomainObjSetState(vm, newState, 0);
+
+ ret = 0;
+
+cleanup:
+ virCommandFree(cmd);
+ VIR_FREE(outbuf);
+ VIR_FREE(vmxAbsolutePath);
+ return ret;
+}
+
+static int
vmwareStopVM(struct vmware_driver *driver,
virDomainObjPtr vm,
virDomainShutoffReason reason)
@@ -331,6 +390,9 @@ vmwareDomainShutdownFlags(virDomainPtr dom,
goto cleanup;
}
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
+
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domain is not in running state"));
@@ -485,6 +547,8 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags)
vmwareSetSentinal(cmd, vmw_types[driver->type]);
vmwareSetSentinal(cmd, vmxPath);
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -596,6 +660,9 @@ vmwareDomainCreateWithFlags(virDomainPtr dom,
goto cleanup;
}
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
+
if (virDomainObjIsActive(vm)) {
vmwareError(VIR_ERR_OPERATION_INVALID,
"%s", _("Domain is already running"));
@@ -645,6 +712,9 @@ vmwareDomainUndefineFlags(virDomainPtr dom,
goto cleanup;
}
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
+
if (virDomainObjIsActive(vm)) {
vm->persistent = 0;
} else {
@@ -874,6 +944,21 @@ vmwareDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
return xml;
}
+static void vmwareDomainObjListUpdateDomain(void *payload, const void *name ATTRIBUTE_UNUSED, void *data)
+{
+ struct vmware_driver *driver = data;
+ virDomainObjPtr vm = payload;
+ virDomainObjLock(vm);
+ vmwareUpdateVMStatus(driver, vm);
+ virDomainObjUnlock(vm);
+}
+
+static void
+vmwareDomainObjListUpdateAll(virDomainObjListPtr doms, struct vmware_driver *driver)
+{
+ virHashForEach(doms->objs, vmwareDomainObjListUpdateDomain, driver);
+}
+
static int
vmwareNumDefinedDomains(virConnectPtr conn)
{
@@ -881,6 +966,7 @@ vmwareNumDefinedDomains(virConnectPtr conn)
int n;
vmwareDriverLock(driver);
+ vmwareDomainObjListUpdateAll(&driver->domains, driver);
n = virDomainObjListNumOfDomains(&driver->domains, 0);
vmwareDriverUnlock(driver);
@@ -894,6 +980,7 @@ vmwareNumDomains(virConnectPtr conn)
int n;
vmwareDriverLock(driver);
+ vmwareDomainObjListUpdateAll(&driver->domains, driver);
n = virDomainObjListNumOfDomains(&driver->domains, 1);
vmwareDriverUnlock(driver);
@@ -908,6 +995,7 @@ vmwareListDomains(virConnectPtr conn, int *ids, int nids)
int n;
vmwareDriverLock(driver);
+ vmwareDomainObjListUpdateAll(&driver->domains, driver);
n = virDomainObjListGetActiveIDs(&driver->domains, ids, nids);
vmwareDriverUnlock(driver);
@@ -922,6 +1010,7 @@ vmwareListDefinedDomains(virConnectPtr conn,
int n;
vmwareDriverLock(driver);
+ vmwareDomainObjListUpdateAll(&driver->domains, driver);
n = virDomainObjListGetInactiveNames(&driver->domains, names, nnames);
vmwareDriverUnlock(driver);
return n;
@@ -944,6 +1033,9 @@ vmwareDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
goto cleanup;
}
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
+
info->state = virDomainObjGetState(vm, NULL);
info->cpuTime = 0;
info->maxMem = vm->def->mem.max_balloon;
@@ -979,6 +1071,9 @@ vmwareDomainGetState(virDomainPtr dom,
goto cleanup;
}
+ if (vmwareUpdateVMStatus(driver, vm) < 0)
+ goto cleanup;
+
*state = virDomainObjGetState(vm, reason);
ret = 0;
--
1.7.9.1
12 years, 5 months
[libvirt] [PATCH] Added the attribute vendor_id to the cpu model
by Hendrik Schwartke
Introducing the attribute vendor_id to force the CPUID instruction
in a kvm guest to return the specified vendor.
---
docs/schemas/domaincommon.rng | 7 +++++
src/conf/cpu_conf.c | 61 ++++++++++++++++++++++++++++++++---------
src/conf/cpu_conf.h | 3 ++
src/qemu/qemu_command.c | 6 +++-
tests/testutilsqemu.c | 1 +
5 files changed, 64 insertions(+), 14 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 46e539d..a246e8b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2820,6 +2820,13 @@
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="vendor_id">
+ <data type="string">
+ <param name='pattern'>.{12}</param>
+ </data>
+ </attribute>
+ </optional>
<choice>
<text/>
<empty/>
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index b520f7c..b8ca7a5 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -22,6 +22,7 @@
*/
#include <config.h>
+#include <ctype.h>
#include "virterror_internal.h"
#include "memory.h"
@@ -68,6 +69,7 @@ virCPUDefFreeModel(virCPUDefPtr def)
VIR_FREE(def->model);
VIR_FREE(def->vendor);
+ VIR_FREE(def->vendor_id);
for (i = 0; i < def->nfeatures; i++)
VIR_FREE(def->features[i].name);
@@ -104,6 +106,7 @@ virCPUDefCopyModel(virCPUDefPtr dst,
if ((src->model && !(dst->model = strdup(src->model)))
|| (src->vendor && !(dst->vendor = strdup(src->vendor)))
+ || (src->vendor_id && !(dst->vendor_id = strdup(src->vendor_id)))
|| VIR_ALLOC_N(dst->features, src->nfeatures) < 0)
goto no_memory;
dst->nfeatures_max = dst->nfeatures = src->nfeatures;
@@ -288,19 +291,42 @@ virCPUDefParseXML(const xmlNodePtr node,
}
if (def->type == VIR_CPU_TYPE_GUEST &&
- def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
- virXPathBoolean("boolean(./model[1]/@fallback)", ctxt)) {
- const char *fallback;
-
- fallback = virXPathString("string(./model[1]/@fallback)", ctxt);
- if (fallback) {
- def->fallback = virCPUFallbackTypeFromString(fallback);
- VIR_FREE(fallback);
- if (def->fallback < 0) {
- virCPUReportError(VIR_ERR_XML_ERROR, "%s",
- _("Invalid fallback attribute"));
- goto error;
- }
+ def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
+
+ if(virXPathBoolean("boolean(./model[1]/@fallback)", ctxt)) {
+ const char *fallback;
+
+ fallback = virXPathString("string(./model[1]/@fallback)", ctxt);
+ if (fallback) {
+ def->fallback = virCPUFallbackTypeFromString(fallback);
+ VIR_FREE(fallback);
+ if (def->fallback < 0) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Invalid fallback attribute"));
+ goto error;
+ }
+ }
+
+ if(virXPathBoolean("boolean(./model[1]/@vendor_id)", ctxt)) {
+ char *vendor_id;
+
+ vendor_id = virXPathString("string(./model[1]/@vendor_id)", ctxt);
+ if(!vendor_id || strlen(vendor_id)!=VIR_CPU_VENDOR_ID_LENGTH) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("vendor id must be 12 characters long"));
+ VIR_FREE(vendor_id);
+ goto error;
+ }
+ for(i=0; i<strlen(vendor_id); i++) {
+ if(!isprint(vendor_id[i]) || isspace(vendor_id[i])) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("vendor id is invalid"));
+ VIR_FREE(vendor_id);
+ goto error;
+ }
+ }
+ def->vendor_id = vendor_id;
+ }
}
}
@@ -588,6 +614,8 @@ virCPUDefFormatBuf(virBufferPtr buf,
return -1;
}
virBufferAsprintf(buf, " fallback='%s'", fallback);
+ if(def->vendor_id)
+ virBufferAsprintf(buf, " vendor_id='%s'", def->vendor_id);
}
if (formatModel && def->model) {
virBufferAsprintf(buf, ">%s</model>\n", def->model);
@@ -738,6 +766,13 @@ virCPUDefIsEqual(virCPUDefPtr src,
goto cleanup;
}
+ if (STRNEQ_NULLABLE(src->vendor_id, dst->vendor_id)) {
+ virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU model %s does not match source %s"),
+ NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id));
+ goto cleanup;
+ }
+
if (src->sockets != dst->sockets) {
virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target CPU sockets %d does not match source %d"),
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index f8b7bf9..3daadbd 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -28,6 +28,8 @@
# include "buf.h"
# include "xml.h"
+#define VIR_CPU_VENDOR_ID_LENGTH 12
+
enum virCPUType {
VIR_CPU_TYPE_HOST,
VIR_CPU_TYPE_GUEST,
@@ -103,6 +105,7 @@ struct _virCPUDef {
int match; /* enum virCPUMatch */
char *arch;
char *model;
+ char *vendor_id; /* vendor id returned by CPUID in the guest */
int fallback; /* enum virCPUFallback */
char *vendor;
unsigned int sockets;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bd4f96a..56ecefb 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3910,7 +3910,9 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
}
virBufferAddLit(&buf, "host");
} else {
- if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(host->arch)))
+ if (VIR_ALLOC(guest) < 0
+ || !(guest->arch = strdup(host->arch))
+ || (cpu->vendor_id && !(guest->vendor_id = strdup(cpu->vendor_id))))
goto no_memory;
if (cpu->match == VIR_CPU_MATCH_MINIMUM)
@@ -3924,6 +3926,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
goto cleanup;
virBufferAdd(&buf, guest->model, -1);
+ if(guest->vendor_id)
+ virBufferAsprintf(&buf, ",vendor=%s", guest->vendor_id);
for (i = 0; i < guest->nfeatures; i++) {
char sign;
if (guest->features[i].policy == VIR_CPU_FEATURE_DISABLE)
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 8d5a3bf..8b7cb33 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -116,6 +116,7 @@ virCapsPtr testQemuCapsInit(void) {
0, /* match */
(char *) "x86_64", /* arch */
(char *) "core2duo", /* model */
+ NULL, /* vendor_id */
0, /* fallback */
(char *) "Intel", /* vendor */
1, /* sockets */
--
1.7.9.5
12 years, 5 months
[libvirt] [libvirt-php PATCH] Add ability to managed save libvirt domains
by Y@billing.fastvps.ru
From: Pavel Odintsov <pavel.odintsov(a)gmail.com>
---
src/libvirt-php.c | 22 ++++++++++++++++++++++
src/libvirt-php.h | 1 +
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 20e5d27..9cdfd0e 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -99,6 +99,7 @@ static zend_function_entry libvirt_functions[] = {
PHP_FE(libvirt_domain_core_dump, NULL)
PHP_FE(libvirt_domain_shutdown, NULL)
PHP_FE(libvirt_domain_suspend, NULL)
+ PHP_FE(libvirt_domain_managedsave, NULL)
PHP_FE(libvirt_domain_undefine, NULL)
PHP_FE(libvirt_domain_reboot, NULL)
PHP_FE(libvirt_domain_define_xml, NULL)
@@ -4470,6 +4471,27 @@ PHP_FUNCTION(libvirt_domain_shutdown)
}
/*
+ Function name: libvirt_domain_managedsave
+ Since version: 0.4.1(-1)
+ Description: Function is used to managed save the domain (domain was unloaded from memory and it state saved to disk) identified by it's resource
+ Arguments: @res [resource]: libvirt domain resource, e.g. from libvirt_domain_lookup_by_*()
+ Returns: TRUE for success, FALSE on error
+*/
+
+PHP_FUNCTION(libvirt_domain_managedsave)
+{
+ php_libvirt_domain *domain=NULL;
+ zval *zdomain;
+ int retval;
+
+ GET_DOMAIN_FROM_ARGS("r",&zdomain);
+ retval=virDomainManagedSave(domain->domain, 0);
+ DPRINTF("%s: virDomainManagedSave(%p) returned %d\n", PHPFUNC, domain->domain, retval);
+ if (retval != 0) RETURN_FALSE;
+ RETURN_TRUE;
+}
+
+/*
Function name: libvirt_domain_suspend
Since version: 0.4.1(-1)
Description: Function is used to suspend the domain identified by it's resource
diff --git a/src/libvirt-php.h b/src/libvirt-php.h
index 3c7f254..b06836c 100644
--- a/src/libvirt-php.h
+++ b/src/libvirt-php.h
@@ -307,6 +307,7 @@ PHP_FUNCTION(libvirt_domain_resume);
PHP_FUNCTION(libvirt_domain_core_dump);
PHP_FUNCTION(libvirt_domain_shutdown);
PHP_FUNCTION(libvirt_domain_suspend);
+PHP_FUNCTION(libvirt_domain_managedsave);
PHP_FUNCTION(libvirt_domain_undefine);
PHP_FUNCTION(libvirt_domain_reboot);
PHP_FUNCTION(libvirt_domain_define_xml);
--
1.7.2.5
12 years, 5 months
[libvirt] [PATCH] fix key error for qemuMonitorGetBlockStatsInfo
by lvroyce@linux.vnet.ibm.com
From: lvroyce <lvroyce(a)linux.vnet.ibm.com>
virDomainBlockStatsFlags can't collect total_time_ns for read/write/flush
because of key typo when retriveing from qemu cmd result
Signed-off-by: lvroyce <lvroyce(a)linux.vnet.ibm.com>
---
src/qemu/qemu_monitor_json.c | 24 ++++++++++++------------
src/qemu/qemu_monitor_text.c | 18 +++++++++---------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7d2da21..7eb9529 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1710,12 +1710,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (rd_total_times &&
- virJSONValueObjectHasKey(stats, "rd_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "rd_total_times_ns",
+ virJSONValueObjectHasKey(stats, "rd_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns",
rd_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "rd_total_times_ns");
+ "rd_total_time_ns");
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) {
@@ -1731,12 +1731,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (wr_total_times &&
- virJSONValueObjectHasKey(stats, "wr_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "wr_total_times_ns",
+ virJSONValueObjectHasKey(stats, "wr_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns",
wr_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "wr_total_times_ns");
+ "wr_total_time_ns");
goto cleanup;
}
if (flush_req &&
@@ -1749,12 +1749,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (flush_total_times &&
- virJSONValueObjectHasKey(stats, "flush_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "flush_total_times_ns",
+ virJSONValueObjectHasKey(stats, "flush_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns",
flush_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "flush_total_times_ns");
+ "flush_total_time_ns");
goto cleanup;
}
}
@@ -1822,12 +1822,12 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon,
if (STREQ(key, "rd_bytes") ||
STREQ(key, "rd_operations") ||
- STREQ(key, "rd_total_times_ns") ||
+ STREQ(key, "rd_total_time_ns") ||
STREQ(key, "wr_bytes") ||
STREQ(key, "wr_operations") ||
- STREQ(key, "wr_total_times_ns") ||
+ STREQ(key, "wr_total_time_ns") ||
STREQ(key, "flush_operations") ||
- STREQ(key, "flush_total_times_ns")) {
+ STREQ(key, "flush_total_time_ns")) {
num++;
} else {
/* wr_highest_offset is parsed by qemuMonitorJSONGetBlockExtent. */
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index edb5dfd..086b06b 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -977,13 +977,13 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
if (virStrToLong_ll (p, &dummy, 10, wr_req) == -1)
VIR_DEBUG ("error reading wr_req: %s", p);
} else if (rd_total_times &&
- STRPREFIX (p, "rd_total_times_ns=")) {
- p += strlen("rd_total_times_ns=");
+ STRPREFIX (p, "rd_total_time_ns=")) {
+ p += strlen("rd_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, rd_total_times) == -1)
VIR_DEBUG ("error reading rd_total_times: %s", p);
} else if (wr_total_times &&
- STRPREFIX (p, "wr_total_times_ns=")) {
- p += strlen("wr_total_times_ns=");
+ STRPREFIX (p, "wr_total_time_ns=")) {
+ p += strlen("wr_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, wr_total_times) == -1)
VIR_DEBUG ("error reading wr_total_times: %s", p);
} else if (flush_req &&
@@ -992,8 +992,8 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
if (virStrToLong_ll (p, &dummy, 10, flush_req) == -1)
VIR_DEBUG ("error reading flush_req: %s", p);
} else if (flush_total_times &&
- STRPREFIX (p, "flush_total_times_ns=")) {
- p += strlen("flush_total_times_ns=");
+ STRPREFIX (p, "flush_total_time_ns=")) {
+ p += strlen("flush_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, flush_total_times) == -1)
VIR_DEBUG ("error reading flush_total_times: %s", p);
} else {
@@ -1071,10 +1071,10 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
STRPREFIX (p, " wr_bytes=") ||
STRPREFIX (p, " rd_operations=") ||
STRPREFIX (p, " wr_operations=") ||
- STRPREFIX (p, " rd_total_times_ns=") ||
- STRPREFIX (p, " wr_total_times_ns=") ||
+ STRPREFIX (p, " rd_total_time_ns=") ||
+ STRPREFIX (p, " wr_total_time_ns=") ||
STRPREFIX (p, " flush_operations=") ||
- STRPREFIX (p, " flush_total_times_ns=")) {
+ STRPREFIX (p, " flush_total_time_ns=")) {
num++;
} else {
VIR_DEBUG ("unknown block stat near %s", p);
--
1.7.7.6
12 years, 5 months
[libvirt] sanlock on F17
by Dave Allan
I just tried to set up sanlock on F17 using the instructions at
http://libvirt.org/locking.html, but libvirtd refuses to start with
the sanlock error in the logs:
Jun 29 19:56:20 nienna sanlock[8423]: 19846 open error -13
/var/lib/libvirt/sanlock/__LIBVIRT__DISKS__
I confirmed that user sanlock can create, read and write files in
/var/lib/libvirt/sanlock
The only thing I can think of that's slightly odd about my setup is
that I'm only concerned with the local machine, so that directory is
not an NFS mount. Anybody have any thoughts on what's going wrong
here?
TIA,
Dave
12 years, 5 months
[libvirt] compile option: --without-gnutls
by Chris Van Heuveln
Hi libvirt-list,
Full disclosure: this is the first open source project I've tried to contribute to and I'm still learning the process and tools.
In any case, Mikhail Gusarov started a thread on this a while back and I've tried to take it to conclusion. I needed to remove tls for 0.8.4 so I coded up a --without-gnutls configure option using Mikhail's partial code as a template. Then I pulled down 0.9.12 and came up with a patch that I'd like to push out to the commununity.
I'm not adding any "new" functionality other than the configure option. The tls calls/structs are just #ifdef'd for the most part. In a couple of places I had to flip the logic for "if (!tls_struct) else", and also had to modify a few function calls to pass void * instead of tls pointers.
I built --with-gnutls, --without-gnutls, and no option specified (defaults to --with-gnutls).
make check is clean except for:
TEST: libvirtdconftest
.....!!!!!!...!!!!!!!!!!!!!!!!!!!!!!!!! 39 FAIL
...which consists mostly of this sasl failure:
39) Test corruption ... libvir: Config File error : unsupported configuration: remoteReadConfigFile: /home/ubu/git/libvirt/tests/../daemon/libvirtd.conf: auth_tcp: unsupported auth sasl
FAILED
...so I'm trying to track that down, and also need to run syntax-check and valgrind tests.
Once I get the tests passing what's my next step?
Are you okay with this approach?
Do you want a preview of my diffs?
Do I need to write additional tests for this new option or update any documentation?
Thanks,
Chris Van Heuveln
12 years, 5 months