[libvirt] [PATCH] Remove duplicate empty lines and correct indentation and style
by Matthias Bolte
No functional change included.
---
python/libvirt-override.c | 1 -
src/conf/domain_conf.c | 1 -
src/conf/interface_conf.c | 1 -
src/conf/network_conf.c | 1 -
src/conf/node_device_conf.c | 4 -
src/conf/storage_conf.c | 1 -
src/interface/netcf_driver.c | 16 ++----
src/libxl/libxl_driver.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/node_device/node_device_driver.c | 2 -
src/node_device/node_device_linux_sysfs.c | 2 -
src/nwfilter/nwfilter_ebiptables_driver.c | 2 -
src/openvz/openvz_driver.c | 87 ++++++++++++++---------------
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_driver.c | 10 +--
src/qemu/qemu_process.c | 1 -
src/rpc/virnetclient.c | 2 -
src/rpc/virnetserverservice.c | 2 -
src/uml/uml_driver.c | 2 -
src/xen/xen_driver.c | 1 -
src/xen/xs_internal.c | 12 ++--
src/xenxs/xen_xm.c | 1 -
tests/virnetsockettest.c | 3 -
24 files changed, 60 insertions(+), 100 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 2b88796..64d793d 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -2572,7 +2572,6 @@ libvirt_virConnectDomainEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
ret = 0;
}
-
cleanup:
LIBVIRT_RELEASE_THREAD_STATE;
return ret;
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7bcdcaf..83930c1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9806,7 +9806,6 @@ char *virDomainDefFormat(virDomainDefPtr def,
if (virDomainFSDefFormat(&buf, def->fss[n], flags) < 0)
goto cleanup;
-
for (n = 0 ; n < def->nnets ; n++)
if (virDomainNetDefFormat(&buf, def->nets[n], flags) < 0)
goto cleanup;
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 10377e7..99c3052 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -1300,7 +1300,6 @@ virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
interfaces->count++;
return iface;
-
}
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index ae479bf..3aeec7e 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1155,7 +1155,6 @@ int virNetworkSaveXML(const char *configDir,
cleanup:
VIR_FORCE_CLOSE(fd);
-
VIR_FREE(configFile);
return ret;
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index dde2921..1ea122e 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -746,11 +746,8 @@ virNodeDevCapScsiHostParseXML(xmlXPathContextPtr ctxt,
}
if (STREQ(type, "vport_ops")) {
-
data->scsi_host.flags |= VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS;
-
} else if (STREQ(type, "fc_host")) {
-
xmlNodePtr orignode2;
data->scsi_host.flags |= VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST;
@@ -775,7 +772,6 @@ virNodeDevCapScsiHostParseXML(xmlXPathContextPtr ctxt,
}
ctxt->node = orignode2;
-
} else {
virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown SCSI host capability type '%s' for '%s'"),
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index f6f8be1..21d39a8 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1203,7 +1203,6 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAsprintf(buf," <group>%d</group>\n",
def->perms.gid);
-
if (def->perms.label)
virBufferAsprintf(buf," <label>%s</label>\n",
def->perms.label);
diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c
index dd15c9d..5a549db 100644
--- a/src/interface/netcf_driver.c
+++ b/src/interface/netcf_driver.c
@@ -125,22 +125,19 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn,
{
struct interface_driver *driverState;
- if (VIR_ALLOC(driverState) < 0)
- {
+ if (VIR_ALLOC(driverState) < 0) {
virReportOOMError();
goto alloc_error;
}
/* initialize non-0 stuff in driverState */
- if (virMutexInit(&driverState->lock) < 0)
- {
+ if (virMutexInit(&driverState->lock) < 0) {
/* what error to report? */
goto mutex_error;
}
/* open netcf */
- if (ncf_init(&driverState->netcf, NULL) != 0)
- {
+ if (ncf_init(&driverState->netcf, NULL) != 0) {
/* what error to report? */
goto netcf_error;
}
@@ -149,8 +146,7 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS;
netcf_error:
- if (driverState->netcf)
- {
+ if (driverState->netcf) {
ncf_close(driverState->netcf);
}
virMutexDestroy (&driverState->lock);
@@ -162,9 +158,7 @@ alloc_error:
static int interfaceCloseInterface(virConnectPtr conn)
{
-
- if (conn->interfacePrivateData != NULL)
- {
+ if (conn->interfacePrivateData != NULL) {
struct interface_driver *driver = conn->interfacePrivateData;
/* close netcf instance */
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ade69d8..4926398 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2671,7 +2671,7 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml)
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0)
+ if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0)
goto cleanup;
if (!(vm = virDomainAssignDef(driver->caps,
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index ffcfe4d..2b1585b 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -412,7 +412,7 @@ static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char *xml)
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0)
+ if ((dupVM = virDomainObjIsDuplicate(&driver->domains, def, 0)) < 0)
goto cleanup;
if ((def->nets != NULL) && !(driver->have_netns)) {
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 842f903..62ceee7 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -220,13 +220,11 @@ nodeDeviceLookupByWWN(virConnectPtr conn,
nodeDeviceLock(driver);
for (i = 0; i < devs->count; i++) {
-
obj = devs->objs[i];
virNodeDeviceObjLock(obj);
cap = obj->def->caps;
while (cap) {
-
if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) {
check_fc_host(&cap->data);
if (cap->data.scsi_host.flags &
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index 34e4501..eab5158 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -270,13 +270,11 @@ static int get_sriov_function(const char *device_link,
device_link);
if (!virFileExists(device_link)) {
-
VIR_DEBUG("SR IOV function link '%s' does not exist", device_link);
/* Not an SR IOV device, not an error, either. */
ret = SRIOV_NOT_FOUND;
goto out;
-
}
device_path = canonicalize_file_name (device_link);
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index c9b60da..7321c2a 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -922,7 +922,6 @@ iptablesHandleIpHdr(virBufferPtr buf,
ipaddr);
if (HAS_ENTRY_ITEM(&ipHdr->dataSrcIPTo)) {
-
if (printDataType(vars,
ipaddr, sizeof(ipaddr),
&ipHdr->dataSrcIPTo))
@@ -1584,7 +1583,6 @@ _iptablesCreateRuleInstance(int directionIn,
} else
final = &buf;
-
return ebiptablesAddRuleInst(res,
virBufferContentAndReset(final),
nwfilter->chainsuffix,
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index c13f346..d62b91f 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -177,18 +177,14 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef)
if (vmdef->nfss == 1 &&
vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_TEMPLATE &&
- vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_MOUNT)
- {
+ vmdef->fss[0]->type != VIR_DOMAIN_FS_TYPE_MOUNT) {
openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
_("filesystem is not of type 'template' or 'mount'"));
goto cleanup;
}
-
if (vmdef->nfss == 1 &&
- vmdef->fss[0]->type == VIR_DOMAIN_FS_TYPE_MOUNT)
- {
-
+ vmdef->fss[0]->type == VIR_DOMAIN_FS_TYPE_MOUNT) {
if (virStrToLong_i(vmdef->name, NULL, 10, &vpsid) < 0) {
openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not convert domain name to VEID"));
@@ -206,9 +202,7 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef)
_("Could not set the source dir for the filesystem"));
goto cleanup;
}
- }
- else
- {
+ } else {
if (openvzDomainDefineCmd(prog, OPENVZ_MAX_ARG, vmdef) < 0) {
VIR_ERROR(_("Error creating command for container"));
goto cleanup;
@@ -222,9 +216,9 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef)
ret = 0;
cleanup:
- VIR_FREE(confdir);
- cmdExecFree(prog);
- return ret;
+ VIR_FREE(confdir);
+ cmdExecFree(prog);
+ return ret;
}
@@ -537,42 +531,43 @@ cleanup:
return ret;
}
-static int openvzDomainResume(virDomainPtr dom) {
- struct openvz_driver *driver = dom->conn->privateData;
- virDomainObjPtr vm;
- const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINAL, "--resume", NULL};
- int ret = -1;
-
- openvzDriverLock(driver);
- vm = virDomainFindByUUID(&driver->domains, dom->uuid);
- openvzDriverUnlock(driver);
-
- if (!vm) {
- openvzError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
- goto cleanup;
- }
-
- if (!virDomainObjIsActive(vm)) {
- openvzError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not running"));
- goto cleanup;
- }
-
- if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
- openvzSetProgramSentinal(prog, vm->def->name);
- if (virRun(prog, NULL) < 0) {
- goto cleanup;
- }
- virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED);
- }
-
- ret = 0;
+static int openvzDomainResume(virDomainPtr dom)
+{
+ struct openvz_driver *driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINAL, "--resume", NULL};
+ int ret = -1;
+
+ openvzDriverLock(driver);
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ openvzDriverUnlock(driver);
+
+ if (!vm) {
+ openvzError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
+ goto cleanup;
+ }
+
+ if (!virDomainObjIsActive(vm)) {
+ openvzError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not running"));
+ goto cleanup;
+ }
+
+ if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
+ openvzSetProgramSentinal(prog, vm->def->name);
+ if (virRun(prog, NULL) < 0) {
+ goto cleanup;
+ }
+ virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED);
+ }
+
+ ret = 0;
cleanup:
- if (vm)
- virDomainObjUnlock(vm);
- return ret;
+ if (vm)
+ virDomainObjUnlock(vm);
+ return ret;
}
static int openvzDomainShutdown(virDomainPtr dom) {
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ad62a07..778def4 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1025,7 +1025,7 @@ qemuCapsComputeCmdFlags(const char *help,
* two features. The benefits of JSON mode now outweigh
* the downside.
*/
- if (version >= 13000)
+ if (version >= 13000)
qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
if (version >= 13000)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6e4480e..b47368c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -662,7 +662,7 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virBitmapPtr qemuCaps)
return 0;
- no_memory:
+no_memory:
virReportOOMError();
return -1;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 52b7dfd..2301424 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8027,8 +8027,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT);
- }
- else {
+ } else {
/* qemu is a little funny with running guests and the restoration
* of snapshots. If the snapshot was taken online,
* then after a "loadvm" monitor command, the VM is set running
@@ -8113,8 +8112,7 @@ static int qemuDomainSnapshotDiscard(struct qemud_driver *driver,
}
}
}
- }
- else {
+ } else {
priv = vm->privateData;
qemuDomainObjEnterMonitorWithDriver(driver, vm);
/* we continue on even in the face of error */
@@ -8135,9 +8133,9 @@ static int qemuDomainSnapshotDiscard(struct qemud_driver *driver,
/* Now we set the new current_snapshot for the domain */
vm->current_snapshot = parentsnap;
- }
- else
+ } else {
vm->current_snapshot = NULL;
+ }
}
if (virAsprintf(&snapFile, "%s/%s/%s.xml", driver->snapshotDir,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c9145cb..cdb0193 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -819,7 +819,6 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
qemuDomainObjExitMonitorWithDriver(driver, vm);
error:
-
return ret;
}
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 615de6c..e3217ac 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -936,7 +936,6 @@ static int virNetClientIOEventLoop(virNetClientPtr client,
return 0;
}
-
if (fds[0].revents & (POLLHUP | POLLERR)) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s",
_("received hangup / error event on socket"));
@@ -944,7 +943,6 @@ static int virNetClientIOEventLoop(virNetClientPtr client,
}
}
-
error:
client->waitDispatch = thiscall->next;
VIR_DEBUG("Giving up the buck due to I/O error %p %p", thiscall, client->waitDispatch);
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index 8c250e2..dae172c 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -131,7 +131,6 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename,
goto error;
}
-
return svc;
no_memory:
@@ -187,7 +186,6 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
goto error;
}
-
return svc;
no_memory:
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index f0f053b..2fb31cb 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1762,7 +1762,6 @@ static int umlDomainAttachUmlDisk(struct uml_driver *driver,
return 0;
error:
-
VIR_FREE(reply);
VIR_FREE(cmd);
@@ -1818,7 +1817,6 @@ static int umlDomainAttachDevice(virDomainPtr dom, const char *xml)
}
cleanup:
-
virDomainDeviceDefFree(dev);
if (vm)
virDomainObjUnlock(vm);
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 88febba..af83e8e 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -347,7 +347,6 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
priv->xendConfigVersion = -1;
priv->xshandle = NULL;
-
/* Hypervisor is only run with privilege & required to succeed */
if (xenHavePrivilege()) {
VIR_DEBUG("Trying hypervisor sub-driver");
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 04bf93a..e7aaf60 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -1333,7 +1333,7 @@ retry:
if (new_domain_cnt < 0)
return -1;
- if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
+ if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0) {
virReportOOMError();
return -1;
}
@@ -1345,9 +1345,9 @@ retry:
}
missing = 0;
- for (i=0 ; i < new_domain_cnt ; i++) {
+ for (i = 0; i < new_domain_cnt; i++) {
found = 0;
- for (j = 0 ; j < priv->activeDomainList->count ; j++) {
+ for (j = 0; j < priv->activeDomainList->count; j++) {
if (priv->activeDomainList->doms[j]->id == new_domids[i]) {
found = 1;
break;
@@ -1416,7 +1416,7 @@ retry:
if (new_domain_cnt < 0)
return -1;
- if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
+ if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0 ) {
virReportOOMError();
return -1;
}
@@ -1428,9 +1428,9 @@ retry:
}
removed = 0;
- for (j=0 ; j < priv->activeDomainList->count ; j++) {
+ for (j = 0; j < priv->activeDomainList->count; j++) {
found = 0;
- for (i=0 ; i < new_domain_cnt ; i++) {
+ for (i = 0; i < new_domain_cnt; i++) {
if (priv->activeDomainList->doms[j]->id == new_domids[i]) {
found = 1;
break;
diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c
index 0ad2179..511d1f5 100644
--- a/src/xenxs/xen_xm.c
+++ b/src/xenxs/xen_xm.c
@@ -1426,7 +1426,6 @@ virConfPtr xenFormatXM(virConnectPtr conn,
if (!(conf = virConfNew()))
goto cleanup;
-
if (xenXMConfigSetString(conf, "name", def->name) < 0)
goto no_memory;
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index f6c7274..34b1df7 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -292,13 +292,11 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
goto cleanup;
}
-
if (virNetSocketAccept(lsock, &ssock) < 0) {
VIR_DEBUG("Unexpected client socket missing");
goto cleanup;
}
-
if (STRNEQ(virNetSocketLocalAddrString(ssock), "127.0.0.1;0")) {
VIR_DEBUG("Unexpected local address");
goto cleanup;
@@ -309,7 +307,6 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
goto cleanup;
}
-
ret = 0;
cleanup:
--
1.7.4.1
13 years, 5 months
[libvirt] [PATCH] python: Fix bogus label placement
by Matthias Bolte
---
python/libvirt-override.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 8be9af7..2b88796 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -1489,13 +1489,12 @@ libvirt_virNodeGetCellsFreeMemory(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
return(NULL);
if ((startCell < 0) || (maxCells <= 0) || (startCell + maxCells > 10000))
- goto error;
+ return VIR_PY_NONE;
conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
- freeMems =
- malloc(maxCells * sizeof(*freeMems));
+ freeMems = malloc(maxCells * sizeof(*freeMems));
if (freeMems == NULL)
- goto error;
+ return VIR_PY_NONE;
LIBVIRT_BEGIN_ALLOW_THREADS;
c_retval = virNodeGetCellsFreeMemory(conn, freeMems, startCell, maxCells);
@@ -1503,7 +1502,6 @@ libvirt_virNodeGetCellsFreeMemory(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
if (c_retval < 0) {
free(freeMems);
-error:
return VIR_PY_NONE;
}
py_retval = PyList_New(c_retval);
--
1.7.4.1
13 years, 5 months
[libvirt] [PATCH] docs: minor whitespace cleanups
by Eric Blake
No change in wording. One spacing change in a <pre>, noticed because
of odd XML formatting online; the rest is in free-flowing text to
make it easier to see nesting levels in the document.
* docs/formatdomain.html.in: Adjust spacing. Break long lines.
---
I'll probably push this under the trivial rule.
The <pre> change is in the hunk at line 296, for <numatune>.
docs/formatdomain.html.in | 195 ++++++++++++++++++++++++++-------------------
1 files changed, 112 insertions(+), 83 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index fe8d74c..10d87a9 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -46,7 +46,8 @@
<dt><code>uuid</code></dt>
<dd>The content of the <code>uuid</code> element provides
a globally unique identifier for the virtual machine.
- The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
+ The format must be RFC 4122 compliant,
+ eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new machine, a random
UUID is generated. It is also possible to provide the UUID
via a <a href="#elementsSysinfo"><code>sysinfo</code></a>
@@ -96,13 +97,16 @@
on bare metal, so requires full virtualization. <code>linux</code>
(badly named!) refers to an OS that supports the Xen 3 hypervisor
guest ABI. There are also two optional attributes, <code>arch</code>
- specifying the CPU architecture to virtualization, and <code>machine</code>
- referring to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
- provides details on allowed values for these. <span class="since">Since 0.0.1</span></dd>
+ specifying the CPU architecture to virtualization,
+ and <code>machine</code> referring to the machine
+ type. The <a href="formatcaps.html">Capabilities XML</a>
+ provides details on allowed values for
+ these. <span class="since">Since 0.0.1</span></dd>
<dt><code>loader</code></dt>
<dd>The optional <code>loader</code> tag refers to a firmware blob
used to assist the domain creation process. At this time, it is
- only needed by Xen fully virtualized domains. <span class="since">Since 0.1.0</span></dd>
+ only needed by Xen fully virtualized
+ domains. <span class="since">Since 0.1.0</span></dd>
<dt><code>boot</code></dt>
<dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
"cdrom" or "network" and is used to specify the next boot device
@@ -296,7 +300,7 @@
<shares>2048</shares>
</cputune>
<numatune>
- <memory mode="strict" nodeset="1-4,^3"/>
+ <memory mode="strict" nodeset="1-4,^3"/>
</numatune>
...</pre>
@@ -372,7 +376,8 @@
physical CPUS the domain VCPU will be pinned to. If this is ommited,
each VCPU pinned to all the physical CPUS by default. It contains two
required attributes, the attribute <code>vcpu</code> specifies vcpu id,
- and the attribute <code>cpuset</code> is same as attribute <code>cpuset</code>
+ and the attribute <code>cpuset</code> is same as
+ attribute <code>cpuset</code>
of element <code>vcpu</code>. (NB: Only qemu driver support)
<span class="since">Since 0.9.0</span>
</dd>
@@ -380,8 +385,9 @@
<dd>
The optional <code>shares</code> element specifies the proportional
weighted share for the domain. If this is ommited, it defaults to
- the OS provided defaults. NB, There is no unit for the value, it's a relative
- measure based on the setting of other VM, e.g. A VM configured with value
+ the OS provided defaults. NB, There is no unit for the value,
+ it's a relative measure based on the setting of other VM,
+ e.g. A VM configured with value
2048 will get twice as much CPU time as a VM configured with value 1024.
<span class="since">Since 0.9.0</span>
</dd>
@@ -395,7 +401,8 @@
<dd>
The optional <code>memory</code> element specify how to allocate memory
for the domain process on a NUMA host. It contains two attributes,
- attribute <code>mode</code> is either 'interleave', 'strict', or 'preferred',
+ attribute <code>mode</code> is either 'interleave', 'strict',
+ or 'preferred',
attribute <code>nodeset</code> specifies the NUMA nodes, it leads same
syntax with attribute <code>cpuset</code> of element <code>vcpu</code>.
<span class='since'>Since 0.9.3</span>
@@ -825,12 +832,14 @@
to connect.
<span class="since">Since 0.0.3</span></dd>
<dt><code>target</code></dt>
- <dd>The <code>target</code> element controls the bus / device under which the
- disk is exposed to the guest OS. The <code>dev</code> attribute indicates
- the "logical" device name. The actual device name specified is not guaranteed to map to
- the device name in the guest OS. Treat it as a device ordering hint.
- The optional <code>bus</code> attribute specifies the type of disk device
- to emulate; possible values are driver specific, with typical values being
+ <dd>The <code>target</code> element controls the bus / device
+ under which the disk is exposed to the guest
+ OS. The <code>dev</code> attribute indicates the "logical"
+ device name. The actual device name specified is not
+ guaranteed to map to the device name in the guest OS. Treat it
+ as a device ordering hint. The optional <code>bus</code>
+ attribute specifies the type of disk device to emulate;
+ possible values are driver specific, with typical values being
"ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is
inferred from the style of the device name. eg, a device named 'sda'
will typically be exported using a SCSI bus.
@@ -905,7 +914,8 @@
</dd>
<dt><code>serial</code></dt>
<dd>If present, this specify serial number of virtual hard drive.
- For example, it may look as <code><serial>WD-WMAP9A966149</serial></code>.
+ For example, it may look
+ like <code><serial>WD-WMAP9A966149</serial></code>.
<span class="since">Since 0.7.1</span>
</dd>
<dt><code>host</code></dt>
@@ -1146,7 +1156,8 @@
<h4><a name="elementsUSB">USB and PCI devices</a></h4>
<p>
- USB and PCI devices attached to the host can be passed through to the guest using
+ USB and PCI devices attached to the host can be passed through
+ to the guest using
the <code>hostdev</code> element. <span class="since">since after
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
</p>
@@ -1774,12 +1785,12 @@ qemu-kvm -net nic,model=? /dev/null
...</pre>
<p>
- If no target is specified, certain hypervisors will automatically
- generate a name for the created tun device. This name can be manually
- specifed, however the name <i>must not start with either 'vnet' or
- 'vif'</i>, which are prefixes reserved by libvirt and certain
- hypervisors. Manually specified targets using these prefixes will be
- ignored.
+ If no target is specified, certain hypervisors will
+ automatically generate a name for the created tun device. This
+ name can be manually specifed, however the name <i>must not
+ start with either 'vnet' or 'vif'</i>, which are prefixes
+ reserved by libvirt and certain hypervisors. Manually specified
+ targets using these prefixes will be ignored.
</p>
<h5><a name="elementsNICSBoot">Specifying boot order</a></h5>
@@ -1808,9 +1819,10 @@ qemu-kvm -net nic,model=? /dev/null
<h4><a name="elementsInput">Input devices</a></h4>
<p>
- Input devices allow interaction with the graphical framebuffer in the guest
- virtual machine. When enabling the framebuffer, an input device is automatically
- provided. It may be possible to add additional devices explicitly, for example,
+ Input devices allow interaction with the graphical framebuffer
+ in the guest virtual machine. When enabling the framebuffer, an
+ input device is automatically provided. It may be possible to
+ add additional devices explicitly, for example,
to provide a graphics tablet for absolute cursor movement.
</p>
@@ -1823,8 +1835,9 @@ qemu-kvm -net nic,model=? /dev/null
<dl>
<dt><code>input</code></dt>
- <dd>The <code>input</code> element has one mandatory attribute, the <code>type</code>
- whose value can be either 'mouse' or 'tablet'. The latter provides absolute
+ <dd>The <code>input</code> element has one mandatory attribute,
+ the <code>type</code> whose value can be either 'mouse' or
+ 'tablet'. The latter provides absolute
cursor movement, while the former uses relative movement. The optional
<code>bus</code> attribute can be used to refine the exact device type.
It takes values "xen" (paravirtualized), "ps2" and "usb".</dd>
@@ -1858,56 +1871,67 @@ qemu-kvm -net nic,model=? /dev/null
<dl>
<dt><code>graphics</code></dt>
<dd>The <code>graphics</code> element has a mandatory <code>type</code>
- attribute which takes the value "sdl", "vnc", "rdp" or "desktop":
+ attribute which takes the value "sdl", "vnc", "rdp" or "desktop":
<dl>
<dt><code>"sdl"</code></dt>
<dd>
- This displays a window on the host desktop, it can take 3 optional arguments:
- a <code>display</code> attribute for the display to use, an <code>xauth</code>
- attribute for the authentication identifier, and an optional <code>fullscreen</code>
- attribute accepting values 'yes' or 'no'.
+ This displays a window on the host desktop, it can take 3
+ optional arguments: a <code>display</code> attribute for
+ the display to use, an <code>xauth</code> attribute for
+ the authentication identifier, and an
+ optional <code>fullscreen</code> attribute accepting
+ values 'yes' or 'no'.
</dd>
<dt><code>"vnc"</code></dt>
<dd>
- Starts a VNC server. The <code>port</code> attribute specifies the TCP
- port number (with -1 as legacy syntax indicating that it should be
- auto-allocated). The <code>autoport</code> attribute is the new
- preferred syntax for indicating autoallocation of the TCP port to use.
- The <code>listen</code> attribute is an IP address for the server to
- listen on. The <code>passwd</code> attribute provides a VNC password
- in clear text. The <code>keymap</code> attribute specifies the keymap
- to use. It is possible to set a limit on the validity of the password
- be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
- assumed to be in UTC. NB, this may not be supported by all hypervisors.<br/>
- <br/>
- Rather than using listen/port, QEMU supports a <code>socket</code>
- attribute for listening on a unix domain socket path.
- <span class="since">Since 0.8.8</span>
+ Starts a VNC server. The <code>port</code> attribute
+ specifies the TCP port number (with -1 as legacy syntax
+ indicating that it should be
+ auto-allocated). The <code>autoport</code> attribute is
+ the new preferred syntax for indicating autoallocation of
+ the TCP port to use. The <code>listen</code> attribute is
+ an IP address for the server to listen
+ on. The <code>passwd</code> attribute provides a VNC
+ password in clear text. The <code>keymap</code> attribute
+ specifies the keymap to use. It is possible to set a limit
+ on the validity of the password be giving an
+ timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
+ assumed to be in UTC. NB, this may not be supported by all
+ hypervisors.<br/> <br/> Rather than using listen/port,
+ QEMU supports a <code>socket</code> attribute for
+ listening on a unix domain socket
+ path.<span class="since">Since 0.8.8</span>
</dd>
<dt><code>"spice"</code></dt>
<dd>
<p>
- Starts a SPICE server. The <code>port</code> attribute specifies the TCP
- port number (with -1 as legacy syntax indicating that it should be
- auto-allocated), while <code>tlsPort</code> gives an alternative
- secure port number. The <code>autoport</code> attribute is the new
- preferred syntax for indicating autoallocation of both port numbers.
- The <code>listen</code> attribute is an IP address for the server to
- listen on. The <code>passwd</code> attribute provides a SPICE password
- in clear text. The <code>keymap</code> attribute specifies the keymap
- to use. It is possible to set a limit on the validity of the password
- be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
- assumed to be in UTC. NB, this may not be supported by all hypervisors.
- <span class="since">"spice" since 0.8.6</span>.
+ Starts a SPICE server. The <code>port</code> attribute
+ specifies the TCP port number (with -1 as legacy syntax
+ indicating that it should be auto-allocated),
+ while <code>tlsPort</code> gives an alternative secure
+ port number. The <code>autoport</code> attribute is the
+ new preferred syntax for indicating autoallocation of
+ both port numbers. The <code>listen</code> attribute is
+ an IP address for the server to listen
+ on. The <code>passwd</code> attribute provides a SPICE
+ password in clear text. The <code>keymap</code>
+ attribute specifies the keymap to use. It is possible to
+ set a limit on the validity of the password be giving an
+ timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
+ assumed to be in UTC. NB, this may not be supported by
+ all hypervisors.<span class="since">"spice" since 0.8.6</span>.
</p>
<p>
- When SPICE has both a normal and TLS secured TCP port configured, it
- can be desirable to restrict what channels can be run on each port.
- This is achieved by adding one or more <channel> elements inside
- the main <graphics> element. Valid channel names include
- <code>main</code>, <code>display</code>, <code>inputs</code>,
- <code>cursor</code>, <code>playback</code>, <code>record</code>;
- and <span class="since">since 0.8.8</span>: <code>smartcard</code>.
+ When SPICE has both a normal and TLS secured TCP port
+ configured, it can be desirable to restrict what
+ channels can be run on each port. This is achieved by
+ adding one or more <channel> elements inside the
+ main <graphics> element. Valid channel names
+ include <code>main</code>, <code>display</code>,
+ <code>inputs</code>, <code>cursor</code>,
+ <code>playback</code>, <code>record</code>;
+ and <span class="since">since
+ 0.8.8</span>: <code>smartcard</code>.
</p>
<pre>
<graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
@@ -1951,23 +1975,27 @@ qemu-kvm -net nic,model=? /dev/null
</dd>
<dt><code>"rdp"</code></dt>
<dd>
- Starts a RDP server. The <code>port</code> attribute
- specifies the TCP port number (with -1 as legacy syntax indicating
- that it should be auto-allocated). The <code>autoport</code> attribute
- is the new preferred syntax for indicating autoallocation of the TCP
- port to use. The <code>replaceUser</code> attribute is a boolean deciding
- whether multiple simultaneous connections to the VM are permitted.
- The <code>multiUser</code> whether the existing connection must be dropped
- and a new connection must be established by the VRDP server, when a new
- client connects in single connection mode.
-
+ Starts a RDP server. The <code>port</code> attribute
+ specifies the TCP port number (with -1 as legacy syntax
+ indicating that it should be
+ auto-allocated). The <code>autoport</code> attribute is
+ the new preferred syntax for indicating autoallocation of
+ the TCP port to use. The <code>replaceUser</code>
+ attribute is a boolean deciding whether multiple
+ simultaneous connections to the VM are permitted.
+ The <code>multiUser</code> whether the existing connection
+ must be dropped and a new connection must be established
+ by the VRDP server, when a new client connects in single
+ connection mode.
</dd>
<dt><code>"desktop"</code></dt>
<dd>
- This value is reserved for VirtualBox domains for the moment. It displays
- a window on the host desktop, similarly to "sdl", but using the VirtualBox
- viewer. Just like "sdl", it accepts the optional attributes <code>display</code>
- and <code>fullscreen</code>.
+ This value is reserved for VirtualBox domains for the
+ moment. It displays a window on the host desktop,
+ similarly to "sdl", but using the VirtualBox viewer. Just
+ like "sdl", it accepts the optional
+ attributes <code>display</code>
+ and <code>fullscreen</code>.
</dd>
</dl>
</dd>
@@ -2389,8 +2417,9 @@ qemu-kvm -net nic,model=? /dev/null
...</pre>
<p>
- Alternatively you can use <code>telnet</code> instead of <code>raw</code> TCP.
- <span class="since">Since 0.8.5</span> you can also use <code>telnets</code>
+ Alternatively you can use <code>telnet</code> instead
+ of <code>raw</code> TCP. <span class="since">Since 0.8.5</span>
+ you can also use <code>telnets</code>
(secure telnet) and <code>tls</code>.
</p>
--
1.7.4.4
13 years, 5 months
Re: [libvirt] php-virt-control
by Michal Novotny
On 07/03/2011 05:28 PM, Andreas Cymbal wrote:
>
> Hello i have some problem with php-virt-control
>
> */Message:/**/ /*/Cannot connect to hypervisor. Please change
> connection information. /(Local)//
>
> Virt-manager run without Problems
>
> Virsh run only with sudo virsh
>
> My System is Ubuntu 10.04 LTS 64
>
> With Xen 4.1.1 and 2.6.32.40
>
> Libvirt 0.9.2
>
> How does xen+ssh work without any password or ssh keys?
>
> Yours AndrewCat
>
Hi Andrew,
it can't. The xen+ssh or anything+ssh is requiring the keys since
libvirt is using ssh command directly and not libssh2 so it doesn't work
even with the password specified. The only thing you have to do it to
provide the SSH keys to the apache.
You can run the 'tools/apache-key-copy' tool from the repository which
will automatically generate the keys for user "apache" if it doesn't
exist and copy it to the remote host which is required.
If you see the message about libvirt-php cannot connect to the
hypervisor then you should try setting up the connection information in
the form at the bottom of the page. Is the system having the PolicyKit
or something similar to this? You need to enable the authentication for
virsh not to require password for the connection to 'xen:///' (which
should be the local Xen connection URI).
For more information about authentication please see the libvirt
authentication page at http://libvirt.org/auth.html .
Thanks,
Michal
--
Michal Novotny <minovotn(a)redhat.com>, RHCE, Red Hat
Virtualization | libvirt-php bindings | php-virt-control.org
13 years, 5 months
[libvirt] 腾讯 could you give me any suggestions when running libvirtd in the container
by kevenzhu(朱以军)
Hi all:
we manage the contaienr vms using libvirt, and we want to mornitor the vms by running the libvirtd in the container.
but there is something wrong with it, a lock in the kernel is crashed. if you run the "sudo" or "ping" .etc, the system
call can NOT be returned, the status of the command is D.
would you like to give me the hand.
Thank you
BR.
13 years, 5 months
[libvirt] [PATCHv2 0/2] delete unnecessary white space of sysinfo.
by Minoru Usui
sysinfo: delete unnecessary white space of sysinfo.
This is v2 of delete unnecessary white space of sysinfo.
Changes
v1->v2:
- Rebase latest libvirt GIT tree.
- Use c_isspace() in virSkipSpacesBackwards().
Minoru Usui (2):
sysinfo: add virSkipSpacesBackwards()
sysinfo: delete unnecessary white space of sysinfo.
src/util/sysinfo.c | 21 +++++++++++++++++++++
src/util/util.c | 25 +++++++++++++++++++++++++
src/util/util.h | 1 +
3 files changed, 47 insertions(+), 0 deletions(-)
--
Minoru Usui <usui(a)mxm.nes.nec.co.jp>
13 years, 5 months
[libvirt] building error
by Wen Congyang
When I build libvirt, I meet the following error:
make[3]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.2/daemon'
CC libvirtd-libvirtd.o
CC libvirtd-remote.o
remote.c: In function 'remoteDispatchAuthPolkit':
remote.c:2043: error: invalid initializer
make[3]: *** [libvirtd-remote.o] Error 1
This patch can fix the problem. But I do not know whether it is right.
>From b03a5c08b751440460bf4cb02fea061b77fb3ef5 Mon Sep 17 00:00:00 2001
From: Wen Congyang <wency(a)cn.fujitsu.com>
Date: Wed, 29 Jun 2011 19:04:19 +0800
Subject: [PATCH 1/2] daemon: Fix building error with polkit1
---
daemon/remote.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 9e6cf77..042894b 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -2041,7 +2041,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
goto authdeny;
}
PROBE(CLIENT_AUTH_ALLOW, "fd=%d, auth=%d, username=%s",
- virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, ident);
+ virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, (char *)ident);
VIR_INFO("Policy allowed action %s from pid %d, uid %d",
action, callerPid, callerUid);
ret->complete = 1;
--
1.7.1
13 years, 5 months
[libvirt] libvirt 0.9.3, missing header
by Jason Helfman
When building the latest code in a clean building environment, with sasl
disabled, I get this error:
gmake[3]: Entering directory
`/work/a/ports/devel/libvirt/work/libvirt-0.9.3/daemon'
CC libvirtd-libvirtd.o
In file included from libvirtd.h:41,
from libvirtd.c:41:
../src/rpc/virnetsaslcontext.h:24:24: error: sasl/sasl.h: No such file or
directory
In file included from libvirtd.h:41,
from libvirtd.c:41:
../src/rpc/virnetsaslcontext.h:54: warning: type defaults to 'int' in
declaration of 'sasl_callback_t'
../src/rpc/virnetsaslcontext.h:54: error: expected ';', ',' or ')' before
'*' token
../src/rpc/virnetsaslcontext.h:78: error: expected declaration specifiers or
'...' before 'sasl_interact_t'
../src/rpc/virnetsaslcontext.h:86: error: expected declaration specifiers or
'...' before 'sasl_interact_t'
gmake[3]: *** [libvirtd-libvirtd.o] Error 1
gmake[3]: Leaving directory
`/work/a/ports/devel/libvirt/work/libvirt-0.9.3/daemon'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/work/a/ports/devel/libvirt/work/libvirt-0.9.3/daemon'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/work/a/ports/devel/libvirt/work/libvirt-0.9.3'
gmake: *** [all] Error 2
*** Error code 1
Any ideas?
Thanks,
Jason
--
Jason Helfman
System Administrator
experts-exchange.com
http://www.experts-exchange.com/M_4830110.html
E4AD 7CF1 1396 27F6 79DD 4342 5E92 AD66 8C8C FBA5
13 years, 5 months