[libvirt] [PATCH 0/5] Some qemuProcessStart cleanups
by Jiri Denemark
Jiri Denemark (5):
qemu: Use correct type when calling qemuPrepareNVRAM
qemu: Rename cleanup label in qemuProcessStart
qemu: Rename ret variable in qemuProcessStart
qemu: Introduce cleanup label in qemuProcessStart
qemu: Fix memory leak in qemuProcessStart
src/qemu/qemu_process.c | 215 ++++++++++++++++++++++++------------------------
1 file changed, 106 insertions(+), 109 deletions(-)
--
2.6.2
9 years
[libvirt] [PATCH v2] Remove new lines from debug messages
by Jiri Denemark
VIR_DEBUG will automatically add a new line to the message, having "\n"
at the end or at the beginning of the message results in empty lines.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
src/nwfilter/nwfilter_gentech_driver.c | 2 +-
src/nwfilter/nwfilter_learnipaddr.c | 10 +++++-----
src/rpc/virnetsocket.c | 2 +-
src/util/virfile.c | 2 +-
src/util/virhash.c | 2 +-
src/util/virnetdevmacvlan.c | 26 ++++++++++++------------
src/util/virprocess.c | 2 +-
src/xen/xend_internal.c | 2 +-
tests/virhostdevtest.c | 36 +++++++++++++++++-----------------
tests/virnetsockettest.c | 2 +-
tests/virtimetest.c | 2 +-
12 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index f05d4a8..bd6d25f 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -2017,7 +2017,7 @@ static void
virNWFilterSnoopJoinThreads(void)
{
while (virAtomicIntGet(&virNWFilterSnoopState.nThreads) != 0) {
- VIR_WARN("Waiting for snooping threads to terminate: %u\n",
+ VIR_WARN("Waiting for snooping threads to terminate: %u",
virAtomicIntGet(&virNWFilterSnoopState.nThreads));
usleep(1000 * 1000);
}
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index 701f8d8..5a4cff1 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -540,7 +540,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
if (rc)
break;
} else if (inc) {
- VIR_DEBUG("Following filter %s\n", inc->filterref);
+ VIR_DEBUG("Following filter %s", inc->filterref);
obj = virNWFilterObjFindByName(&driver->nwfilters, inc->filterref);
if (obj) {
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 5b55055..1adbadb 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -413,7 +413,7 @@ learnIPAddressThread(void *arg)
handle = pcap_open_live(listen_if, BUFSIZ, 0, PKT_TIMEOUT_MS, errbuf);
if (handle == NULL) {
- VIR_DEBUG("Couldn't open device %s: %s\n", listen_if, errbuf);
+ VIR_DEBUG("Couldn't open device %s: %s", listen_if, errbuf);
req->status = ENODEV;
goto done;
}
@@ -448,13 +448,13 @@ learnIPAddressThread(void *arg)
filter = virBufferContentAndReset(&buf);
if (pcap_compile(handle, &fp, filter, 1, 0) != 0) {
- VIR_DEBUG("Couldn't compile filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't compile filter '%s'", filter);
req->status = EINVAL;
goto done;
}
if (pcap_setfilter(handle, &fp) != 0) {
- VIR_DEBUG("Couldn't set filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't set filter '%s'", filter);
req->status = EINVAL;
pcap_freecode(&fp);
goto done;
@@ -626,7 +626,7 @@ learnIPAddressThread(void *arg)
req->filtername,
req->filterparams);
VIR_DEBUG("Result from applying firewall rules on "
- "%s with IP addr %s : %d\n", req->ifname, inetaddr, ret);
+ "%s with IP addr %s : %d", req->ifname, inetaddr, ret);
}
} else {
if (showError)
@@ -638,7 +638,7 @@ learnIPAddressThread(void *arg)
techdriver->applyDropAllRules(req->ifname);
}
- VIR_DEBUG("pcap thread terminating for interface %s\n", req->ifname);
+ VIR_DEBUG("pcap thread terminating for interface %s", req->ifname);
virNWFilterUnlockIface(req->ifname);
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 5e5f1ab..526d291 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -196,7 +196,7 @@ int virNetSocketCheckProtocols(bool *hasIPv4,
freeaddrinfo(ai);
- VIR_DEBUG("Protocols: v4 %d v6 %d\n", *hasIPv4, *hasIPv6);
+ VIR_DEBUG("Protocols: v4 %d v6 %d", *hasIPv4, *hasIPv6);
ret = 0;
cleanup:
diff --git a/src/util/virfile.c b/src/util/virfile.c
index e5cf2c5..f45e18f 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -681,7 +681,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0)
return -1;
- VIR_DEBUG("Return from loop-control got fd %d\n", loop_fd);
+ VIR_DEBUG("Return from loop-control got fd %d", loop_fd);
if (loop_fd >= 0)
return loop_fd;
diff --git a/src/util/virhash.c b/src/util/virhash.c
index bc90c44..fab621b 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -287,7 +287,7 @@ virHashGrow(virHashTablePtr table, size_t size)
VIR_FREE(oldtable);
#ifdef DEBUG_GROW
- VIR_DEBUG("virHashGrow : from %d to %d, %ld elems\n", oldsize,
+ VIR_DEBUG("virHashGrow : from %d to %d, %ld elems", oldsize,
size, nbElem);
#endif
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 89985b8..de345e6 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -473,16 +473,16 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
case RTM_DELLINK:
case RTM_SETLINK:
case RTM_GETLINK:
- VIR_DEBUG(" IFINFOMSG\n");
- VIR_DEBUG(" ifi_family = 0x%02x\n",
+ VIR_DEBUG(" IFINFOMSG");
+ VIR_DEBUG(" ifi_family = 0x%02x",
((struct ifinfomsg *)data)->ifi_family);
- VIR_DEBUG(" ifi_type = 0x%x\n",
+ VIR_DEBUG(" ifi_type = 0x%x",
((struct ifinfomsg *)data)->ifi_type);
- VIR_DEBUG(" ifi_index = %i\n",
+ VIR_DEBUG(" ifi_index = %i",
((struct ifinfomsg *)data)->ifi_index);
- VIR_DEBUG(" ifi_flags = 0x%04x\n",
+ VIR_DEBUG(" ifi_flags = 0x%04x",
((struct ifinfomsg *)data)->ifi_flags);
- VIR_DEBUG(" ifi_change = 0x%04x\n",
+ VIR_DEBUG(" ifi_change = 0x%04x",
((struct ifinfomsg *)data)->ifi_change);
}
/* DEBUG end */
@@ -544,23 +544,23 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
if (tb[IFLA_IFNAME]) {
ifname = (char *)RTA_DATA(tb[IFLA_IFNAME]);
- VIR_DEBUG("IFLA_IFNAME = %s\n", ifname);
+ VIR_DEBUG("IFLA_IFNAME = %s", ifname);
}
if (tb[IFLA_OPERSTATE]) {
rem = *(unsigned short *)RTA_DATA(tb[IFLA_OPERSTATE]);
- VIR_DEBUG("IFLA_OPERSTATE = %d\n", rem);
+ VIR_DEBUG("IFLA_OPERSTATE = %d", rem);
}
if (tb[IFLA_VF_PORTS]) {
struct nlattr *tb_vf_ports;
- VIR_DEBUG("found IFLA_VF_PORTS\n");
+ VIR_DEBUG("found IFLA_VF_PORTS");
nla_for_each_nested(tb_vf_ports, tb[IFLA_VF_PORTS], rem) {
- VIR_DEBUG("iterating\n");
+ VIR_DEBUG("iterating");
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
- VIR_DEBUG("not a IFLA_VF_PORT. skipping\n");
+ VIR_DEBUG("not a IFLA_VF_PORT. skipping");
continue;
}
if (nla_parse_nested(tb3, IFLA_PORT_MAX, tb_vf_ports,
@@ -600,7 +600,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
uuid = (unsigned char *)
RTA_DATA(tb3[IFLA_PORT_INSTANCE_UUID]);
instance2str(uuid, instance, sizeof(instance));
- VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s\n",
+ VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s",
instance);
}
@@ -615,7 +615,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
}
if (tb3[IFLA_PORT_RESPONSE]) {
- VIR_DEBUG("IFLA_PORT_RESPONSE = %d\n", *(uint16_t *)
+ VIR_DEBUG("IFLA_PORT_RESPONSE = %d", *(uint16_t *)
RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
}
}
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 43118f8..103c114 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -407,7 +407,7 @@ virProcessKillPainfully(pid_t pid, bool force)
int virProcessSetAffinity(pid_t pid, virBitmapPtr map)
{
size_t i;
- VIR_DEBUG("Set process affinity on %lld\n", (long long)pid);
+ VIR_DEBUG("Set process affinity on %lld", (long long)pid);
# ifdef CPU_ALLOC
/* New method dynamically allocates cpu mask, allowing unlimted cpus */
int numcpus = 1024;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 62ce930..21d99e3 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -507,7 +507,7 @@ xend_op_ext(virConnectPtr xend, const char *path, const char *key, va_list ap)
return -1;
content = virBufferContentAndReset(&buf);
- VIR_DEBUG("xend op: %s\n", content);
+ VIR_DEBUG("xend op: %s", content);
ret = http2unix(xend_post(xend, path, content));
VIR_FREE(content);
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 065b825..faebdd4 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -169,14 +169,14 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
NULL, 0, 0) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
/* Test unmanaged hostdevs */
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -186,21 +186,21 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -223,7 +223,7 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != false) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
@@ -231,11 +231,11 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -261,7 +261,7 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
@@ -269,19 +269,19 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
@@ -303,18 +303,18 @@ testVirHostdevReAttachPCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != true) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
@@ -392,13 +392,13 @@ testVirHostdevUpdateActivePCIHostdevs(const void *oaque ATTRIBUTE_UNUSED)
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, NULL, 0,
drv_name, dom_name) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, hostdevs, nhostdevs,
drv_name, dom_name) < 0)
goto cleanup;
@@ -432,7 +432,7 @@ mymain(void)
# define DO_TEST(fnc) \
do { \
- VIR_DEBUG("\nTesting: %s", #fnc); \
+ VIR_DEBUG("Testing: %s", #fnc); \
if (virtTestRun(#fnc, fnc, NULL) < 0) \
ret = -1; \
} while (0)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index ce9eeab..5786870 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -105,7 +105,7 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
break;
}
- VIR_DEBUG("Choose port %d\n", *freePort);
+ VIR_DEBUG("Choose port %d", *freePort);
ret = 0;
diff --git a/tests/virtimetest.c b/tests/virtimetest.c
index 9ab38ae..49040d3 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -92,7 +92,7 @@ testTimeLocalOffset(const void *args)
return -1;
if (data->offset != actual) {
- VIR_DEBUG("Expect Offset %ld got %ld\n",
+ VIR_DEBUG("Expect Offset %ld got %ld",
data->offset, actual);
return -1;
}
--
2.6.2
9 years
[libvirt] [PATCH v6 00/13] qemu: Add quorum support to libvirt
by Matthias Gatto
The purpose of these patches is to introduce quorum for libvirt
I've try to follow this proposal:
http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html
This feature ask for 6 task:
1) Allow a _virStorageSource to contain more than one backing store.
Because all the actual libvirt code use the backingStore field
as a pointer and we needs want to change that, I've decide to encapsulate
the backingStore field to simplifie the array manipulation.
2) Add the missing field a quorum need in _virStorageSource and
the VIR_STORAGE_TYPE_QUORUM and VIR_STORAGE_FILE_QUORUM in
their respectives enums.
3) Parse and format the xml
Because a quorum allows to have more than one backing store at the same level
we need to change virDomainDiskDefFormat and virDomainDiskDefParseXML
to call virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse
in a loop.
virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse can
call themself recursively in a loop because a quorum can contain another
quorum
4) Build qemu string
As for the xml, we have to call the function which create quorum recursively.
But this task have the problem explained here:
http://www.redhat.com/archives/libvir-list/2014-October/msg00529.html
The _virStorageSource missing some informations that can be passed to
a child, and therefore this version of quorum is incomplet.
5) Allow to hotplug/change a disk in a quorum
This part is not present in these patches because for this task
we have to use blockdev-add, and currently libvirt use
device_add for hotpluging that doesn't allow to hotplug quorum childs.
There is 3 way to handle this problem:
1) create a virDomainBlockDevAdd function in libvirt witch call
blockdev-add.
2) use blockdev-add instead of device_add in qemuMonitorJSONAddDevice
3) write a hack which uses blockdev-add only when attaching a quorum child
V2:
-Rebase on master
-Add Documentation
V3:
-Transforme the backingStore field in virStorageSource into
an array of pointer instead of a pointer
-Modify virStorageSourceSetBackingStore to allow it to expand
the backingStore size.
V4:
-Rebase on master
V5:
-Rebase on master
-patch 1-4/9: use patchs from John Ferlan
-patch 4/9: check return of virStorageSourceSetBackingStore
-patch 5/9: report type of error on virStorageSourceSetBackingStore
v6 note:
First at all, I'm sorry for the time between v5 and v6,
I had other projects to work on and was unable to work at full time
on libvirt, moreover I've try at first to support all snapshot and
block jobs operations for quorum, but encounter a lot a problems.
At the end I had a versions which was only handling some few operations,
so I've block all unsupported operations for quorum,
I plan to continue working on the quorum unsupported operations,
and send it when it will be ready, but in the meantime I hope to upstream
this serie of patch which should provide a very basic(but stable)
quorum suport.
v6 modifications:
-Rebase on master
-Remove node-name patch
-patch 06/13: Add virStorageSourceIsRAID
-patch 10/13: Add virDomainDefHasRAID
-patch 11-13/13: Block all unsupported operations
Matthias Gatto (13):
virstoragefile: Add virStorageSourceGetBackingStore
virstoragefile: Always use virStorageSourceGetBackingStore to get
backing store
virstoragefile: Add virStorageSourceSetBackingStore
virstoragefile: Always use virStorageSourceSetBackingStore to set
backing store
virstoragefile: change backingStore to backingStores.
virstoragefile: Add virStorageSourceIsRAID
virstoragefile: Add quorum in virstoragefile
domain_conf: Read and Write quorum config
qemu: Add quorum support in qemuBuildDriveDevStr
domain: add virDomainDefHasRAID
qemu: Block snapshot operation with RAID
qemu: qemuDomainGetBlockInfo quorum support
qemu: qemuDiskPathToAlias quorum support
docs/formatdomain.html.in | 23 +++-
docs/schemas/domaincommon.rng | 21 +++-
docs/schemas/storagecommon.rng | 1 +
docs/schemas/storagevol.rng | 1 +
src/conf/domain_conf.c | 196 +++++++++++++++++++++++++---------
src/conf/domain_conf.h | 1 +
src/conf/storage_conf.c | 23 ++--
src/libvirt_private.syms | 4 +
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 94 ++++++++++++++++
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 50 ++++++---
src/qemu/qemu_migration.c | 1 +
src/qemu/qemu_monitor_json.c | 4 +-
src/security/security_dac.c | 2 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 22 ++--
src/storage/storage_backend_fs.c | 38 ++++---
src/storage/storage_backend_gluster.c | 11 +-
src/storage/storage_backend_logical.c | 15 ++-
src/storage/storage_driver.c | 3 +-
src/util/virstoragefile.c | 118 +++++++++++++++++---
src/util/virstoragefile.h | 15 ++-
tests/virstoragetest.c | 18 ++--
25 files changed, 523 insertions(+), 150 deletions(-)
--
2.6.1
9 years
[libvirt] [PATCH 0/8] Few vfio related fixes
by Shivaprasad G Bhat
The series fixes 3 issues which lead to host crash.
The actual fixes are in p3, p4, p7 and p8.
I'll fill in more details / descriptions in v2.
The make check fails on virpcitest now, which I am still debugging.
I anticipate some rework from review on p7 which I continue to
refine. Sending now, to get any feedback that might change things
drastically.
---
Shivaprasad G Bhat (8):
Initialize the stubDriver of pci devices if bound to a valid one
Add iommu group number info to virPCIDevice
Refuse to reattach from vfio if the iommu group is in use by any domain
Wait for vfio-pci device cleanups before reassinging the device to host driver
Split reprobe action from the virPCIUnbindFromStub into a new function
Pass activeDevs and inactiveDevs to virPCIDeviceUnbindFromStub and virPCIDeviceBindToStub
Postpone reprobing till all the devices in iommu group are unbound from vfio
Wait for iommmu device to go away before reprobing the host driver
src/util/virhostdev.c | 18 ++++
src/util/virpci.c | 206 ++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 177 insertions(+), 47 deletions(-)
--
Signature
9 years
[libvirt] Entering freeze for libvirt-1.2.21
by Daniel Veillard
As pointed our on Tuesday it's time for a new release. I have tagged
the release candidate 1 in git and pushed signed tarball and rpms to
the usual place at:
ftp://libvirt.org/libvirt/
Based on my limited testing this works just fine, but that's very limited
and doesn't test portability at all, so please give it a try !
I will likely push rc2 on the week-end and the final version on Tuesday
or Wednesday,
please raise issues if you fine any,
thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
9 years
[libvirt] [PATCH 1/3] cpu_map.xml: add cmt feature to x86
by Qiaowei Ren
Some Intel processor families (e.g. the Intel Xeon processor E5 v3
family) introduced CMT (Cache Monitoring Technology) to measure the
usage of cache by applications running on the platform. This patch
add it into x86 part of cpu_map.xml.
Signed-off-by: Qiaowei Ren <qiaowei.ren(a)intel.com>
---
.gnulib | 2 +-
src/cpu/cpu_map.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index f39477d..106a386 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit f39477dba778e99392948dd3dd19ec0d46aee932
+Subproject commit 106a3866d01f9dd57ab4f10dbeb0d5a8db73a9f7
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index b9e95cf..14ccbd8 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -317,6 +317,9 @@
<feature name='rtm'>
<cpuid function='0x00000007' ebx='0x00000800'/>
</feature>
+ <feature name='cmt'>
+ <cpuid function='0x00000007' ebx='0x00001000'/>
+ </feature>
<feature name='rdseed'>
<cpuid function='0x00000007' ebx='0x00040000'/>
</feature>
--
1.9.1
9 years
[libvirt] [python PATCH] fix crash introduced by commit 1d39dbaf
by Pavel Hrdina
Some of the libvirt_*Wrap functions steals the reference and we need to
set the item in array to NULL no not free it on success. Those three
places was accidentally removed by commit 1d39dbaf.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270977
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed as fix for critical crasher.
libvirt-override.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index c6c1da8..5f1c98f 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -2448,6 +2448,7 @@ libvirt_virDomainListAllSnapshots(PyObject *self ATTRIBUTE_UNUSED,
for (i = 0; i < c_retval; i++) {
VIR_PY_LIST_SET_GOTO(py_retval, i,
libvirt_virDomainSnapshotPtrWrap(snaps[i]), error);
+ snaps[i] = NULL;
}
cleanup:
@@ -2544,9 +2545,11 @@ libvirt_virDomainSnapshotListAllChildren(PyObject *self ATTRIBUTE_UNUSED,
if (!(py_retval = PyList_New(c_retval)))
goto cleanup;
- for (i = 0; i < c_retval; i++)
+ for (i = 0; i < c_retval; i++) {
VIR_PY_LIST_SET_GOTO(py_retval, i,
libvirt_virDomainSnapshotPtrWrap(snaps[i]), error);
+ snaps[i] = NULL;
+ }
cleanup:
for (i = 0; i < c_retval; i++)
@@ -3117,9 +3120,11 @@ libvirt_virConnectListAllNetworks(PyObject *self ATTRIBUTE_UNUSED,
if (!(py_retval = PyList_New(c_retval)))
goto cleanup;
- for (i = 0; i < c_retval; i++)
+ for (i = 0; i < c_retval; i++) {
VIR_PY_LIST_SET_GOTO(py_retval, i,
libvirt_virNetworkPtrWrap(nets[i]), error);
+ nets[i] = NULL;
+ }
cleanup:
for (i = 0; i < c_retval; i++)
--
2.6.2
9 years
[libvirt] RFC: Improve performance of macvtap device creation
by Tony Krowiak
For a guest domain defined with a large number of macvtap devices, it takes an exceedingly long time to boot the guest. In a test of a guest domain configured with 82 macvtap devices, it took over two minutes for the guest to boot. An strace of the ioctl calls during guest start up showed the SIOCGIFFLAGS ioctl literally being invoked 3,403 times. I was able to isolate the source of the ioctl calls to the*virNetDevMacVLanCreateWithVPortProfile* function in*virnetdevmacvlan.c*. The macvtap interface name is created by looping over a counter variable, starting with zero, and appending the counter value to 'macvtap'. With each iteration, a call is made to*virNetDevExists* (SIOCGIFFLAGS ioctl) to determine if a device with that name already exists, until a unique name is created. In the test case cited above, to create an interface name for the 82nd macvtap device, the*virNetDevExists* function will be called for interface names 'macvtap0' to 'macvtap80' before it is determined that 'mavtap81' can be used. So if N is the number of macvtap interfaces defined for a guest, the SIOCGIFFLAGS ioctl will be invoked (N x N + N)/2 times to find an unused macvtap device names. That's assuming only one guest is being started, who knows how many times the ioctl may have to be called in an installation running a large number of guests defined with macvtap devices.
I was able to reduce the amount of time for starting a guest domain defined with 82 macvtap devices from over 2 minutes to about 14 seconds by keeping track of the interface name suffixes previously used. I defined two static bit maps (virBitmap), one each for macvtap and macvlan device name suffixes. When a macvtap/macvlan device is created, the index of the next clear bit (virBitmapNextClearBit) is retrieved to create the name. If an interface with that name does not exist, the device is created and the bit at the index used to create the interface name is set (virBitmapSetBit). When a macvtap/macvlan device is deleted, if the interface name has the pattern 'macvtap%d' or 'macvlan%d', the suffix is parsed into a bit index and used to clear the (virBitMapClearBit) bit in the respective bitmap.
I am not sure that is the best design because there is no way to track interface names used to create macvtap devices outside of libvirt, for example using the ip command. There may also be other issues I've not contemplated. I included a couple of additional ideas below and am looking for comments or other suggestions that I have not considered.
* Define a global counter variable initialized to 0, that gets
incremented each time an interface name is created, to keep track of
the last used interface name suffix. At some maximum value, the
counter will be set back to 0.
* Append a random number to 'macvlan' or 'macvtap' when creating the
interface name. Of course, the number of digits would have to be
limited so the interface name would not exceed the maximum allowed.
* Create the interface name in code that has more knowledge of the
environment and pass the name into the
*virNetDevMacVLanCreateWithVPortProfile* function via the *tgifname*
parameter. For example, the *qemuBuildCommandLine* function in
*qemu_command.c* contains the loop that iterates over the network
devices defined for the guest domain that ultimately get created via
the *virNetDevMacVLanCreateWithVPortProfile* function. That function
has access to the network device configuration and at the very least
could ensure none of the names previously defined for the guest
aren't used. I believe it would be matter of creating a macvtap
interface name - e.g., maybe a call to some function in
*virnetdevmacvlan.c* - and setting the name in the virDomainNetDef
structure prior to invoking *qemuBuildInterfaceCommandLine*?
There are shortcomings in all of these ideas, so if you have a better
one, feel free to present it.
9 years
[libvirt] RAM backend and guest ABI (was Re: [Qemu-devel] [PATCH v2] pc: memhp: enforce minimal 128Mb) alignment for pc-dimm
by Eduardo Habkost
(CCing Michal and libvir-list, so libvirt team is aware of this
restriction)
On Thu, Oct 29, 2015 at 02:36:37PM +0100, Igor Mammedov wrote:
> On Tue, 27 Oct 2015 14:36:35 -0200
> Eduardo Habkost <ehabkost(a)redhat.com> wrote:
>
> > On Tue, Oct 27, 2015 at 10:14:56AM +0100, Igor Mammedov wrote:
> > > On Tue, 27 Oct 2015 10:53:08 +0200
> > > "Michael S. Tsirkin" <mst(a)redhat.com> wrote:
> > >
> > > > On Tue, Oct 27, 2015 at 09:48:37AM +0100, Igor Mammedov wrote:
> > > > > On Tue, 27 Oct 2015 10:31:21 +0200
> > > > > "Michael S. Tsirkin" <mst(a)redhat.com> wrote:
> > > > >
> > > > > > On Mon, Oct 26, 2015 at 02:24:32PM +0100, Igor Mammedov wrote:
> > > > > > > Yep it's workaround but it works around QEMU's broken virtio
> > > > > > > implementation in a simple way without need for guest side changes.
> > > > > > >
> > > > > > > Without foreseeable virtio fix it makes memory hotplug unusable and even
> > > > > > > more so if there were a virtio fix it won't fix old guests since you've
> > > > > > > said that virtio fix would require changes of both QEMU and guest sides.
> > > > > >
> > > > > > What makes it not foreseeable?
> > > > > > Apparently only the fact that we have a work-around in place so no one
> > > > > > works on it. I can code it up pretty quickly, but I'm flat out of time
> > > > > > for testing as I'm going on vacation soon, and hard freeze is pretty
> > > > > > close.
> > > > > I can lend a hand for testing part.
> > > > >
> > > > > >
> > > > > > GPA space is kind of cheap, but wasting it in chunks of 512M
> > > > > > seems way too aggressive.
> > > > > hotplug region is sized with 1Gb alignment reserve per DIMM so we aren't
> > > > > actually wasting anything here.
> > > > >
> > > >
> > > > If I allocate two 1G DIMMs, what will be the gap size? 512M? 1G?
> > > > It's too much either way.
> > > minimum would be 512, and if backend is 1Gb-hugepage gap will be
> > > backend's natural alignment (i.e. 1Gb).
> >
> > Is backend configuration even allowed to affect the machine ABI? We need
> > to be able to change backend configuration when migrating the VM to
> > another host.
> for now, one has to use the same type of backend on both sides
> i.e. if source uses 1Gb huge pages backend then target also
> need to use it.
>
The page size of the backend don't even depend on QEMU arguments, but on
the kernel command-line or hugetlbfs mount options. So it's possible to
have exactly the same QEMU command-line on source and destination (with
an explicit versioned machine-type), and get a VM that can't be
migrated? That means we are breaking our guarantees about migration and
guest ABI.
> We could change this for the next machine type to always force
> max alignment (1Gb), then it would be possible to change
> between backends with different alignments.
I'm not sure what's the best solution here. If always using 1GB is too
aggressive, we could require management to ask for an explicit alignment
as a -machine option if they know they will need a specific backend page
size.
BTW, are you talking about the behavior introduced by
aa8580cddf011e8cedcf87f7a0fdea7549fc4704 ("pc: memhp: force gaps between
DIMM's GPA") only, or the backend page size was already affecting GPA
allocation before that commit?
--
Eduardo
9 years