[libvirt] [PATCH] Cosmetics: Remove semicolons
by Guido Günther
It's Python, not C
---
python/libvirt-override.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/libvirt-override.py b/python/libvirt-override.py
index 8427eab..82d7dcb 100644
--- a/python/libvirt-override.py
+++ b/python/libvirt-override.py
@@ -107,9 +107,9 @@ def getVersion (name = None):
Versions numbers are integers: 1000000*major + 1000*minor + release."""
if name is None:
- ret = libvirtmod.virGetVersion ();
+ ret = libvirtmod.virGetVersion ()
else:
- ret = libvirtmod.virGetVersion (name);
+ ret = libvirtmod.virGetVersion (name)
if ret is None: raise libvirtError ("virGetVersion() failed")
return ret
@@ -132,7 +132,7 @@ def _eventInvokeHandleCallback(watch, fd, event, opaque, opaquecompat=None):
callback = opaque[0]
opaque = opaque[1]
- libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque);
+ libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque)
#
# Invoke an EventTimeout callback
@@ -152,7 +152,7 @@ def _eventInvokeTimeoutCallback(timer, opaque, opaquecompat=None):
callback = opaque[0]
opaque = opaque[1]
- libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque);
+ libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque)
def _dispatchEventHandleCallback(watch, fd, events, cbData):
cb = cbData["cb"]
--
1.7.10.4
11 years, 8 months
[libvirt] Failed to to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
by Yin Olivia-R63875
Hi,
I tried to build and run libvirt-1.0.1 on FSL PowerPC platform.
The connection to '/var/run/libvirt/libvirt-sock' is always refused.
# libvirtd -d
# export LIBVIRT_DEBUG=1
# export LIBVIRT_LOG_OUTPUTS="1:file:virsh.log"
# virsh -c qemu:///system list
2013-01-10 04:55:20.409+0000: 2574: info : libvirt version: 1.0.1
2013-01-10 04:55:20.409+0000: 2574: debug : virLogParseOutputs:1288 : outputs=1:file:virsh.log
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
Exactly it could work with libvirt-0.10.1. Below are the debug messages with both versions.
# cat virsh.log
-------------------------
1). libvirt-1.0.1
-------------------------
<cut>
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1145 : name "qemu:///system" to URI components:
scheme qemu
server (null)
user (null)
port 0
path /system
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1191 : trying driver 0 (Test) ...
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1197 : driver 0 Test returned DECLINED
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1191 : trying driver 1 (OPENVZ) ...
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1197 : driver 1 OPENVZ returned DECLINED
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1191 : trying driver 2 (VMWARE) ...
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1197 : driver 2 VMWARE returned DECLINED
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1191 : trying driver 3 (VBOX) ...
2013-01-10 06:12:12.107+0000: 2340: debug : do_open:1197 : driver 3 VBOX returned DECLINED
2013-01-10 06:12:12.108+0000: 2340: debug : do_open:1191 : trying driver 4 (remote) ...
2013-01-10 06:12:12.108+0000: 2340: debug : doRemoteOpen:586 : proceeding with name = qemu:///system
2013-01-10 06:12:12.108+0000: 2340: debug : doRemoteOpen:595 : Connecting with transport 1
2013-01-10 06:12:12.108+0000: 2340: debug : doRemoteOpen:671 : Proceeding with sockname /var/run/libvirt/libvirt-sock
2013-01-10 06:12:12.108+0000: 2340: error : virNetSocketNewConnectUNIX:570 : Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
2013-01-10 06:12:12.108+0000: 2340: debug : virFileClose:72 : Closed fd 7
2013-01-10 06:12:12.108+0000: 2340: debug : virNetClientCloseInternal:698 : client=(nil) wantclose=0
2013-01-10 06:12:12.108+0000: 2340: debug : do_open:1197 : driver 4 remote returned ERROR
2013-01-10 06:12:12.108+0000: 2340: debug : virObjectUnref:135 : OBJECT_UNREF: obj=0x48900648
2013-01-10 06:12:12.108+0000: 2340: debug : virObjectUnref:137 : OBJECT_DISPOSE: obj=0x48900648
2013-01-10 06:12:12.108+0000: 2340: debug : virEventPollAddTimeout:225 : Used 0 timeout slots, adding at least 10 more
2013-01-10 06:12:12.108+0000: 2340: debug : virEventPollInterruptLocked:716 : Interrupting
2013-01-10 06:12:12.108+0000: 2340: debug : virEventPollAddTimeout:248 : EVENT_POLL_ADD_TIMEOUT: timer=1 frequency=0 cb=0x10008624 opa
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollRunOnce:640 : Poll got 1 event(s)
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollDispatchTimeouts:425 : Dispatch 1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollDispatchTimeouts:448 : EVENT_POLL_DISPATCH_TIMEOUT: timer=1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollDispatchHandles:470 : Dispatch 1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollDispatchHandles:484 : i=0 w=1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1 events=1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollCleanupTimeouts:516 : Cleanup 1
2013-01-10 06:12:12.108+0000: 2341: debug : virEventPollCleanupHandles:564 : Cleanup 1
2013-01-10 06:12:12.108+0000: 2340: debug : virEventPollRemoveTimeout:300 : EVENT_POLL_REMOVE_TIMEOUT: timer=1
2013-01-10 06:12:12.108+0000: 2340: debug : virEventPollInterruptLocked:712 : Skip interrupt, 0 1216382096
<cut>
-------------------------
2). libvirt-0.10.1
-------------------------
<cut>
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1127 : name "qemu:///system" to URI components:
scheme qemu
server (null)
user (null)
port 0
path /system
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1174 : trying driver 0 (Test) ...
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1180 : driver 0 Test returned DECLINED
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1174 : trying driver 1 (OPENVZ) ...
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1180 : driver 1 OPENVZ returned DECLINED
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1174 : trying driver 2 (VMWARE) ...
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1180 : driver 2 VMWARE returned DECLINED
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1174 : trying driver 3 (VBOX) ...
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1180 : driver 3 VBOX returned DECLINED
2013-01-10 06:06:27.275+0000: 2393: debug : do_open:1174 : trying driver 4 (remote) ...
2013-01-10 06:06:27.275+0000: 2393: debug : doRemoteOpen:576 : proceeding with name = qemu:///system
2013-01-10 06:06:27.276+0000: 2393: debug : doRemoteOpen:585 : Connecting with transport 1
2013-01-10 06:06:27.276+0000: 2393: debug : doRemoteOpen:661 : Proceeding with sockname /var/run/libvirt/libvirt-sock
2013-01-10 06:06:27.277+0000: 2393: debug : virNetSocketNew:146 : localAddr=0xbff169d4 remoteAddr=0xbff16a58 fd=7 errfd=-1 pid=0
2013-01-10 06:06:27.277+0000: 2393: debug : virObjectNew:110 : OBJECT_NEW: obj=0x48900dc8 classname=virNetSocket
2013-01-10 06:06:27.277+0000: 2393: debug : virNetSocketNew:203 : RPC_SOCKET_NEW: sock=0x48900dc8 fd=7 errfd=-1 pid=0 localAddr=127.0.
2013-01-10 06:06:27.277+0000: 2393: debug : virObjectNew:110 : OBJECT_NEW: obj=0x48900ff8 classname=virNetClient
2013-01-10 06:06:27.277+0000: 2393: debug : virNetClientNew:342 : RPC_CLIENT_NEW: client=0x48900ff8 sock=0x48900dc8
2013-01-10 06:06:27.277+0000: 2393: debug : virObjectRef:168 : OBJECT_REF: obj=0x48900ff8
2013-01-10 06:06:27.277+0000: 2393: debug : virObjectRef:168 : OBJECT_REF: obj=0x48900dc8
2013-01-10 06:06:27.277+0000: 2393: debug : virEventPollInterruptLocked:701 : Interrupting
2013-01-10 06:06:27.277+0000: 2393: debug : virEventPollAddHandle:136 : EVENT_POLL_ADD_HANDLE: watch=2 fd=7 events=1 cb=0xf7bad00 opaq
2013-01-10 06:06:27.277+0000: 2394: debug : virEventPollRunOnce:625 : Poll got 1 event(s)
2013-01-10 06:06:27.277+0000: 2393: debug : virKeepAliveNew:212 : client=0x48900ff8, interval=-1, count=0
<cut>
I checked the source codes of function src/rpc/virnetsocket.c and there's no change on function virNetSocketNewConnectUNIX().
Best Regards,
Olivia
11 years, 8 months
[libvirt] [PATCH 0/8 v2] Persistent vHBA support in storage pool
by Osier Yang
This is the 3rd part to implement NPIV migration support [1].
Part 1: (New version)
https://www.redhat.com/archives/libvir-list/2013-February/msg00112.html
Part 2: (Already ACKed by Michal)
https://www.redhat.com/archives/libvir-list/2013-January/msg00859.html
Part 4: (Partly ACKed by John)
https://www.redhat.com/archives/libvir-list/2013-January/msg02113.html
The patches are based on Part 2.
The new XMLs might be too long, might be deserved to have them as
sub-elements of <adapter>. But I'd like to see the feedback first.
Osier Yang (8):
New XML attributes for storage pool source adapter
storage: Make the adapter name be consistent with node device driver
storage: Move virStorageBackendSCSIGetHostNumber into iscsi backend
phyp: Prohibit fc_host adapter for phyp driver
util: Add helper to get the scsi host name by iterating over sysfs
util: Fix bug of managing vport
storage: Add startPool and stopPool for scsi backend
storage: Guess the parent if it's not specified for vHBA
docs/formatstorage.html.in | 15 ++-
docs/schemas/storagepool.rng | 33 +++++-
src/conf/storage_conf.c | 123 ++++++++++++++++--
src/conf/storage_conf.h | 23 +++-
src/libvirt_private.syms | 4 +
src/phyp/phyp_driver.c | 15 ++-
src/storage/storage_backend_iscsi.c | 39 ++++++-
src/storage/storage_backend_scsi.c | 190 +++++++++++++++++++--------
src/storage/storage_backend_scsi.h | 3 -
src/util/virutil.c | 196 +++++++++++++++++++++++++++-
src/util/virutil.h | 7 +
tests/storagepoolxml2xmlin/pool-scsi.xml | 2 +-
tests/storagepoolxml2xmlin/pool-scsi1.xml | 15 ++
tests/storagepoolxml2xmlout/pool-scsi.xml | 2 +-
tests/storagepoolxml2xmlout/pool-scsi1.xml | 18 +++
tests/storagepoolxml2xmltest.c | 1 +
16 files changed, 602 insertions(+), 84 deletions(-)
create mode 100644 tests/storagepoolxml2xmlin/pool-scsi1.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-scsi1.xml
[1] https://www.redhat.com/archives/libvir-list/2012-November/msg00826.html
Regards,
Osier
11 years, 8 months
[libvirt] [PATCH v3 00/13] documentation improvements, code blocks with syntax highlighting
by Claudio Bley
Hi.
This is version 3 of
https://www.redhat.com/archives/libvir-list/2013-January/msg02026.html
combined with pre-requisite patches from
https://www.redhat.com/archives/libvir-list/2013-January/msg02071.html
Summary of the changes:
- patch #1 to #4 are adding / fixing missing documentation,
which is required so the next patch does not break the build
- patch #5 aborts the build when documentation is missing for
function arguments or the return value, except for those functions
being part of the "ignored_functions" dictionary
- patch #11 also adds an exception to syntax rules for the
generated SHJS files
- patch #12, #13 just add some indentation to make code blocks
properly recognized
This time, I did use make check and make syntax-check after every
patch, so this should be OK. (fingers crossed)
Claudio Bley (13):
libvirt.h.in: add missing documentation for virConnectCloseFunc
libvirt.h.in: fix documentation for
virConnectDomainEventBlockJobCallback
libvirt.h.in: add missing return doc for virEventRemoveHandleFunc
libvirt.h.in: document virConnectDomainEventCallback's return value
docs: abort when missing return or argument documentation
docs: only generate function argument info for args with a
description
docs: use div, not table, for notices on opaque types
docs: process code blocks similar to markdown
docs: add class "description" to div's containing descriptions
docs: define style of code blocks inside descriptions
docs: syntax highlight code blocks using SHJS
libvirt.c: indent code of virDomainGetMemoryParameters's
documentation
libvirt.c: add 2 spaces of indentation to example code
cfg.mk | 2 +-
docs/apibuild.py | 18 +++-
docs/libvirt.css | 8 ++
docs/newapi.xsl | 209 +++++++++++++++++++++++++-----------------
docs/page.xsl | 5 +-
docs/sh_c.min.js | 1 +
docs/sh_emacs.min.css | 1 +
docs/sh_main.min.js | 4 +
include/libvirt/libvirt.h.in | 16 +++-
src/libvirt.c | 130 +++++++++++++-------------
10 files changed, 241 insertions(+), 153 deletions(-)
create mode 100644 docs/sh_c.min.js
create mode 100644 docs/sh_emacs.min.css
create mode 100644 docs/sh_main.min.js
--
1.7.9.5
11 years, 8 months
[libvirt] [Patch]Fix bugs of Sheepdog storage driver
by harryxiyou@gmail.com
Signed-off-by: Harry Wei <harryxiyou(a)gmail.com>
---
src/storage/storage_backend_sheepdog.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
index cd18f33..2cbfe01 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virCommandAddArgFormat(cmd, "%llu", vol->capacity);
virStorageBackendSheepdogAddHostArg(cmd, pool);
ret = virCommandRun(cmd, NULL);
+ if (ret < 0)
+ goto cleanup;
- virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+ ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+cleanup:
virCommandFree(cmd);
return ret;
}
--
1.7.0.4
11 years, 8 months
[libvirt] [PATCH v2 0/6] Add support for qcow3 images
by Ján Tomko
Add support for creating qcow3 images with or without lazy_refcounts,
using them with qemu and creating snapshots (both internal and external).
Diff to V1:
https://www.redhat.com/archives/libvir-list/2013-January/msg00610.html
* only use one bitmap for all features (and one <features> element)
* support snapshots
* detect which features are supported by qemu-img
Ján Tomko (6):
storage: refactor qemu-img command line generation
util: use helper functions for extracting image headers
util: add support for probing qcow3 images
qemu: add support for running domains with qcow3 images
storage: add support for creating qcow3 images
qemu: add qcow3 support to external snapshots
docs/formatsnapshot.html.in | 7 +
docs/formatstorage.html.in | 14 +-
docs/schemas/Makefile.am | 1 +
docs/schemas/domaincommon.rng | 1 +
docs/schemas/domainsnapshot.rng | 4 +
docs/schemas/storagefeatures.rng | 17 +++
docs/schemas/storagevol.rng | 6 +-
libvirt.spec.in | 1 +
mingw-libvirt.spec.in | 2 +
src/conf/snapshot_conf.c | 63 +++++++++
src/conf/snapshot_conf.h | 2 +
src/conf/storage_conf.c | 69 ++++++++++
src/conf/storage_conf.h | 4 +
src/libvirt_private.syms | 4 +
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_driver.c | 24 +++-
src/qemu/qemu_hotplug.c | 4 +-
src/storage/storage_backend.c | 189 ++++++++++++++++++-------
src/storage/storage_backend_fs.c | 6 +
src/util/virstoragefile.c | 288 ++++++++++++++++++++++++++-------------
src/util/virstoragefile.h | 13 ++
21 files changed, 565 insertions(+), 156 deletions(-)
create mode 100644 docs/schemas/storagefeatures.rng
--
1.7.12.4
11 years, 8 months
[libvirt] [Patch]Sheepdog storage driver ignore refreshVol func's return value
by harryxiyou
Hi all,
In libvirt/src/storage/storage_backend_sheepdog.c file, func
virStorageBackendSheepdogCreateVol calls func
virStorageBackendSheepdogRefreshVol to refresh Sheepdog volume infos.
But we do not check func virStorageBackendSheepdogRefreshVol's return
value. Following patch can fix this bug.
Signed-off-by: Harry Wei <harryxiyou(a)gmail.com>
Subject: [PATCH] sheepdog driver ignore return value for refresh volume
---
src/storage/storage_backend_sheepdog.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_sheepdog.c
b/src/storage/storage_backend_sheepdog.c
index 66d8fb4..e72c944 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr
conn ATTRIBUTE_UNUSED,
virCommandAddArgFormat(cmd, "%llu", vol->capacity);
virStorageBackendSheepdogAddHostArg(cmd, pool);
ret = virCommandRun(cmd, NULL);
+ if (0 > ret)
+ goto cleanup;
- virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+ ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+cleanup:
virCommandFree(cmd);
return ret;
}
--
1.7.0.4
--
Thanks
Harry Wei
11 years, 8 months
[libvirt] [PATCH] build: fix build of HAL node backend
by Eric Blake
Commit 2025356 missed uses of PCI functions in the older HAL-related
code, probably because hal-devel is no longer available in latest Fedora.
* src/node_device/node_device_hal.c (gather_pci_cap): Reflect
function rename.
---
Pushing under the build-breaker rule.
src/node_device/node_device_hal.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 610df8d..2ecb1de 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -1,7 +1,7 @@
/*
* node_device_hal.c: node device enumeration - HAL-based implementation
*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011, 2013 Red Hat, Inc.
* Copyright (C) 2008 Virtual Iron Software, Inc.
* Copyright (C) 2008 David F. Lively
*
@@ -148,10 +148,12 @@ static int gather_pci_cap(LibHalContext *ctx, const char *udi,
(void)virStrToLong_ui(p+1, &p, 16, &d->pci_dev.function);
}
- if (!pciGetPhysicalFunction(sysfs_path, &d->pci_dev.physical_function))
+ if (!virPCIGetPhysicalFunction(sysfs_path,
+ &d->pci_dev.physical_function))
d->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION;
- if (!pciGetVirtualFunctions(sysfs_path, &d->pci_dev.virtual_functions,
+ if (!virPCIGetVirtualFunctions(sysfs_path,
+ &d->pci_dev.virtual_functions,
&d->pci_dev.num_virtual_functions) ||
d->pci_dev.num_virtual_functions > 0)
d->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
--
1.7.1
11 years, 8 months
[libvirt] virsh nodeinfo CPU detection questions
by Scott Sullivan
I have a machine with four AMD Opteron(TM) 6272 processors:
http://www.amd.com/us/products/server/processors/6000-series-platform/620...
I use 'virsh nodeinfo' to determine the amount of physical CPUs, and CPU
cores. What values should I be looking at in the output of nodeinfo to
determine this? With 1.X libvirts the output values have changed from 0.9.4:
0.9.4:
[root@host ~]# virsh nodeinfo
CPU model: x86_64
CPU(s): 64
CPU frequency: 2099 MHz
CPU socket(s): 4
Core(s) per socket: 8
Thread(s) per core: 2
NUMA cell(s): 1
Memory size: 24713980 kB
[root@host28 ~]#
1.0.1:
[root@host ~]# virsh nodeinfo
CPU model: x86_64
CPU(s): 64
CPU frequency: 2099 MHz
CPU socket(s): 1
Core(s) per socket: 8
Thread(s) per core: 2
NUMA cell(s): 4
Memory size: 24713980 KiB
[root@host28 ~]#
As you can see, the CPU socket and NUMA cells values have changed in
these two versions, on the same machine. To get the physical CPU count,
is it safe to assume this?
Numa cell(s) X CPU Socket(s) == physical CPUs present
However, I am not positive what formula I should use to determine the
CPU core count. On this processor, it has 16 cores. Would that mean I
can do this?
Core(s) per socket X Thread(s) per core: == CPU cores
Thanks in advance for clarifying.
11 years, 8 months