[libvirt] [PATCH] add --interface to dnsmasq command line so bind-interfaces works
by Gene Czarcinski
The problem is that, without SO_BINDTODEVICE, there is no guarantee
that the kernel will route DHCP (v4 or v6) packets to the correct
instance of dnsmasq, when there is more than one.
---
src/network/bridge_driver.c | 20 ++++++++++++++------
tests/networkxml2argvdata/isolated-network.argv | 1 +
tests/networkxml2argvdata/nat-network-dns-hosts.argv | 3 ++-
.../nat-network-dns-srv-record-minimal.argv | 1 +
.../nat-network-dns-srv-record.argv | 1 +
.../nat-network-dns-txt-record.argv | 1 +
tests/networkxml2argvdata/nat-network.argv | 3 ++-
tests/networkxml2argvdata/netboot-network.argv | 3 ++-
tests/networkxml2argvdata/netboot-proxy-network.argv | 3 ++-
tests/networkxml2argvdata/routed-network.argv | 3 ++-
10 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 5578373..821b955 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -682,14 +682,22 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
}
}
- /*
- * --interface does not actually work with dnsmasq < 2.47,
- * due to DAD for ipv6 addresses on the interface.
- *
- * virCommandAddArgList(cmd, "--interface", ipdef->bridge, NULL);
+ /* It may have been important not to use --interface at one time,
+ * but with with dnsmasq => 2.61 there is a problem if
+ * --interface is not specified because --bind-interfaces
+ * will have no effect. Here is what Simon Kelly (dnsmasq
+ * developer) has to say on the subject:
+ * "The problem is that, without SO_BINDTODEVICE, there is
+ * no guarantee that the kernel will route DHCP (v4 or v6)
+ * packets to the correct instance of dnsmasq,
+ * when there is more than one."
*
- * So listen on all defined IPv[46] addresses
+ * --interface is added but the --listen-address parameters
+ * are left in.
*/
+
+ virCommandAddArgList(cmd, "--interface", network->def->bridge, NULL);
+
for (ii = 0;
(tmpipdef = virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, ii));
ii++) {
diff --git a/tests/networkxml2argvdata/isolated-network.argv b/tests/networkxml2argvdata/isolated-network.argv
index 048c72b..c27f793 100644
--- a/tests/networkxml2argvdata/isolated-network.argv
+++ b/tests/networkxml2argvdata/isolated-network.argv
@@ -1,6 +1,7 @@
@DNSMASQ@ --strict-order --bind-interfaces \
--local=// --domain-needed --conf-file= \
--except-interface lo --dhcp-option=3 --no-resolv \
+--interface virbr2 \
--listen-address 192.168.152.1 \
--dhcp-range 192.168.152.2,192.168.152.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/private.leases --dhcp-lease-max=253 \
diff --git a/tests/networkxml2argvdata/nat-network-dns-hosts.argv b/tests/networkxml2argvdata/nat-network-dns-hosts.argv
index 03a0676..0b72bcd 100644
--- a/tests/networkxml2argvdata/nat-network-dns-hosts.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-hosts.argv
@@ -1,4 +1,5 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
--local=/example.com/ --domain-needed \
---conf-file= --except-interface lo --listen-address 192.168.122.1 \
+--conf-file= --except-interface lo \
+--interface virbr0 --listen-address 192.168.122.1 \
--expand-hosts --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
index a1e4200..f1273de 100644
--- a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
@@ -4,6 +4,7 @@
--local=// --domain-needed --conf-file= \
--except-interface lo \
--srv-host=name.tcp.,,,, \
+--interface virbr0 \
--listen-address 192.168.122.1 \
--listen-address 192.168.123.1 \
--listen-address 2001:db8:ac10:fe01::1 \
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
index 8af38c4..6aac056 100644
--- a/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
@@ -4,6 +4,7 @@
--local=// --domain-needed --conf-file= \
--except-interface lo \
--srv-host=name.tcp.test-domain-name,.,1024,10,10 \
+--interface virbr0 \
--listen-address 192.168.122.1 \
--listen-address 192.168.123.1 \
--listen-address 2001:db8:ac10:fe01::1 \
diff --git a/tests/networkxml2argvdata/nat-network-dns-txt-record.argv b/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
index 404b56a..a65e9a8 100644
--- a/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
@@ -1,6 +1,7 @@
@DNSMASQ@ --strict-order --bind-interfaces \
--local=// --domain-needed --conf-file= \
--except-interface lo '--txt-record=example,example value' \
+--interface virbr0 \
--listen-address 192.168.122.1 --listen-address 192.168.123.1 \
--listen-address 2001:db8:ac10:fe01::1 \
--listen-address 2001:db8:ac10:fd01::1 --listen-address 10.24.10.1 \
diff --git a/tests/networkxml2argvdata/nat-network.argv b/tests/networkxml2argvdata/nat-network.argv
index 1dc8f73..f25979d 100644
--- a/tests/networkxml2argvdata/nat-network.argv
+++ b/tests/networkxml2argvdata/nat-network.argv
@@ -1,6 +1,7 @@
@DNSMASQ@ --strict-order --bind-interfaces \
--local=// --domain-needed --conf-file= \
---except-interface lo --listen-address 192.168.122.1 \
+--except-interface lo --interface virbr0 \
+--listen-address 192.168.122.1 \
--listen-address 192.168.123.1 --listen-address 2001:db8:ac10:fe01::1 \
--listen-address 2001:db8:ac10:fd01::1 --listen-address 10.24.10.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
diff --git a/tests/networkxml2argvdata/netboot-network.argv b/tests/networkxml2argvdata/netboot-network.argv
index 5a85ec2..59a0266 100644
--- a/tests/networkxml2argvdata/netboot-network.argv
+++ b/tests/networkxml2argvdata/netboot-network.argv
@@ -1,6 +1,7 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
--local=/example.com/ --domain-needed --conf-file= \
---except-interface lo --listen-address 192.168.122.1 \
+--except-interface lo --interface virbr1 \
+--listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
--dhcp-lease-max=253 --dhcp-no-override --expand-hosts --enable-tftp \
diff --git a/tests/networkxml2argvdata/netboot-proxy-network.argv b/tests/networkxml2argvdata/netboot-proxy-network.argv
index 36836b0..e3fe668 100644
--- a/tests/networkxml2argvdata/netboot-proxy-network.argv
+++ b/tests/networkxml2argvdata/netboot-proxy-network.argv
@@ -1,6 +1,7 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
--local=/example.com/ --domain-needed --conf-file= \
---except-interface lo --listen-address 192.168.122.1 \
+--except-interface lo --interface virbr1 \
+--listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
--dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
diff --git a/tests/networkxml2argvdata/routed-network.argv b/tests/networkxml2argvdata/routed-network.argv
index 77e802f..093c0ee 100644
--- a/tests/networkxml2argvdata/routed-network.argv
+++ b/tests/networkxml2argvdata/routed-network.argv
@@ -1,3 +1,4 @@
@DNSMASQ@ --strict-order --bind-interfaces \
--local=// --domain-needed --conf-file= \
---except-interface lo --listen-address 192.168.122.1\
+--except-interface lo --interface virbr1 \
+--listen-address 192.168.122.1\
--
1.7.11.7
12 years, 1 month
[libvirt] [PATCH v3] selinux: relabel tapfd in qemuPhysIfaceConnect
by Guannan Ren
Relabeling tapfd right after the tap device is created.
qemuPhysIfaceConnect is common function called both for static
netdevs and for hotplug netdevs.
---
src/qemu/qemu_command.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0c0c400..81bed38 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -170,12 +170,21 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
vmop, driver->stateDir,
virDomainNetGetActualBandwidth(net));
if (rc >= 0) {
+ if (virSecurityManagerSetTapFDLabel(driver->securityManager,
+ def, rc) < 0)
+ goto error;
+
virDomainAuditNetDevice(def, net, res_ifname, true);
VIR_FREE(net->ifname);
net->ifname = res_ifname;
}
return rc;
+
+error:
+ VIR_FREE(res_ifname);
+ VIR_FORCE_CLOSE(rc);
+ return -1;
}
@@ -5425,10 +5434,6 @@ qemuBuildCommandLine(virConnectPtr conn,
if (tapfd < 0)
goto error;
- if (virSecurityManagerSetTapFDLabel(driver->securityManager,
- def, tapfd) < 0)
- goto error;
-
last_good_net = i;
virCommandTransferFD(cmd, tapfd);
--
1.7.11.4
12 years, 1 month
[libvirt] [PATCH v4 0/4] command line fd passing using fd sets
by Corey Bryant
This series adds command line file descriptor passing support
via a new -add-fd option. This is a follow-on to the existing
QMP fd passing support provided in the following patch series:
comments.gmane.org/gmane.comp.emulators.qemu/165463
The new -add-fd option is designed to mirror the add-fd QMP
option as much as possible.
Corey Bryant (4):
monitor: Allow add-fd to any specified fd set
monitor: Enable adding an inherited fd to an fd set
monitor: Prevent removing fd from set during init
qemu-config: Add new -add-fd command line option
monitor.c | 142 ++++++++++++++++++++++++++++++++++---------------------
monitor.h | 3 ++
qapi-schema.json | 2 +-
qemu-config.c | 22 +++++++++
qemu-options.hx | 36 ++++++++++++++
vl.c | 78 ++++++++++++++++++++++++++++++
6 files changed, 228 insertions(+), 55 deletions(-)
--
1.7.11.4
12 years, 1 month
[libvirt] [PATCH] qemu: Allow migration with host USB devices
by Jiri Denemark
Recently, patches were added support for (managed)saving, restoring, and
migrating domains with host USB devices. However, qemu driver would
still forbid migration of such domains because qemuMigrationIsAllowed
was not updated.
---
src/qemu/qemu_migration.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 65cd6ec..a2402ce 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -800,6 +800,8 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
virDomainDefPtr def)
{
int nsnapshots;
+ bool forbid;
+ int i;
if (vm) {
if (qemuProcessAutoDestroyActive(driver, vm)) {
@@ -817,9 +819,23 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
def = vm->def;
}
- if (def->nhostdevs > 0) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain with assigned host devices cannot be migrated"));
+
+ /* Migration with USB host devices is allowed, all other devices are
+ * forbidden.
+ */
+ forbid = false;
+ for (i = 0; i < def->nhostdevs; i++) {
+ virDomainHostdevDefPtr hostdev = def->hostdevs[i];
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+ hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
+ forbid = true;
+ break;
+ }
+ }
+ if (forbid) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain with assigned non-USB host devices "
+ "cannot be migrated"));
return false;
}
--
1.7.12.4
12 years, 1 month
[libvirt] [PATCH] qemu: Fix emulator affinity
by Martin Kletzander
Commit ba63d8f7d843461f77a8206c1ef9da38388713e5 introduced a bug that
makes machines, that don't have either cpuset in <vcpu> or
<emulatorpin> specified, fail. Because the function that sets
affinity is called without any check, the function must not fail
unless there is an error.
---
src/qemu/qemu_process.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index e08ec67..b97aaef 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2029,22 +2029,24 @@ static int
qemuProcessSetEmulatorAffinites(virConnectPtr conn,
virDomainObjPtr vm)
{
- virBitmapPtr cpumask;
+ virBitmapPtr cpumask = NULL;
virDomainDefPtr def = vm->def;
virNodeInfo nodeinfo;
int ret = -1;
- if (virNodeGetInfo(conn, &nodeinfo) != 0)
- return -1;
+ if (virNodeGetInfo(conn, &nodeinfo) < 0)
+ goto cleanup;
if (def->cputune.emulatorpin)
cpumask = def->cputune.emulatorpin->cpumask;
else if (def->cpumask)
cpumask = def->cpumask;
+
+ if (cpumask)
+ ret = virProcessInfoSetAffinity(vm->pid, cpumask);
else
- goto cleanup;
+ ret = 0;
- ret = virProcessInfoSetAffinity(vm->pid, cpumask);
cleanup:
return ret;
}
--
1.7.12.3
12 years, 1 month
[libvirt] [PATCH] qemu: Set arch to i686 if qemu-system-i386 is found
by Guido Günther
If we can't probe the architecture from QMP we parse the architecture
from the qemu binaries name. This results in the architecture being i386
instead of i686 which then results in QEMU_CAPS_PCI_MULTIBUS being unset
which gives a broken qemu command line.
This probably didn't show up earlier since most of the time there's also
a /usr/bin/qemu around which results in i686 capabilities.
---
src/qemu/qemu_capabilities.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7c391b3..e897f86 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2055,6 +2055,8 @@ qemuCapsInitHelp(qemuCapsPtr caps)
/* For historical compat we use 'itanium' as arch name */
if (STREQ(tmp, "ia64"))
tmp = "itanium";
+ else if (STREQ(tmp, "i386"))
+ tmp = "i686";
} else {
uname_normalize(&ut);
tmp = ut.machine;
--
1.7.10.4
12 years, 1 month
[libvirt] [PATCH][RFC] helper of copy-storage-* features
by liguang
help to create disk images copy-storage-* required,
try to do non-shared migration without bothering to
create disk images at target by hand.
consider this situation:
1. non-shared migration
virsh migrate --copy-storage-all ...
2. migration fails
3. create disk images required
qemu-img create ...
4 migration run smoothly
so, try do remove step 2, 3, 4
this kind of use had been discussed before,
http://www.redhat.com/archives/libvir-list/2011-December/msg00451.html
It did not handle more about complete situations
suggested by Daniel P. Berrange,
https://www.redhat.com/archives/libvir-list/2012-October/msg00407.html
Signed-off-by: liguang <lig.fnst(a)cn.fujitsu.com>
---
src/libvirt_private.syms | 1 +
src/qemu/qemu_migration.c | 92 +++++++++++++++++++++++++++++++++++++++++++-
src/util/util.c | 17 ++++++++
src/util/util.h | 1 +
4 files changed, 108 insertions(+), 3 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index a8c81e7..a293184 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1202,6 +1202,7 @@ virArgvToString;
virAsprintf;
virBuildPathInternal;
virDirCreate;
+virDirOfFile;
virDoubleToStr;
virEnumFromString;
virEnumToString;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index db69a0a..ac3e1c3 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -70,6 +70,7 @@ enum qemuMigrationCookieFlags {
QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS,
QEMU_MIGRATION_COOKIE_FLAG_LOCKSTATE,
QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT,
+ QEMU_MIGRATION_COOKIE_FLAG_COPYSTORAGE,
QEMU_MIGRATION_COOKIE_FLAG_LAST
};
@@ -77,12 +78,13 @@ enum qemuMigrationCookieFlags {
VIR_ENUM_DECL(qemuMigrationCookieFlag);
VIR_ENUM_IMPL(qemuMigrationCookieFlag,
QEMU_MIGRATION_COOKIE_FLAG_LAST,
- "graphics", "lockstate", "persistent");
+ "graphics", "lockstate", "persistent", "copystorage");
enum qemuMigrationCookieFeatures {
QEMU_MIGRATION_COOKIE_GRAPHICS = (1 << QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS),
QEMU_MIGRATION_COOKIE_LOCKSTATE = (1 << QEMU_MIGRATION_COOKIE_FLAG_LOCKSTATE),
QEMU_MIGRATION_COOKIE_PERSISTENT = (1 << QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT),
+ QEMU_MIGRATION_COOKIE_COPYSTORAGE = (1 << QEMU_MIGRATION_COOKIE_FLAG_COPYSTORAGE),
};
typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics;
@@ -439,6 +441,10 @@ qemuMigrationCookieXMLFormat(struct qemud_driver *driver,
virBufferAdjustIndent(buf, -2);
}
+ if (mig->flags & QEMU_MIGRATION_COOKIE_COPYSTORAGE)
+ virBufferAsprintf(buf, " <copystorage/>\n");
+
+
virBufferAddLit(buf, "</qemu-migration>\n");
return 0;
}
@@ -662,6 +668,11 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
VIR_FREE(nodes);
}
+ if ((flags & QEMU_MIGRATION_COOKIE_COPYSTORAGE)) {
+ if (virXPathBoolean("count(./copystorage) > 0", ctxt))
+ mig->flags |= QEMU_MIGRATION_COOKIE_COPYSTORAGE;
+ }
+
return 0;
error:
@@ -1215,6 +1226,60 @@ qemuMigrationPrepareCleanup(struct qemud_driver *driver,
qemuDomainObjDiscardAsyncJob(driver, vm);
}
+static int qemuMigrationHandleDiskFiles(const char *dom_xml, int pin)
+{
+ xmlDocPtr doc = NULL;
+ xmlXPathContextPtr ctxt = NULL;
+ xmlNodePtr *disks = NULL;
+ virCommandPtr cmd = NULL;
+ int i, nr, ret = -1;
+ char *file_name[] = {}, *file_fmt[] = {};
+ char *driver_name, *tmp_dir;
+
+ if (!(doc = virXMLParseStringCtxt(dom_xml, _("(domain_definition)"), &ctxt)))
+ goto cleanup;
+
+ if ((nr = virXPathNodeSet("./devices/disk", ctxt, &disks)) <= 0)
+ goto cleanup;
+
+ for (i = 0; i < nr; i++) {
+ ctxt->node = disks[i];
+ driver_name = virXPathString("string(./driver/@name)", ctxt);
+ if (STRNEQ(driver_name, "qemu"))
+ continue;
+ file_fmt[i] = virXPathString("string(./driver/@type)", ctxt);
+ file_name[i] = virXPathString("string(./source/file)", ctxt);
+ if (virFileExists(file_name[i]) && !pin)
+ continue;
+ if ((tmp_dir = virDirOfFile(file_name[i])) == NULL)
+ continue;
+ if (!virFileExists(tmp_dir))
+ if (virFileMakePath(tmp_dir) < 0)
+ continue;
+ if (pin)
+ cmd = virCommandNewArgList("qemu-img", "create", "-f",
+ file_fmt[i], file_name[i], ~0UL, NULL);
+ else
+ cmd = virCommandNewArgList("rm", "-f", file_name[i], NULL);
+ if (virCommandRun(cmd, NULL) < 0) {
+ goto cleanup;
+ virReportSystemError(errno, "%s",
+ _("unable create disk images by qemu-img"));
+ }
+ }
+
+ ret = 0;
+
+cleanup:
+ xmlXPathFreeContext(ctxt);
+ xmlFreeDoc(doc);
+ VIR_FREE(disks);
+ virCommandFree(cmd);
+ VIR_FREE(driver_name);
+ VIR_FREE(tmp_dir);
+ return ret;
+}
+
static int
qemuMigrationPrepareAny(struct qemud_driver *driver,
virConnectPtr dconn,
@@ -1314,6 +1379,14 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
origname = NULL;
if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
+ QEMU_MIGRATION_COOKIE_COPYSTORAGE)))
+ goto cleanup;
+
+ if (mig->flags & QEMU_MIGRATION_COOKIE_COPYSTORAGE)
+ if (qemuMigrationHandleDiskFiles(dom_xml, 1) < 0)
+ goto cleanup;
+
+ if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
QEMU_MIGRATION_COOKIE_LOCKSTATE)))
goto cleanup;
@@ -1900,8 +1973,13 @@ qemuMigrationRun(struct qemud_driver *driver,
if (flags & VIR_MIGRATE_NON_SHARED_DISK)
migrate_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_DISK;
- if (flags & VIR_MIGRATE_NON_SHARED_INC)
+ if (flags & VIR_MIGRATE_NON_SHARED_INC) {
migrate_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_INC;
+ if (qemuMigrationBakeCookie(mig, driver, vm,
+ cookieout, cookieoutlen,
+ QEMU_MIGRATION_COOKIE_COPYSTORAGE) < 0)
+ goto cleanup;
+ }
/* connect to the destination qemu if needed */
if (spec->destType == MIGRATION_DEST_CONNECT_HOST &&
@@ -2929,14 +3007,18 @@ qemuMigrationFinish(struct qemud_driver *driver,
int newVM = 1;
qemuMigrationCookiePtr mig = NULL;
virErrorPtr orig_err = NULL;
- int cookie_flags = 0;
+ int cookie_flags = 0, migration_status = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
+ char *dom_xml = NULL;
VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
"cookieout=%p, cookieoutlen=%p, flags=%lx, retcode=%d",
driver, dconn, vm, NULLSTR(cookiein), cookieinlen,
cookieout, cookieoutlen, flags, retcode);
+ if (!(dom_xml = qemuDomainFormatXML(driver, vm, VIR_DOMAIN_XML_SECURE, false)))
+ goto cleanup;
+
if (!qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN))
goto cleanup;
@@ -3088,7 +3170,11 @@ qemuMigrationFinish(struct qemud_driver *driver,
if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen, 0) < 0)
VIR_WARN("Unable to encode migration cookie");
+ migration_status = 1;
+
endjob:
+ if (!migration_status)
+ qemuMigrationHandleDiskFiles(dom_xml, 0);
if (qemuMigrationJobFinish(driver, vm) == 0) {
vm = NULL;
} else if (!vm->persistent && !virDomainObjIsActive(vm)) {
diff --git a/src/util/util.c b/src/util/util.c
index 348c388..1f51a77 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -3108,3 +3108,20 @@ virValidateWWN(const char *wwn) {
return true;
}
+
+char *virDirOfFile(const char *file)
+{
+ char *p, *tmp;
+
+ if (file == NULL)
+ return NULL;
+ if ((tmp = strdup(file)) == NULL)
+ return NULL;
+ if ((p = strrchr(file, '/')) == NULL)
+ return getcwd(tmp, strlen(file));
+ if (strlen(p) == 0)
+ return NULL;
+ tmp[strlen(file) - strlen(p)] = '\0';
+
+ return tmp;
+}
diff --git a/src/util/util.h b/src/util/util.h
index 4316ab1..255b7b2 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -114,6 +114,7 @@ enum {
};
int virDirCreate(const char *path, mode_t mode, uid_t uid, gid_t gid,
unsigned int flags) ATTRIBUTE_RETURN_CHECK;
+char *virDirOfFile(const char *file) ATTRIBUTE_RETURN_CHECK;
int virFileMakePath(const char *path) ATTRIBUTE_RETURN_CHECK;
int virFileMakePathWithMode(const char *path,
mode_t mode) ATTRIBUTE_RETURN_CHECK;
--
1.7.2.5
12 years, 1 month
[libvirt] [PATCH] qemu: Don't fail without emulatorpin or cpumask
by Guido Günther
This unbreaks qemu:///session that got broken by
ba63d8f7d843461f77a8206c1ef9da38388713e5.
---
src/qemu/qemu_process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index e08ec67..293ffe9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2041,8 +2041,10 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn,
cpumask = def->cputune.emulatorpin->cpumask;
else if (def->cpumask)
cpumask = def->cpumask;
- else
+ else {
+ ret = 0;
goto cleanup;
+ }
ret = virProcessInfoSetAffinity(vm->pid, cpumask);
cleanup:
--
1.7.10.4
12 years, 1 month
[libvirt] [PATCH] Autogenerate AUTHORS
by Cole Robinson
AUTHORS.in tracks the maintainers, as well as some folks who were
previously in AUTHORS but don't have a git commit with proper
attribution.
Generated output is sorted alphabetically and lacks pretty spacing, so
tweak AUTHORS.in to follow the same format.
Additionally, drop the syntax-check rule that previously validated
AUTHORS against git log.
---
.gitignore | 1 +
.mailmap | 15 +++-
AUTHORS | 279 ---------------------------------------------------------
AUTHORS.in | 88 ++++++++++++++++++
Makefile.am | 12 ++-
bootstrap.conf | 3 +-
cfg.mk | 15 ----
7 files changed, 116 insertions(+), 297 deletions(-)
delete mode 100644 AUTHORS
create mode 100644 AUTHORS.in
diff --git a/.gitignore b/.gitignore
index c185cbc..804eda4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@
.memdump
.sc-start-sc_*
/ABOUT-NLS
+/AUTHORS
/COPYING
/ChangeLog
/GNUmakefile
diff --git a/.mailmap b/.mailmap
index 98ff6dc..c430200 100644
--- a/.mailmap
+++ b/.mailmap
@@ -3,7 +3,6 @@
# Email consolidation:
# <Preferred address in AUTHORS> <other alias used by same author>
-<amy.griffis(a)hp.com> <aron.griffis(a)hp.com>
<bozzolan(a)gmail.com> <redshift(a)gmx.com>
<charles_duffy(a)messageone.com> <charles(a)dyfis.net>
<dfj(a)redhat.com> <dfj(a)dfj.bne.redhat.com>
@@ -35,6 +34,8 @@
<gerd(a)egidy.de> <gerd.von.egidy(a)intra2net.com>
<benoar(a)dolka.fr> <benjamin.cama(a)telecom-bretagne.eu>
<zhlcindy(a)linux.vnet.ibm.com> <zhlcindy(a)gmail.com>
+<serge.hallyn(a)canonical.com> <serue(a)us.ibm.com>
+<pritesh.kothari(a)sun.com> <Pritesh.Kothari(a)Sun.COM>
# Name consolidation:
# Preferred author spelling <preferred email>
@@ -43,3 +44,15 @@ Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Daniel J Walsh <dwalsh(a)redhat.com>
Ján Tomko <jtomko(a)redhat.com>
Gerd von Egidy <gerd(a)egidy.de>
+MATSUDA Daiki <matsudadik(a)intellilink.co.jp>
+Tang Chen <tangchen(a)cn.fujitsu.com>
+Peng Zhou <ailvpeng25(a)gmail.com>
+Dirk Herrendoerfer <d.herrendoerfer(a)herrendoerfer.name>
+Thibault VINCENT <thibault.vincent(a)smartjog.com>
+Aurelien Rougemont <beorn(a)binaries.fr>
+Serge E. Hallyn <serge.hallyn(a)canonical.com>
+Henrik Persson E <henrik.e.persson(a)ericsson.com>
+Philipp Hahn <hahn(a)univention.de>
+Marco Bozzolan <bozzolan(a)gmail.com>
+Marco Bozzolan <redshift(a)gmx.com>
+Pritesh Kothari <pritesh.kothari(a)sun.com>
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 27c4eda..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,279 +0,0 @@
- libvirt Authors
- ===============
-
-The libvirt project was initiated by:
-
- Daniel Veillard <veillard(a)redhat.com> or <daniel(a)veillard.com>
-
-The primary maintainers and people with commit access rights:
-
- Daniel Veillard <veillard(a)redhat.com>
- Daniel Berrange <berrange(a)redhat.com>
- Richard W.M. Jones <rjones(a)redhat.com>
- Mark McLoughlin <markmc(a)redhat.com>
- Anthony Liguori <aliguori(a)us.ibm.com>
- Jim Meyering <meyering(a)redhat.com>
- Jim Fehlig <jfehlig(a)suse.com>
- Chris Lalancette <clalance(a)redhat.com>
- Cole Robinson <crobinso(a)redhat.com>
- Guido Günther <agx(a)sigxcpu.org>
- John Levon <john.levon(a)sun.com>
- Matthias Bolte <matthias.bolte(a)googlemail.com>
- Jiří Denemark <jdenemar(a)redhat.com>
- Dave Allan <dallan(a)redhat.com>
- Laine Stump <laine(a)redhat.com>
- Stefan Berger <stefanb(a)us.ibm.com>
- Eric Blake <eblake(a)redhat.com>
- Justin Clift <jclift(a)redhat.com>
- Osier Yang <jyang(a)redhat.com>
- Wen Congyang <wency(a)cn.fujitsu.com>
- Michal Prívozník <mprivozn(a)redhat.com>
- Peter Krempa <pkrempa(a)redhat.com>
- Christophe Fergeau <cfergeau(a)redhat.com>
- Alex Jia <ajia(a)redhat.com>
- Martin Kletzander <mkletzan(a)redhat.com>
-
-Previous maintainers:
- Karel Zak <kzak(a)redhat.com>
- Atsushi SAKAI <sakaia(a)jp.fujitsu.com>
- Dave Leskovec <dlesko(a)linux.vnet.ibm.com>
- Dan Smith <danms(a)us.ibm.com>
-
-Patches have also been contributed by:
-
- David Lutterkort <dlutter(a)redhat.com>
- Andrew Puch <apuch(a)redhat.com>
- Philippe Berthault <philippe.berthault(a)Bull.net>
- Hugh Brock <hbrock(a)redhat.com>
- Michel Ponceau <michel.ponceau(a)bull.net>
- Jeremy Katz <katzj(a)redhat.com>
- Pete Vetere <pvetere(a)redhat.com>
- Kazuki Mizushima <mizushima.kazuk(a)jp.fujitsu.com>
- Saori Fukuta <fukuta.saori(a)jp.fujitsu.com>
- Tatsuro Enokura <fj7716hz(a)aa.jp.fujitsu.com>
- Takahashi Tomohiro <takatom(a)jp.fujitsu.com>
- Nobuhiro Itou <fj0873gn(a)aa.jp.fujitsu.com>
- Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
- Mark Johnson <johnson.nh(a)gmail.com>
- Christian Ehrhardt <ehrhardt(a)linux.vnet.ibm.com>
- Shuveb Hussain <shuveb(a)binarykarma.com>
- Jim Paris <jim(a)jtan.com>
- Daniel Hokka Zakrisson <daniel(a)hozac.com>
- Mads Chr. Olesen <shiyee(a)shiyee.dk>
- Anton Protopopov <aspsk2(a)gmail.com>
- Stefan de Konink <dekonink(a)kinkrsoftware.nl>
- Kaitlin Rupert <kaitlin(a)linux.vnet.ibm.com>
- Evgeniy Sokolov <evg(a)openvz.org>
- David Lively <dlively(a)virtualiron.com>
- Charles Duffy <Charles_Duffy(a)messageone.com>
- Nguyen Anh Quynh <aquynh(a)gmail.com>
- James Morris <jmorris(a)namei.org>
- Chris Wright <chrisw(a)redhat.com>
- Ben Guthro <ben.guthro(a)gmail.com>
- Shigeki Sakamoto <fj0588di(a)aa.jp.fujitsu.com>
- Gerd von Egidy <gerd(a)egidy.de>
- Itamar Heim <iheim(a)redhat.com>
- Markus Armbruster <armbru(a)redhat.com>
- Ryota Ozaki <ozaki.ryota(a)gmail.com>
- Daniel J Walsh <dwalsh(a)redhat.com>
- Maximilian Wilhelm <max(a)rfc2324.org>
- Pritesh Kothari <Pritesh.Kothari(a)Sun.COM>
- Amit Shah <amit.shah(a)redhat.com>
- Florian Vichot <florian.vichot(a)diateam.net>
- Serge E. Hallyn <serue(a)us.ibm.com>
- Soren Hansen <soren(a)linux2go.dk>
- Abel Míguez Rodríguez<amiguezr(a)pdi.ucm.es>
- Doug Goldstein <cardoe(a)cardoe.com>
- Javier Fontan <jfontan(a)gmail.com>
- Federico Simoncelli <fsimonce(a)redhat.com>
- Amy Griffis <amy.griffis(a)hp.com>
- Henrik Persson E <henrik.e.persson(a)ericsson.com>
- Satoru SATOH <satoru.satoh(a)gmail.com>
- Paolo Bonzini <pbonzini(a)redhat.com>
- Miloslav Trmač <mitr(a)redhat.com>
- Jamie Strandboge <jamie(a)canonical.com>
- Gerhard Stenzel <gerhard.stenzel(a)de.ibm.com>
- Matthew Booth <mbooth(a)redhat.com>
- Diego Elio Pettenò <flameeyes(a)gmail.com>
- Adam Litke <agl(a)us.ibm.com>
- Steve Yarmie <steve.yarmie(a)gmail.com>
- Dan Kenigsberg <danken(a)redhat.com>
- Yuji NISHIDA <nishidy(a)nict.go.jp>
- Dustin Xiong <x_k_123(a)hotmail.com>
- Rolf Eike Beer <eike(a)sf-mail.de>
- Wolfgang Mauerer <wolfgang.mauerer(a)siemens.com>
- Philipp Hahn <hahn(a)univention.de>
- Ed Swierk <eswierk(a)aristanetworks.com>
- Paolo Smiraglia <paolo.smiraglia(a)gmail.com>
- Sharadha Prabhakar <sharadha.prabhakar(a)citrix.com>
- Chris Wong <wongc-redhat(a)hoku.net>
- Daniel Berteaud <daniel(a)firewall-services.com>
- Dustin Kirkland <kirkland(a)canonical.com>
- Luiz Capitulino <lcapitulino(a)redhat.com>
- Ryan Harper <ryanh(a)us.ibm.com>
- Spencer Shimko <sshimko(a)tresys.com>
- Marco Bozzolan <bozzolan(a)gmail.com>
- Alex Williamson <alex.williamson(a)redhat.com>
- Ersek Laszlo <lacos(a)caesar.elte.hu>
- Kenneth Nagin <NAGIN(a)il.ibm.com>
- Klaus Ethgen <Klaus(a)Ethgen.de>
- Bryan Kearney <bkearney(a)redhat.com>
- Darry L. Pierce <dpierce(a)redhat.com>
- David Jorm <dfj(a)redhat.com>
- Eduardo Otubo <otubo(a)linux.vnet.ibm.com>
- Garry Dolley <gdolley(a)arpnetworks.com>
- Harshavardhana <harsha(a)gluster.com>
- Jonas Eriksson <jonas.j.eriksson(a)ericsson.com>
- Jun Koi <junkoi2004(a)gmail.com>
- Olivier Fourdan <ofourdan(a)redhat.com>
- Ron Yorston <rmy(a)tigress.co.uk>
- Shahar Klein <shaharklein(a)yahoo.com>
- Taizo ITO <taizo.ito(a)hde.co.jp>
- Thomas Treutner <thomas(a)scripty.at>
- Jean-Baptiste Rouault <jean-baptiste.rouault(a)diateam.net>
- Марк Коренберг <socketpair(a)gmail.com>
- Alan Pevec <apevec(a)redhat.com>
- Aurelien Rougemont <beorn(a)binaries.fr>
- Patrick Dignan <pat_dignan(a)dell.com>
- Serge Hallyn <serge.hallyn(a)canonical.com>
- Nikunj A. Dadhania <nikunj(a)linux.vnet.ibm.com>
- Lai Jiangshan <laijs(a)cn.fujitsu.com>
- Harsh Prateek Bora <harsh(a)linux.vnet.ibm.com>
- John Morrissey <jwm(a)horde.net>
- KAMEZAWA Hiroyuki <kamezawa.hiroyu(a)jp.fujitsu.com>
- Hu Tao <hutao(a)cn.fujitsu.com>
- Laurent Léonard <laurent(a)open-minds.org>
- MORITA Kazutaka <morita.kazutaka(a)lab.ntt.co.jp>
- Josh Durgin <josh.durgin(a)inktank.com>
- Roopa Prabhu <roprabhu(a)cisco.com>
- Paweł Krześniak <pawel.krzesniak(a)gmail.com>
- Kay Schubert <kayegypt(a)web.de>
- Marc-André Lureau <marcandre.lureau(a)redhat.com>
- Juerg Haefliger <juerg.haefliger(a)hp.com>
- Matthias Dahl <mdvirt(a)designassembly.de>
- Niels de Vos <ndevos(a)redhat.com>
- Davidlohr Bueso <dave(a)gnu.org>
- Alon Levy <alevy(a)redhat.com>
- Hero Phương <herophuong93(a)gmail.com>
- Zdenek Styblik <stybla(a)turnovfree.net>
- Gui Jianfeng <guijianfeng(a)cn.fujitsu.com>
- Michal Novotny <minovotn(a)redhat.com>
- Markus Groß <gross(a)univention.de>
- Phil Petty <phpetty(a)cisco.com>
- Taku Izumi <izumi.taku(a)jp.fujitsu.com>
- Minoru Usui <usui(a)mxm.nes.nec.co.jp>
- Tiziano Mueller <dev-zero(a)gentoo.org>
- Thibault VINCENT <thibault.vincent(a)smartjog.com>
- Naoya Horiguchi <n-horiguchi(a)ah.jp.nec.com>
- Jesse Cook <code.crashenx(a)gmail.com>
- Alexander Todorov <atodorov(a)otb.bg>
- Richard Laager <rlaager(a)wiktel.com>
- Mark Wu <dwu(a)redhat.com>
- Yufang Zhang <yuzhang(a)redhat.com>
- Supriya Kannery <supriyak(a)linux.vnet.ibm.com>
- Dirk Herrendoerfer <d.herrendoerfer(a)herrendoerfer.name>
- Taisuke Yamada <tai(a)rakugaki.org>
- Heath Petersen <HeathPetersen(a)Kandre.com>
- Neil Wilson <neil(a)aldur.co.uk>
- Ohad Levy <ohadlevy(a)gmail.com>
- Michael Chapman <mike(a)very.puzzling.org>
- Daniel Gollub <gollub(a)b1-systems.de>
- David S. Wang <dwang2(a)cisco.com>
- Ruben Kerkhof <ruben(a)rubenkerkhof.com>
- Scott Moser <smoser(a)ubuntu.com>
- Guannan Ren <gren(a)redhat.com>
- John Williams <john.williams(a)petalogix.com>
- Michael Santos <michael.santos(a)gmail.com>
- Oskari Saarenmaa <os(a)ohmu.fi>
- Nan Zhang <nzhang(a)redhat.com>
- Wieland Hoffmann <themineo(a)googlemail.com>
- Douglas Schilling Landgraf <dougsland(a)redhat.com>
- Tom Vijlbrief <tom.vijlbrief(a)xs4all.nl>
- Shradha Shah <sshah(a)solarflare.com>
- Steve Hodgson <shodgson(a)solarflare.com>
- Xu He Jie <xuhj(a)linux.vnet.ibm.com>
- Lei Li <lilei(a)linux.vnet.ibm.com>
- Matthias Witte <witte(a)netzquadrat.de>
- Tang Chen <tangchen(a)cn.fujitsu.com>
- Dan Horák <dan(a)danny.cz>
- Sage Weil <sage(a)newdream.net>
- David L Stevens <dlstevens(a)us.ibm.com>
- Tyler Coumbes <coumbes(a)gmail.com>
- Royce Lv <lvroyce(a)linux.vnet.ibm.com>
- Patrice LACHANCE <patlachance(a)gmail.com>
- Eli Qiao <taget(a)linux.vnet.ibm.com>
- Michael Wood <esiotrot(a)gmail.com>
- Bharata B Rao <bharata(a)linux.vnet.ibm.com>
- Srivatsa S. Bhat <srivatsa.bhat(a)linux.vnet.ibm.com>
- Chang Liu <lingjiao.lc(a)taobao.com>
- Lorin Hochstein <lorin(a)isi.edu>
- Christian Franke <nobody(a)nowhere.ws>
- Prerna Saxena <prerna(a)linux.vnet.ibm.com>
- Michael Ellerman <michael(a)ellerman.id.au>
- Rommer <rommer(a)active.by>
- Yuri Chornoivan <yurchor(a)ukr.net>
- Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>
- Laszlo Ersek <lersek(a)redhat.com>
- Zeeshan Ali (Khattak) <zeeshanak(a)gnome.org>
- Marcelo Cerri <mhcerri(a)linux.vnet.ibm.com>
- Hendrik Schwartke <hendrik(a)os-t.de>
- Ansis Atteka <aatteka(a)nicira.com>
- Dan Wendlandt <dan(a)nicira.com>
- Kyle Mestery <kmestery(a)cisco.com>
- Lincoln Myers <lincoln_myers(a)yahoo.com>
- Peter Robinson <pbrobinson(a)gmail.com>
- Benjamin Cama <benoar(a)dolka.fr>
- Duncan Rance <libvirt(a)dunquino.com>
- Peng Zhou <ailvpeng25(a)gmail.com>
- Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
- Stef Walter <stefw(a)gnome.org>
- Christian Benvenuti <benve(a)cisco.com>
- Ilja Livenson <ilja.livenson(a)gmail.com>
- Stefan Bader <stefan.bader(a)canonical.com>
- MATSUDA Daiki <matsudadik(a)intellilink.co.jp>
- Jan Kiszka <jan.kiszka(a)siemens.com>
- Ryan Woodsmall <rwoodsmall(a)gmail.com>
- Wido den Hollander <wido(a)widodh.nl>
- Eugen Feller <eugen.feller(a)inria.fr>
- Dmitry Guryanov <dguryanov(a)parallels.com>
- William Jon McCann <william.jon.mccann(a)gmail.com>
- David Weber <wb(a)munzinger.de>
- Marti Raudsepp <marti(a)juffo.org>
- Radu Caragea <dmns_serp(a)yahoo.com>
- Beat Jörg <Beat.Joerg(a)ssatr.ch>
- Gao feng <gaofeng(a)cn.fujitsu.com>
- Dipankar Sarma <dipankar(a)in.ibm.com>
- Gerd Hoffmann <kraxel(a)redhat.com>
- Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
- Thang Pham <thang.pham(a)us.ibm.com>
- Eiichi Tsukata <eiichi.tsukata.xh(a)hitachi.com>
- Sascha Peilicke <saschpe(a)suse.de>
- Chuck Short <chuck.short(a)canonical.com>
- Sebastian Wiedenroth <wiedi(a)frubar.net>
- Ata E Husain Bohra <ata.husain(a)hotmail.com>
- Ján Tomko <jtomko(a)redhat.com>
- Richa Marwaha <rmarwah(a)linux.vnet.ibm.com>
- Peter Feiner <peter(a)gridcentric.ca>
- Frido Roose <frido.roose(a)gmail.com>
- Asad Saeed <asad.saeed(a)acidseed.com>
- Sukadev Bhattiprolu <sukadev(a)linux.vnet.ibm.com>
- Thomas Woerner <twoerner(a)redhat.com>
- J.B. Joret <jb(a)linux.vnet.ibm.com>
- Stefan Hajnoczi <stefanha(a)linux.vnet.ibm.com>
- Gene Czarcinski <gene(a)czarc.net>
- Nishank Trivedi <nistrive(a)cisco.com>
- Jasper Lievisse Adriaanse <jasper(a)humppa.nl>
- Paul Eggert <eggert(a)cs.ucla.edu>
- Dwight Engen <dwight.engen(a)oracle.com>
- liguang <lig.fnst(a)cn.fujitsu.com>
- Chuck Short <zulcss(a)gmail.com>
- Alexander Larsson <alexl(a)redhat.com>
-
- [....send patches to get your name here....]
-
-The libvirt Logo was designed by Diana Fong
-
--- End
-;; Local Variables:
-;; coding: utf-8
-;; End:
diff --git a/AUTHORS.in b/AUTHORS.in
new file mode 100644
index 0000000..f4c8a8a
--- /dev/null
+++ b/AUTHORS.in
@@ -0,0 +1,88 @@
+ libvirt Authors
+ ===============
+
+The libvirt project was initiated by:
+
+ Daniel Veillard <veillard(a)redhat.com> or <daniel(a)veillard.com>
+
+The primary maintainers and people with commit access rights:
+
+Daniel Veillard <veillard(a)redhat.com>
+Daniel Berrange <berrange(a)redhat.com>
+Richard W.M. Jones <rjones(a)redhat.com>
+Mark McLoughlin <markmc(a)redhat.com>
+Anthony Liguori <aliguori(a)us.ibm.com>
+Jim Meyering <meyering(a)redhat.com>
+Jim Fehlig <jfehlig(a)suse.com>
+Chris Lalancette <clalance(a)redhat.com>
+Cole Robinson <crobinso(a)redhat.com>
+Guido Günther <agx(a)sigxcpu.org>
+John Levon <john.levon(a)sun.com>
+Matthias Bolte <matthias.bolte(a)googlemail.com>
+Jiří Denemark <jdenemar(a)redhat.com>
+Dave Allan <dallan(a)redhat.com>
+Laine Stump <laine(a)redhat.com>
+Stefan Berger <stefanb(a)us.ibm.com>
+Eric Blake <eblake(a)redhat.com>
+Justin Clift <jclift(a)redhat.com>
+Osier Yang <jyang(a)redhat.com>
+Wen Congyang <wency(a)cn.fujitsu.com>
+Michal Prívozník <mprivozn(a)redhat.com>
+Peter Krempa <pkrempa(a)redhat.com>
+Christophe Fergeau <cfergeau(a)redhat.com>
+Alex Jia <ajia(a)redhat.com>
+Martin Kletzander <mkletzan(a)redhat.com>
+
+Previous maintainers:
+
+Karel Zak <kzak(a)redhat.com>
+Atsushi SAKAI <sakaia(a)jp.fujitsu.com>
+Dave Leskovec <dlesko(a)linux.vnet.ibm.com>
+Dan Smith <danms(a)us.ibm.com>
+
+Patches have also been contributed by:
+
+David Lutterkort <dlutter(a)redhat.com>
+Andrew Puch <apuch(a)redhat.com>
+Philippe Berthault <philippe.berthault(a)Bull.net>
+Hugh Brock <hbrock(a)redhat.com>
+Michel Ponceau <michel.ponceau(a)bull.net>
+Jeremy Katz <katzj(a)redhat.com>
+Pete Vetere <pvetere(a)redhat.com>
+Kazuki Mizushima <mizushima.kazuk(a)jp.fujitsu.com>
+Saori Fukuta <fukuta.saori(a)jp.fujitsu.com>
+Tatsuro Enokura <fj7716hz(a)aa.jp.fujitsu.com>
+Takahashi Tomohiro <takatom(a)jp.fujitsu.com>
+Nobuhiro Itou <fj0873gn(a)aa.jp.fujitsu.com>
+Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
+Mark Johnson <johnson.nh(a)gmail.com>
+Christian Ehrhardt <ehrhardt(a)linux.vnet.ibm.com>
+Shuveb Hussain <shuveb(a)binarykarma.com>
+Daniel Hokka Zakrisson <daniel(a)hozac.com>
+Mads Chr. Olesen <shiyee(a)shiyee.dk>
+Anton Protopopov <aspsk2(a)gmail.com>
+Stefan de Konink <dekonink(a)kinkrsoftware.nl>
+Kaitlin Rupert <kaitlin(a)linux.vnet.ibm.com>
+Evgeniy Sokolov <evg(a)openvz.org>
+David Lively <dlively(a)virtualiron.com>
+James Morris <jmorris(a)namei.org>
+Ben Guthro <ben.guthro(a)gmail.com>
+Shigeki Sakamoto <fj0588di(a)aa.jp.fujitsu.com>
+Amit Shah <amit.shah(a)redhat.com>
+Itamar Heim <iheim(a)redhat.com>
+Markus Armbruster <armbru(a)redhat.com>
+Abel Míguez Rodríguez <amiguezr(a)pdi.ucm.es>
+Javier Fontan <jfontan(a)gmail.com>
+Matthias Witte <witte(a)netzquadrat.de>
+Dan Wendlandt <dan(a)nicira.com>
+
+#authorlist#
+
+[....send patches to get your name here....]
+
+The libvirt logo was designed by Diana Fong
+
+-- End
+;; Local Variables:
+;; coding: utf-8
+;; End:
diff --git a/Makefile.am b/Makefile.am
index 333e300..671c946 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,6 +28,7 @@ EXTRA_DIST = \
cfg.mk \
examples/domain-events/events-python \
run.in \
+ AUTHORS.in \
$(XML_EXAMPLES)
pkgconfigdir = $(libdir)/pkgconfig
@@ -78,7 +79,7 @@ MAINTAINERCLEANFILES = .git-module-status
# disable this check
distuninstallcheck:
-dist-hook: gen-ChangeLog
+dist-hook: gen-ChangeLog gen-AUTHORS
# Generate the ChangeLog file (with all entries since the switch to git)
# and insert it into the directory we're about to use to create a tarball.
@@ -91,3 +92,12 @@ gen-ChangeLog:
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
+
+.PHONY: gen-AUTHORS
+gen-AUTHORS:
+ if test -d .git; then \
+ out="$$(git log --pretty=format:'%aN <%aE>' | sort | uniq)" && \
+ cat AUTHORS.in | perl -p -e "s/#authorlist#/$$out/" > \
+ $(distdir)/AUTHORS-tmp && \
+ mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \
+ fi
diff --git a/bootstrap.conf b/bootstrap.conf
index f8b7c4d..c40db3d 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -223,7 +223,8 @@ if `(${PYTHON_CONFIG-python-config} --version;
PYTHON_CONFIG=true
fi
-# Automake requires that ChangeLog exist.
+# Automake requires that ChangeLog and AUTHORS exist.
+touch AUTHORS || exit 1
touch ChangeLog || exit 1
# Override bootstrap's list - we don't use mdate-sh or texinfo.tex.
diff --git a/cfg.mk b/cfg.mk
index e1fbf4f..eed7fd8 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -43,7 +43,6 @@ _test_script_regex = \<\(init\|test-lib\)\.sh\>
# Tests not to run as part of "make distcheck".
local-checks-to-skip = \
changelog-check \
- check-AUTHORS \
makefile-check \
makefile_path_separator_check \
patch-check \
@@ -711,20 +710,6 @@ _autogen:
$(srcdir)/autogen.sh
./config.status
-# Give credit where due:
-# Ensure that each commit author email address (possibly mapped via
-# git log's .mailmap) appears in our AUTHORS file.
-sc_check_author_list:
- @fail=0; \
- for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
- sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \
- grep -iq "<$$sanitized>" $(srcdir)/AUTHORS \
- || { printf '%s\n' "$$i" >&2; fail=1; }; \
- done; \
- test $$fail = 1 \
- && echo '$(ME): committer(s) not listed in AUTHORS' >&2; \
- test $$fail = 0
-
# regenerate HACKING as part of the syntax-check
syntax-check: $(top_srcdir)/HACKING
--
1.7.11.7
12 years, 1 month
[libvirt] [PATCH v3 4/4] qemu-config: Add new -add-fd command line option
by Corey Bryant
This option can be used for passing file descriptors on the
command line. It mirrors the existing add-fd QMP command which
allows an fd to be passed to QEMU via SCM_RIGHTS and added to an
fd set.
This can be combined with commands such as -drive to link file
descriptors in an fd set to a drive:
qemu-kvm -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
-drive file=/dev/fdset/2,index=0,media=disk
This example adds dups of fds 4 and 5, and the accompanying opaque
strings to the fd set with ID=2. qemu_open() already knows how
to handle a filename of this format. qemu_open() searches the
corresponding fd set for an fd and when it finds a match, QEMU
goes on to use a dup of that fd just like it would have used an
fd that it opened itself.
Signed-off-by: Corey Bryant <coreyb(a)linux.vnet.ibm.com>
---
v2:
- The -add-fd option is new in v2 (eblake(a)redhat.com)
v3:
- Require passed fd to be > stderr (eblake(a)redhat.com)
- Changed fds in examples to fd=3 and fd=4
- Add dup of passed fd to fd set and close passed fds after
processing all -add-fd commands (eblake(a)redhat.com)
qemu-config.c | 22 ++++++++++++++++++
qemu-options.hx | 36 +++++++++++++++++++++++++++++
vl.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 130 insertions(+)
diff --git a/qemu-config.c b/qemu-config.c
index cd1ec21..601237d 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -653,6 +653,27 @@ QemuOptsList qemu_boot_opts = {
},
};
+static QemuOptsList qemu_add_fd_opts = {
+ .name = "add-fd",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_add_fd_opts.head),
+ .desc = {
+ {
+ .name = "fd",
+ .type = QEMU_OPT_NUMBER,
+ .help = "file descriptor of which a duplicate is added to fd set",
+ },{
+ .name = "set",
+ .type = QEMU_OPT_NUMBER,
+ .help = "ID of the fd set to add fd to",
+ },{
+ .name = "opaque",
+ .type = QEMU_OPT_STRING,
+ .help = "free-form string used to describe fd",
+ },
+ { /* end of list */ }
+ },
+};
+
static QemuOptsList *vm_config_groups[32] = {
&qemu_drive_opts,
&qemu_chardev_opts,
@@ -669,6 +690,7 @@ static QemuOptsList *vm_config_groups[32] = {
&qemu_boot_opts,
&qemu_iscsi_opts,
&qemu_sandbox_opts,
+ &qemu_add_fd_opts,
NULL,
};
diff --git a/qemu-options.hx b/qemu-options.hx
index 7d97f96..a70182a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -257,6 +257,14 @@ qemu-system-i386 -drive file=file,index=2,media=disk
qemu-system-i386 -drive file=file,index=3,media=disk
@end example
+You can open an image using pre-opened file descriptors from an fd set:
+@example
+qemu-system-i386
+-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
+-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
+-drive file=/dev/fdset/2,index=0,media=disk
+@end example
+
You can connect a CDROM to the slave of ide0:
@example
qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
@@ -289,6 +297,34 @@ qemu-system-i386 -hda a -hdb b
@end example
ETEXI
+DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
+ "-add-fd fd=fd,set=set[,opaque=opaque]\n"
+ " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
+STEXI
+@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
+@findex -add-fd
+
+Add a file descriptor to an fd set. Valid options are:
+
+@table @option
+@item fd=@var{fd}
+This option defines the file descriptor of which a duplicate is added to fd set.
+The file descriptor cannot be stdin, stdout, or stderr.
+@item set=@var{set}
+This option defines the ID of the fd set to add the file descriptor to.
+@item opaque=@var{opaque}
+This option defines a free-form string that can be used to describe @var{fd}.
+@end table
+
+You can open an image using pre-opened file descriptors from an fd set:
+@example
+qemu-system-i386
+-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
+-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
+-drive file=/dev/fdset/2,index=0,media=disk
+@end example
+ETEXI
+
DEF("set", HAS_ARG, QEMU_OPTION_set,
"-set group.id.arg=value\n"
" set <arg> parameter for item <id> of type <group>\n"
diff --git a/vl.c b/vl.c
index 5b357a3..83205c0 100644
--- a/vl.c
+++ b/vl.c
@@ -790,6 +790,65 @@ static int parse_sandbox(QemuOpts *opts, void *opaque)
return 0;
}
+static int parse_add_fd(QemuOpts *opts, void *opaque)
+{
+ int fd, dupfd;
+ int64_t fdset_id;
+ const char *fd_opaque = NULL;
+
+ fd = qemu_opt_get_number(opts, "fd", -1);
+ fdset_id = qemu_opt_get_number(opts, "set", -1);
+ fd_opaque = qemu_opt_get(opts, "opaque");
+
+ if (fd < 0) {
+ qerror_report(ERROR_CLASS_GENERIC_ERROR,
+ "fd option is required and must be non-negative");
+ return -1;
+ }
+
+ if (fd <= STDERR_FILENO) {
+ qerror_report(ERROR_CLASS_GENERIC_ERROR,
+ "fd cannot be a standard I/O stream");
+ return -1;
+ }
+
+ if (fdset_id < 0) {
+ qerror_report(ERROR_CLASS_GENERIC_ERROR,
+ "set option is required and must be non-negative");
+ return -1;
+ }
+
+#ifdef F_DUPFD_CLOEXEC
+ dupfd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
+#else
+ dupfd = dup(fd);
+ if (dupfd != -1) {
+ qemu_set_cloexec(dupfd);
+ }
+#endif
+ if (dupfd == -1) {
+ qerror_report(ERROR_CLASS_GENERIC_ERROR,
+ "Error duplicating fd: %s", strerror(errno));
+ return -1;
+ }
+
+ /* add the duplicate fd, and optionally the opaque string, to the fd set */
+ monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : false,
+ fd_opaque, NULL);
+
+ return 0;
+}
+
+static int cleanup_add_fd(QemuOpts *opts, void *opaque)
+{
+ int fd;
+
+ fd = qemu_opt_get_number(opts, "fd", -1);
+ close(fd);
+
+ return 0;
+}
+
/***********************************************************/
/* QEMU Block devices */
@@ -3309,6 +3368,11 @@ int main(int argc, char **argv, char **envp)
exit(0);
}
break;
+ case QEMU_OPTION_add_fd:
+ opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0);
+ if (!opts) {
+ exit(0);
+ }
default:
os_parse_cmd_args(popt->index, optarg);
}
@@ -3320,6 +3384,14 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
+ if (qemu_opts_foreach(qemu_find_opts("add-fd"), parse_add_fd, NULL, 1)) {
+ exit(1);
+ }
+
+ if (qemu_opts_foreach(qemu_find_opts("add-fd"), cleanup_add_fd, NULL, 1)) {
+ exit(1);
+ }
+
if (machine == NULL) {
fprintf(stderr, "No machine found.\n");
exit(1);
--
1.7.11.4
12 years, 1 month