[libvirt] [PATCH 1/2] qemu: add -incoming fd:n capability checking
by Eric Blake
* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
New enum value.
* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
flags according to qemu version.
* tests/qemuhelptest.c (mymain): Adjust test.
---
I feel a bit dirty relying on just a version test for whether
-incoming fd:n is supported, but it's no different than the
existing code for -incoming unix:path which was added about the
same time. Unfortunately, 'qemu -help' doesn't list which
particular protocols it supports for -incoming.
src/qemu/qemu_capabilities.c | 6 +++++-
src/qemu/qemu_capabilities.h | 1 +
tests/qemuhelptest.c | 12 ++++++++----
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 913fbf7..3d10b42 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -943,6 +943,8 @@ qemuCapsComputeCmdFlags(const char *help,
* Handling of -incoming arg with varying features
* -incoming tcp (kvm >= 79, qemu >= 0.10.0)
* -incoming exec (kvm >= 80, qemu >= 0.10.0)
+ * -incoming unix (qemu >= 0.12.0)
+ * -incoming fd (qemu >= 0.12.0)
* -incoming stdio (all earlier kvm)
*
* NB, there was a pre-kvm-79 'tcp' support, but it
@@ -952,8 +954,10 @@ qemuCapsComputeCmdFlags(const char *help,
if (version >= 10000) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC;
- if (version >= 12000)
+ if (version >= 12000) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_UNIX;
+ flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_FD;
+ }
} else if (kvm_version >= 79) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
if (kvm_version >= 80)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 83afd9b..ee648f0 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -82,6 +82,7 @@ enum qemuCapsFlags {
QEMUD_CMD_FLAG_VGA_QXL = (1LL << 45), /* The 'qxl' arg for '-vga' */
QEMUD_CMD_FLAG_SPICE = (1LL << 46), /* Is -spice avail */
QEMUD_CMD_FLAG_VGA_NONE = (1LL << 47), /* The 'none' arg for '-vga' */
+ QEMUD_CMD_FLAG_MIGRATE_QEMU_FD = (1LL << 48), /* -incoming fd:n */
};
virCapsPtr qemuCapsInit(virCapsPtr old_caps);
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 553abbc..18a71fa 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -286,7 +286,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_BOOT_MENU |
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
- QEMUD_CMD_FLAG_VGA_NONE,
+ QEMUD_CMD_FLAG_VGA_NONE |
+ QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12001, 0, 0);
DO_TEST("qemu-kvm-0.12.1.2-rhel60",
QEMUD_CMD_FLAG_VNC_COLON |
@@ -324,7 +325,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_VGA_QXL |
QEMUD_CMD_FLAG_SPICE |
- QEMUD_CMD_FLAG_VGA_NONE,
+ QEMUD_CMD_FLAG_VGA_NONE |
+ QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12001, 1, 0);
DO_TEST("qemu-kvm-0.12.3",
QEMUD_CMD_FLAG_VNC_COLON |
@@ -360,7 +362,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_NESTING |
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
- QEMUD_CMD_FLAG_VGA_NONE,
+ QEMUD_CMD_FLAG_VGA_NONE |
+ QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12003, 1, 0);
DO_TEST("qemu-kvm-0.13.0",
QEMUD_CMD_FLAG_VNC_COLON |
@@ -403,7 +406,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_SPICE |
- QEMUD_CMD_FLAG_VGA_NONE,
+ QEMUD_CMD_FLAG_VGA_NONE |
+ QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
13000, 1, 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
--
1.7.3.3
13 years, 9 months
[libvirt] there is a mistake in "libvirt development guide, chapter 4.1: list domains"
by SanitYey o
int i;
int numDomains;
char **inactiveDomains;
numDomains = virConnectNumOfDefinedDomains(conn);
inactiveDomains = malloc(sizeof(char *) * numDomains);
numDomains = virConnectListDomains(conn, inactiveDomains, numDomains);
printf("Inactive domain names:\n");
for (i = 0 ; i < numDomains ; i++) {
printf(" %s\n", inactiveDomains[i]);
free(inactiveDomains[i]);
}
free(inactiveDomains);
Example 4.5. Listing inactive domains
There should use "virConnectListDefinedDomains" for inactive domains.
13 years, 9 months
[libvirt] [PATCH V3] Add libxenlight driver
by Jim Fehlig
Hi All,
Another update to the libxenlight driver for Xen 4.1. The primary
change in this version is reservation of vnc ports within the driver
when autoport=yes. libxenlight does not provide a mechanism to retrieve
the auto-selected port and the 'vncunused' option is not in upstream
qemu anyhow, so best to avoid it.
I've tested the following operations on both pv and hvm linux guests:
define, undefine, start, create, shutdown, reboot, destroy, getinfo, and
dumpxml. I've also done some minimal testing with virt-manager, e.g.
starting a previously defined domain and connecting to its graphical
console.
Thanks for your review and comments.
Regards,
Jim
13 years, 9 months