[libvirt] [PATCH v3 0/3] Parallels disk device attach
by Alexander Burluka
This patchset implements disk device attachment and allows
OpenStack to attach volumes to Parallels-driven instances.
Parallels Cloud Server SDK supports live attachment of disk devices
and virtual interfaces cards.
Alexander Burluka (3):
Parallels: remove disk serial number check
Parallels: implement domainAttachDeviceFlags
Parallels: implemented domainAttachDevice
9 years, 8 months
[libvirt] [PATCH v2 0/3] Parallels disk device attach
by Alexander Burluka
This patchset implements disk device attachment and allows
OpenStack to attach volumes to Parallels-driven instances.
Parallels Cloud Server SDK supports live attachment of disk devices
and virtual interfaces cards.
Alexander Burluka (3):
Parallels: remove disk serial number check
Parallels: implement domainAttachDeviceFlags
Parallels: implemented domainAttachDevice
9 years, 8 months
[libvirt] [PATCH] qemu: end the job when try to blockcopy to non-file destination
by Shanzhi Yu
Blockcopy to non-file destination is not supported according the code while
a 'goto endjob' is missed after check the destination which lead qemu try
to do drive-mirror.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206406
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index db4f0b4..f07e4fb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16642,6 +16642,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
if (!virStorageSourceIsLocalStorage(mirror)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("non-file destination not supported yet"));
+ goto endjob;
}
if (stat(mirror->path, &st) < 0) {
if (errno != ENOENT) {
--
2.1.0
9 years, 8 months
[libvirt] [PATCH 1/1] nodeinfo: Increase the num of CPU thread siblings to a larger value
by Wei Huang
Current libvirt can only handle up to 1024 thread siblings when it
reads Linux sysfs topology/thread_siblings. This isn't enough for
Linux distributions that support a large value. This patch fixes
the problem by using VIR_ALLOC()/VIR_FREE(), instead of using a
fixed-size (1024) local char array. In the meanwhile
SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX is increased to 8192 which
should be large enough for a foreseeable future.
Signed-off-by: Wei Huang <wei(a)redhat.com>
---
src/nodeinfo.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 34d27a6..66dc7ef 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -287,7 +287,7 @@ freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params,
# define PROCSTAT_PATH "/proc/stat"
# define MEMINFO_PATH "/proc/meminfo"
# define SYSFS_MEMORY_SHARED_PATH "/sys/kernel/mm/ksm"
-# define SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX 1024
+# define SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX 8192
# define LINUX_NB_CPU_STATS 4
# define LINUX_NB_MEMORY_STATS_ALL 4
@@ -345,7 +345,7 @@ virNodeCountThreadSiblings(const char *dir, unsigned int cpu)
unsigned long ret = 0;
char *path;
FILE *pathfp;
- char str[1024];
+ char *str = NULL;
size_t i;
if (virAsprintf(&path, "%s/cpu%u/topology/thread_siblings",
@@ -365,7 +365,10 @@ virNodeCountThreadSiblings(const char *dir, unsigned int cpu)
return 0;
}
- if (fgets(str, sizeof(str), pathfp) == NULL) {
+ if (VIR_ALLOC_N(str, SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX) < 0)
+ goto cleanup;
+
+ if (fgets(str, SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX, pathfp) == NULL) {
virReportSystemError(errno, _("cannot read from %s"), path);
goto cleanup;
}
@@ -382,6 +385,7 @@ virNodeCountThreadSiblings(const char *dir, unsigned int cpu)
}
cleanup:
+ VIR_FREE(str);
VIR_FORCE_FCLOSE(pathfp);
VIR_FREE(path);
--
1.8.3.1
9 years, 8 months
[libvirt] qemu_migration: Precreate missing storage breaks with network drives
by Noel Burton-Krahn
Hi Michal,
We're testing libvirt-1.2.13 and found it failed to live migrate domains
with attached network drives. The change to libvirt was made in commit
cf54c606, announced here:
https://www.redhat.com/archives/libvir-list/2014-November/msg01053.html
It's not necessary to precreate network drives. They're created during
nova live migration in openstack. How about this patch?
diff -U3 -r libvirt-1.2.13.orig/src/qemu/qemu_migration.c
libvirt-1.2.13/src/qemu/qemu_migration.c
--- libvirt-1.2.13.orig/src/qemu/qemu_migration.c 2015-02-23
22:04:12.000000000 -0800
+++ libvirt-1.2.13/src/qemu/qemu_migration.c 2015-03-18 12:18:14.137990147
-0700
@@ -1510,6 +1510,9 @@
case VIR_STORAGE_TYPE_BLOCK:
case VIR_STORAGE_TYPE_DIR:
case VIR_STORAGE_TYPE_NETWORK:
+ ret = 0;
+ goto cleanup;
+ break;
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
Cheers,
--
Noel Burton-Krahn
Sr, Distributed Systems Engineer
Piston Cloud Computing
9 years, 8 months
[libvirt] [libvirt-test-API][PATCH] Add connection_getDomainCapabilities test case
by jiahu
In the case, we will validate getDomainCapabilities API for libvirt.
jiahu (1):
Add connection_getDomainCapabilities test case
cases/test_connection.conf | 10 +
repos/virconn/connection_getDomainCapabilities.py | 438 ++++++++++++++++++++++
2 files changed, 448 insertions(+)
create mode 100644 repos/virconn/connection_getDomainCapabilities.py
--
1.8.1.4
9 years, 8 months
[libvirt] [PATCH] relaxng: allow : in /dev/disk/by-path names
by Eric Blake
On IRC, Hydrar pointed a problem where 'virsh edit' failed on
his domain created through an ISCSI pool managed by virt-manager,
all because the XML included a block device with colons in the
name.
* docs/schemas/basictypes.rng (absFilePath): Add colon as safe.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml: New file.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args: Likewise.
* tests/qemuxml2argvtest.c (mymain): Test it.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
docs/schemas/basictypes.rng | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-iscsi.args | 7 ++++++
tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml | 28 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 0cd1c4e..f086ad2 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -242,7 +242,7 @@
<define name="absFilePath">
<data type="string">
- <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,]+</param>
+ <param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,:]+</param>
</data>
</define>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args
new file mode 100644
index 0000000..b987a38
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -usb \
+-hda /dev/disk/by-path/ip-192.168.44.1:3260-iscsi-iqn.2011-02.lan.hdserver\
+:hydrar-desktop.win7vm-lun-0 -net none \
+-serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml
new file mode 100644
index 0000000..e4d9c97
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/disk/by-path/ip-192.168.44.1:3260-iscsi-iqn.2011-02.lan.hdserver:hydrar-desktop.win7vm-lun-0'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3c2fbf1..57ef053 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -708,6 +708,7 @@ mymain(void)
DO_TEST("hugepages-pages6", NONE);
DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE);
DO_TEST("disk-cdrom", NONE);
+ DO_TEST("disk-iscsi", NONE);
DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE);
DO_TEST("disk-cdrom-network-https", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,
--
2.1.0
9 years, 8 months
[libvirt] [PATCH] libxl: Fix memory leak if pthread_create fails.
by Konrad Rzeszutek Wilk
If we fail to create the thread we leak the shutdown_info
structure.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
---
src/libxl/libxl_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 774b070..0ac5c62 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -482,7 +482,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
libxlDriverPrivatePtr driver = data;
virDomainObjPtr vm = NULL;
libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason;
- struct libxlShutdownThreadInfo *shutdown_info;
+ struct libxlShutdownThreadInfo *shutdown_info = NULL;
virThread thread;
libxlDriverConfigPtr cfg;
@@ -535,6 +535,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
virObjectUnref(cfg);
if (vm)
virObjectUnlock(vm);
+ VIR_FREE(shutdown_info);
}
void
--
1.8.4.2
9 years, 8 months
[libvirt] [PATCH 0/3] Parallels disk device attach
by Alexander Burluka
This patchset implements disk device attachment and allows
OpenStack to attach volumes to Parallels-driven instances.
Parallels Cloud Server SDK supports live attachment of disk devices
and virtual interfaces cards.
Alexander Burluka (3):
Parallels: remove disk serial number check
Parallels: implement domainAttachDeviceFlags
Parallels: implemented domainAttachDevice
9 years, 8 months
[libvirt] [PATCH 0/4] util: use netlink to create bridge devices
by Laine Stump
This patch series comes out of a comment in:
https://bugzilla.redhat.com/show_bug.cgi?id=1125755
that pointed out that sioctl(SIOCBRDELBR) won't delete a bridge
interface if it is IFF_UP, but the netlink RTM_DELLINK message doesn't
care - it will delete it anyway. In these patches we switch to using
RTM_DELLINK to avoid failures caused by a bridge interface that is
IFF_UP.
Laine Stump (4):
util: netlink function to delete any network device
util: replace body of virNetDevMacVLanDelete() with
virNetlinkDelLink()
util: use netlink to delete bridge devices
util: use netlink to create bridge devices
src/libvirt_private.syms | 1 +
src/util/virnetdevbridge.c | 90 +++++++++++++++++++++++++++++++++++++++++++--
src/util/virnetdevmacvlan.c | 67 +--------------------------------
src/util/virnetlink.c | 89 ++++++++++++++++++++++++++++++++++++++++++++
src/util/virnetlink.h | 3 +-
5 files changed, 181 insertions(+), 69 deletions(-)
--
2.1.0
9 years, 8 months