[libvirt] [PATCH] virsh:remove the dead code
by sochin jiang
This patch remove the dead code I found.
Signed-off-by: sochin jiang <sochin.jiang(a)huawei.com>
---
tools/virsh-domain.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3a6fa5c..6dae5cc 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1005,7 +1005,6 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, _("No support for %s in command 'attach-interface'"),
type);
goto cleanup;
- break;
}
if (target != NULL)
@@ -7365,7 +7364,6 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, _("CPU described in %s is incompatible with host CPU\n"),
from);
goto cleanup;
- break;
case VIR_CPU_COMPARE_IDENTICAL:
vshPrint(ctl, _("CPU described in %s is identical to host CPU\n"),
--
1.8.3.1
7 years, 11 months
[libvirt] [PATCH 0/2] qemu_cgroup: allow access to /dev/dri/render*
by Ján Tomko
Technically a v2, but v1 is already pushed.
This version is based on the <gl enable> in <spice> instead
of accel3d="yes" in <video><model type="virtio".
It also only allows access to the render* devices, instead of all of them.
https://bugzilla.redhat.com/show_bug.cgi?id=1337290
Ján Tomko (2):
Revert "qemu_cgroup: allow access to /dev/dri for virtio-vga"
qemu_cgroup: allow access to /dev/dri/render*
src/qemu/qemu_cgroup.c | 71 ++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 57 insertions(+), 14 deletions(-)
--
2.7.3
7 years, 11 months
[libvirt] [PATCH v4 0/4] gluster: cache glfs connection object per volume
by Prasanna Kumar Kalever
v4: Address review comments from Peter on v3
Patch 1: changes to fix test failures
(qemuargv2xmltest, qemuxml2argvtest, qemuxml2xmltest and virstoragetest)
Patch 2: fix hung in qemuxml2argvtest
Patch 3 v3: Split this Patch to 2 parts as below
Patch 3 v4: don't free metadata used for storage driver access
Patch 4:
* update variable naming as per standards
* virStorageBackendGlusterPreopened* -> virStorageBackendGlusterCache*
Thanks Peter!
v3: Address comments by Daniel and Peter on v2
* Split the patch to 3 parts
Patch 1: change the virStorageNetHostDef type
Patch 2: optimize calls to virStorageFileInit and friends
Patch 3: add the caching for glfs
* Thanks to Daniel, this version make all the methods as thread safe
* Thanks to Peter for pointing use of virObjectLockable, this had simplified
rest of the parts a lot.
v2: Address review comments from Peter on v1
* Rebased on latest master
* Changes to commit msg
* Introduce storage API's for Register and Unregister of volume
* During qemu process Start/Stop and snapshot create
* Check Transport and Port type
* Atomic element add/del to list and ref counting
Pending: Treating IP and FQDN belong to same host
v1: Initial patch
Prasanna Kumar Kalever (4):
util: change the virStorageNetHostDef type
storage: optimize calls to virStorageFileInit and friends
virStorageFileDeinit: don't free metadata used for storage driver
access
gluster: cache glfs connection object per volume
src/conf/domain_conf.c | 52 +++---
src/qemu/qemu_command.c | 68 ++++----
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domain.h | 5 +
src/qemu/qemu_driver.c | 40 +++--
src/qemu/qemu_parse_command.c | 44 +++--
src/qemu/qemu_process.c | 47 ++++++
src/qemu/qemu_process.h | 4 +
src/storage/storage_backend_fs.c | 2 +
src/storage/storage_backend_gluster.c | 299 ++++++++++++++++++++++++++++++----
src/storage/storage_driver.c | 23 +--
src/util/virstoragefile.c | 85 +++++-----
src/util/virstoragefile.h | 20 ++-
tests/virstoragetest.c | 2 +-
14 files changed, 512 insertions(+), 181 deletions(-)
--
2.7.4
7 years, 11 months
[libvirt] [PATCH v2 0/2] libxl QED support
by Cédric Bosdonnat
Hi all,
Just added on patch before the QED one to add default: cases
in xenParseXLDisk to avoid build failures when building on more
uptodate xen.
Cédric Bosdonnat (2):
xenconfig: add default in xenParseXLDisk()'s switches
libxl: add QED disk format support
src/libxl/libxl_conf.c | 11 +++++++++++
src/xenconfig/xen_xl.c | 15 +++++++++++++++
2 files changed, 26 insertions(+)
--
2.11.0
7 years, 11 months
[libvirt] [PATCH] ZFS: Add vol-resize support
by Sergei A Mamonov
Add virStorageBackendZFSResizeVol method for storage_backend_zfs.c
---
src/storage/storage_backend_zfs.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index 3a43be4..8e57d72 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -454,6 +454,33 @@ virStorageBackendZFSDeletePool(virConnectPtr conn ATTRIBUTE_UNUSED,
return ret;
}
+static int
+virStorageBackendZFSResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virStoragePoolObjPtr pool,
+ virStorageVolDefPtr vol,
+ unsigned long long capacity,
+ unsigned int flags)
+{
+ int ret = -1;
+ virCommandPtr resize_cmd = NULL;
+
+ virCheckFlags(VIR_STORAGE_VOL_RESIZE_SHRINK, -1);
+
+ resize_cmd = virCommandNewArgList(ZFS, "set", NULL);
+
+ virCommandAddArgFormat(resize_cmd, "volsize=%llu", capacity);
+ virCommandAddArgFormat(resize_cmd, "%s/%s",
+ pool->def->source.name, vol->name);
+
+ if (virCommandRun(resize_cmd, NULL) < 0)
+ goto cleanup;
+
+ ret = 0;
+ cleanup:
+ virCommandFree(resize_cmd);
+ return ret;
+}
+
virStorageBackend virStorageBackendZFS = {
.type = VIR_STORAGE_POOL_ZFS,
@@ -465,4 +492,5 @@ virStorageBackend virStorageBackendZFS = {
.deletePool = virStorageBackendZFSDeletePool,
.uploadVol = virStorageBackendVolUploadLocal,
.downloadVol = virStorageBackendVolDownloadLocal,
+ .resizeVol = virStorageBackendZFSResizeVol,
};
--
1.8.3.1
7 years, 11 months
[libvirt] [PATCH v5 0/2] List only online cpus for vcpupin/emulatorpin when vcpu placement static
by Nitesh Konkar
Currently when the vcpu placement is static and
cpuset is not specified, CPU Affinity shows 0..
CPUMAX. This patchset will result in display of
only online CPU's under CPU Affinity on linux.
Fixes the following Bug:
virsh dumpxml Fedora
<domain type='kvm' id='4'>
<name>Fedora</name>
<uuid>aecf3e5e-6f9a-42a3-9d6a-223a75569a66</uuid>
<maxMemory slots='32' unit='KiB'>3145728</maxMemory>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static' current='8'>160</vcpu>
<resource>
<partition>/machine</partition>
</resource>
.....................
.......................
.........................
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+0:+0</label>
<imagelabel>+0:+0</imagelabel>
</seclabel>
</domain>
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-2,4-7
Off-line CPU(s) list: 3
Thread(s) per core: 1
Core(s) per socket: 7
Socket(s): 1
..........
..........
NUMA node0 CPU(s): 0-2,4-7
NUMA node1 CPU(s):
cat /sys/devices/system/cpu/online
0-2,4-7
Before Patch
virsh vcpupin Fedora
VCPU: CPU Affinity
----------------------------------
0: 0-7
1: 0-7
...
...
158: 0-7
159: 0-7
virsh emulatorpin Fedora
emulator: CPU Affinity
----------------------------------
*: 0-7
After Patch
virsh vcpupin Fedora
VCPU: CPU Affinity
----------------------------------
0: 0-2,4-7
1: 0-2,4-7
...
...
158: 0-2,4-7
159: 0-2,4-7
virsh emulatorpin Fedora
emulator: CPU Affinity
----------------------------------
*: 0-2,4-7
Nitesh Konkar (2):
conf: List only online cpus for virsh vcpupin
conf: List only online cpus for virsh emulatorpin
src/conf/domain_conf.c | 6 ++++++
src/qemu/qemu_driver.c | 5 +++++
2 files changed, 11 insertions(+)
--
2.1.0
7 years, 11 months
[libvirt] [PATCH] Remove reference to enum that never existed
by Daniel P. Berrange
The virDomainSendProcessSignal method says the flags values
come from virDomainProcessSignalFlag, but this enum has
never existed. No flags are needed for this method.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed under trivial docs rule.
src/libvirt-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index b287a39..dd9b800 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -6866,7 +6866,7 @@ virDomainSendKey(virDomainPtr domain,
* @domain: pointer to domain object
* @pid_value: a positive integer process ID, or negative integer process group ID
* @signum: a signal from the virDomainProcessSignal enum
- * @flags: one of the virDomainProcessSignalFlag values
+ * @flags: currently unused, pass 0
*
* Send a signal to the designated process in the guest
*
--
2.9.3
7 years, 11 months
[libvirt] [PATCH] virjson: Remove const from virJSONValueObjectForeachKeyValue
by Jiri Denemark
Almost none of our virJSONValue*Get* functions accept const virJSONValue
pointers and it wouldn't even make sense since we sometimes modify what
we get. And because there is no reason for preventing callers of
virJSONValueObjectForeachKeyValue from modifying the values they get in
each iteration we can just stop doing it.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/util/virjson.c | 2 +-
src/util/virjson.h | 4 ++--
src/util/virqemu.c | 16 ++++++++--------
src/util/virqemu.h | 10 +++++-----
src/util/virstoragefile.c | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index b42211c0d..3804e7e97 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1321,7 +1321,7 @@ virJSONValueObjectIsNull(virJSONValuePtr object,
* during iteration and -1 on generic errors.
*/
int
-virJSONValueObjectForeachKeyValue(const virJSONValue *object,
+virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
virJSONValueObjectIteratorFunc cb,
void *opaque)
{
diff --git a/src/util/virjson.h b/src/util/virjson.h
index 5b4f17253..122de96c5 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -172,10 +172,10 @@ char *virJSONValueToString(virJSONValuePtr object,
bool pretty);
typedef int (*virJSONValueObjectIteratorFunc)(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque);
-int virJSONValueObjectForeachKeyValue(const virJSONValue *object,
+int virJSONValueObjectForeachKeyValue(virJSONValuePtr object,
virJSONValueObjectIteratorFunc cb,
void *opaque);
diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index 7849d8b3e..2e9e65f9e 100644
--- a/src/util/virqemu.c
+++ b/src/util/virqemu.c
@@ -42,7 +42,7 @@ struct virQEMUCommandLineJSONIteratorData {
static int
virQEMUBuildCommandLineJSONRecurse(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc,
bool nested);
@@ -51,7 +51,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
int
virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf)
{
ssize_t pos = -1;
@@ -81,10 +81,10 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
int
virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf)
{
- const virJSONValue *member;
+ virJSONValuePtr member;
char *prefix = NULL;
size_t i;
int ret = 0;
@@ -114,7 +114,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
/* internal iterator to handle nested object formatting */
static int
virQEMUBuildCommandLineJSONIterate(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque)
{
struct virQEMUCommandLineJSONIteratorData *data = opaque;
@@ -140,7 +140,7 @@ virQEMUBuildCommandLineJSONIterate(const char *key,
static int
virQEMUBuildCommandLineJSONRecurse(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc,
bool nested)
@@ -225,7 +225,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
* Returns 0 on success -1 on error.
*/
int
-virQEMUBuildCommandLineJSON(const virJSONValue *value,
+virQEMUBuildCommandLineJSON(virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc array)
{
@@ -264,7 +264,7 @@ virQEMUBuildObjectCommandlineFromJSON(const char *type,
char *
-virQEMUBuildDriveCommandlineFromJSON(const virJSONValue *srcdef)
+virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr srcdef)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
char *ret = NULL;
diff --git a/src/util/virqemu.h b/src/util/virqemu.h
index f3c2b6956..539d62ab1 100644
--- a/src/util/virqemu.h
+++ b/src/util/virqemu.h
@@ -30,16 +30,16 @@
# include "virstorageencryption.h"
typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
int virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
int virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
- const virJSONValue *array,
+ virJSONValuePtr array,
virBufferPtr buf);
-int virQEMUBuildCommandLineJSON(const virJSONValue *value,
+int virQEMUBuildCommandLineJSON(virJSONValuePtr value,
virBufferPtr buf,
virQEMUBuildCommandLineJSONArrayFormatFunc array);
@@ -47,7 +47,7 @@ char *virQEMUBuildObjectCommandlineFromJSON(const char *type,
const char *alias,
virJSONValuePtr props);
-char *virQEMUBuildDriveCommandlineFromJSON(const virJSONValue *src);
+char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src);
void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
void virQEMUBuildLuksOpts(virBufferPtr buf,
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index f750e121a..9ec005d50 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2990,7 +2990,7 @@ static const struct virStorageSourceJSONDriverParser jsonParsers[] = {
static int
virStorageSourceParseBackingJSONDeflattenWorker(const char *key,
- const virJSONValue *value,
+ virJSONValuePtr value,
void *opaque)
{
virJSONValuePtr retobj = opaque;
--
2.11.0
7 years, 11 months
[libvirt] [PATCH] libxl: add QED disk format support
by Cédric Bosdonnat
If libxl has QED disk format support, then pass the feature
over to the user.
---
src/libxl/libxl_conf.c | 11 +++++++++++
src/xenconfig/xen_xl.c | 6 ++++++
2 files changed, 17 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 288712f65..02945ae1a 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -745,6 +745,12 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
x_disk->format = LIBXL_DISK_FORMAT_RAW;
x_disk->backend = LIBXL_DISK_BACKEND_TAP;
break;
+#ifdef LIBXL_HAVE_QED
+ case VIR_STORAGE_FILE_QED:
+ x_disk->format = LIBXL_DISK_FORMAT_QED;
+ x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
+ break;
+#endif
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("libxenlight does not support disk format %s "
@@ -762,6 +768,11 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
case VIR_STORAGE_FILE_QCOW2:
x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
break;
+#ifdef LIBXL_HAVE_QED
+ case VIR_STORAGE_FILE_QED:
+ x_disk->format = LIBXL_DISK_FORMAT_QED;
+ break;
+#endif
case VIR_STORAGE_FILE_VHD:
x_disk->format = LIBXL_DISK_FORMAT_VHD;
break;
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index bcdd35527..98436982a 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -393,6 +393,12 @@ xenParseXLDisk(virConfPtr conf, virDomainDefPtr def)
case LIBXL_DISK_FORMAT_EMPTY:
break;
+
+#ifdef LIBXL_HAVE_QED
+ case LIBXL_DISK_FORMAT_QED:
+ disk->src->format = VIR_STORAGE_FILE_QED;
+ break;
+#endif
}
switch (libxldisk->backend) {
--
2.11.0
7 years, 11 months
[libvirt] [PATCH V3 0/2] Allow hot plugged host CPUs
by Viktor Mihajlovski
This is a rework of the original patch allowing to use all host
CPUs if the cpuset controller is not configured by libvirt.
The major enhancement is that we won't try to retrieve the online
host CPU map on platforms where this is not supported and just
fall back to the old behavior.
V3:
- Added new function (in seperate patch) to find out whether the host
CPU online map can be retrieved gracefully
V2:
- Avoid memory leak
Viktor Mihajlovski (2):
util: Allow to query the presence of host CPU bitmaps
qemu: Allow use of hot plugged host CPUs if no affinity set
src/libvirt_private.syms | 1 +
src/qemu/qemu_process.c | 33 ++++++++++++++++++++++++---------
src/util/virhostcpu.c | 10 ++++++++++
src/util/virhostcpu.h | 1 +
4 files changed, 36 insertions(+), 9 deletions(-)
--
1.9.1
7 years, 11 months