[libvirt] OSX Homebrew support note ;)
by Justin Clift
Hi all,
Compiling Libvirt directly from latest git master head is now supported
on
OSX Homebrew. It's as simple as:
$ brew install --HEAD libvirt
...
$ virsh -v
3.0.0
This should make development of Libvirt and related virtualisation
things
much easier on OSX. :)
The credit for this goes to Roman Bogorodskiy and Homebrew developer
"ilovezfs" (CC-d), for adding a functional rpcgen to Homebrew so we can
generate the needed RPC bindings during the build (previously missing).
Thanks heaps! :)
Regards and best wishes,
Justin Clift
7 years, 8 months
[libvirt] [PATCH] libxl: fix dom0 autoballooning with Xen 4.8
by Jim Fehlig
xen.git commit 57f8b13c changed several of the libxl memory
get/set functions to take 64 bit parameters. The libvirt
libxl driver still uses uint32_t variables for these various
parameters, which is particularly problematic for the
libxl_set_memory_target() function.
When dom0 autoballooning is enabled, libvirt (like xl) determines
the memory needed to start a domain and the memory available. If
memory available is less than memory needed, dom0 is ballooned
down by passing a negative value to libxl_set_memory_target()
'target_memkb' parameter. Prior to xen.git commit 57f8b13c,
'target_memkb' was an int32_t. Subtracting a larger uint32 from
a smaller uint32 and assigning it to int32 resulted in a negative
number. After commit 57f8b13c, the same subtraction is widened
to a int64, resulting in a large positive number. The simple
fix taken by this patch is to assign the difference of the
uint32 values to a temporary int32 variable, which is then
passed to 'target_memkb' parameter of libxl_set_memory_target().
Note that it is undesirable to change libvirt to use 64 bit
variables since it requires setting LIBXL_API_VERSION to 0x040800.
Currently libvirt supports LIBXL_API_VERSION >= 0x040400,
essentially Xen >= 4.4.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_domain.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index a5314b0..ed73cd2 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -909,6 +909,7 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config)
{
uint32_t needed_mem;
uint32_t free_mem;
+ int32_t target_mem;
int tries = 3;
int wait_secs = 10;
@@ -922,7 +923,8 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config)
if (free_mem >= needed_mem)
return 0;
- if (libxl_set_memory_target(ctx, 0, free_mem - needed_mem,
+ target_mem = free_mem - needed_mem;
+ if (libxl_set_memory_target(ctx, 0, target_mem,
/* relative */ 1, 0) < 0)
goto error;
--
2.9.2
7 years, 9 months
[libvirt] [PATCH] qemu: enforce maximum ports value for nec-xhci
by Ján Tomko
This controller only allows up to 15 ports.
https://bugzilla.redhat.com/show_bug.cgi?id=1375417
---
src/qemu/qemu_domain.c | 8 ++++++++
.../qemuxml2argv-usb-controller-xhci-limit.xml | 16 ++++++++++++++++
tests/qemuxml2argvtest.c | 3 +++
3 files changed, 27 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci-limit.xml
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c6ce090..61489e0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3147,6 +3147,14 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER) {
virDomainControllerDefPtr cont = dev->data.controller;
+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI &&
+ cont->opts.usbopts.ports > 15) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("nec-xhci controller only supports up to 15 ports"));
+ goto cleanup;
+ }
+
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS &&
!qemuDomainMachineIsI440FX(def)) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci-limit.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci-limit.xml
new file mode 100644
index 0000000..5ff2de7
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-xhci-limit.xml
@@ -0,0 +1,16 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <controller type='usb' index='0' model='nec-xhci' ports='16'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3532cb5..78cb609 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1415,6 +1415,9 @@ mymain(void)
QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI,
QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS,
QEMU_CAPS_USB_HUB);
+ DO_TEST_PARSE_ERROR("usb-controller-xhci-limit",
+ QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI,
+ QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS);
DO_TEST("smbios", QEMU_CAPS_SMBIOS_TYPE);
DO_TEST_PARSE_ERROR("smbios-date", QEMU_CAPS_SMBIOS_TYPE);
--
2.10.2
7 years, 9 months
[libvirt] [PATCH v3] Add support for Veritas HyperScale (VxHS) block device protocol
by Ashish Mittal
Sample XML for a vxhs vdisk is as follows:
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251'>
<host name='192.168.0.1' port='9999'/>
</source>
<backingStore/>
<target dev='vda' bus='virtio'/>
<serial>eb90327c-8302-4725-9e1b-4e85ed4dc251</serial>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
</disk>
Signed-off-by: Ashish Mittal <Ashish.Mittal(a)veritas.com>
---
v2 changelog:
(1) Added code for JSON parsing of a VxHS vdisk.
(2) Added test case to verify JSON parsing.
(3) Added missing switch-case checks for VIR_STORAGE_NET_PROTOCOL_VXHS.
(4) Fixed line wrap in qemuxml2argv-disk-drive-network-vxhs.args.
v3 changelog:
(1) Implemented the modern syntax for VxHS disk specification.
(2) Changed qemuxml2argvdata VxHS test case to verify the new syntax.
(3) Added a negative test case to check failure when multiple hosts
are specified for a VxHS disk.
docs/formatdomain.html.in | 15 ++++-
docs/schemas/domaincommon.rng | 1 +
src/libxl/libxl_conf.c | 1 +
src/qemu/qemu_command.c | 68 ++++++++++++++++++++++
src/qemu/qemu_driver.c | 3 +
src/qemu/qemu_parse_command.c | 26 +++++++++
src/util/virstoragefile.c | 63 +++++++++++++++++++-
src/util/virstoragefile.h | 1 +
src/xenconfig/xen_xl.c | 1 +
...xml2argv-disk-drive-network-vxhs-multi-host.xml | 35 +++++++++++
.../qemuxml2argv-disk-drive-network-vxhs.args | 25 ++++++++
.../qemuxml2argv-disk-drive-network-vxhs.xml | 34 +++++++++++
tests/qemuxml2argvtest.c | 2 +
tests/virstoragetest.c | 16 +++++
14 files changed, 287 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs-multi-host.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index f7bef51..2a071c9 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2319,9 +2319,9 @@
<dd>
The <code>protocol</code> attribute specifies the protocol to
access to the requested image. Possible values are "nbd",
- "iscsi", "rbd", "sheepdog" or "gluster". If the
- <code>protocol</code> attribute is "rbd", "sheepdog" or
- "gluster", an additional attribute <code>name</code> is
+ "iscsi", "rbd", "sheepdog", "gluster" or "vxhs". If the
+ <code>protocol</code> attribute is "rbd", "sheepdog", "gluster"
+ or "vxhs", an additional attribute <code>name</code> is
mandatory to specify which volume/image will be used. For "nbd",
the <code>name</code> attribute is optional. For "iscsi"
(<span class="since">since 1.0.4</span>), the <code>name</code>
@@ -2329,6 +2329,9 @@
target's name by a slash (e.g.,
<code>iqn.2013-07.com.example:iscsi-pool/1</code>). If not
specified, the default LUN is zero.
+ For "vxhs" (<span class="since">since 2.5.0</span>), the
+ <code>name</code> is the UUID of the volume, assigned by the
+ HyperScale sever.
<span class="since">Since 0.8.7</span>
</dd>
<dt><code>volume</code></dt>
@@ -2431,6 +2434,12 @@
<td> one or more (<span class="since">Since 2.1.0</span>), just one prior to that </td>
<td> 24007 </td>
</tr>
+ <tr>
+ <td> vxhs </td>
+ <td> a server running Veritas HyperScale daemon </td>
+ <td> only one </td>
+ <td> 9999 </td>
+ </tr>
</table>
<p>
gluster supports "tcp", "rdma", "unix" as valid values for the
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4d76315..cdc39ca 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1470,6 +1470,7 @@
<value>ftp</value>
<value>ftps</value>
<value>tftp</value>
+ <value>vxhs</value>
</choice>
</attribute>
<optional>
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index b569dda..7e12d32 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -604,6 +604,7 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src,
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_LAST:
case VIR_STORAGE_NET_PROTOCOL_NONE:
virReportError(VIR_ERR_NO_SUPPORT,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f8e48d2..08bad8e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -491,6 +491,9 @@ qemuNetworkDriveGetPort(int protocol,
/* no default port specified */
return 0;
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
+ return 9999;
+
case VIR_STORAGE_NET_PROTOCOL_RBD:
case VIR_STORAGE_NET_PROTOCOL_LAST:
case VIR_STORAGE_NET_PROTOCOL_NONE:
@@ -899,6 +902,65 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src)
}
+#define QEMU_DEFAULT_VXHS_PORT "9999"
+
+/* Build the VxHS host object */
+static virJSONValuePtr
+qemuBuildVxHSDriveJSONHost(virStorageSourcePtr src)
+{
+ virJSONValuePtr server = NULL;
+ virStorageNetHostDefPtr host;
+ const char *portstr;
+
+ if (src->nhosts != 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("VxHS supports only one server"));
+ goto cleanup;
+ }
+
+ host = src->hosts;
+ portstr = host->port;
+
+ if (!portstr)
+ portstr = QEMU_DEFAULT_VXHS_PORT;
+
+ if (virJSONValueObjectCreate(&server,
+ "s:host", host->name,
+ "s:port", portstr,
+ NULL) < 0)
+ server = NULL;
+
+ cleanup:
+ return server;
+}
+
+
+static virJSONValuePtr
+qemuBuildVxHSDriveJSON(virStorageSourcePtr src)
+{
+ const char *protocol = virStorageNetProtocolTypeToString(src->protocol);
+ virJSONValuePtr server = NULL;
+ virJSONValuePtr ret = NULL;
+
+ if (!(server = qemuBuildVxHSDriveJSONHost(src)))
+ return NULL;
+
+ /* VxHS disk sepecification example:
+ * { driver:"vxhs",
+ * vdisk-id:"eb90327c-8302-4725-4e85ed4dc251",
+ * server.host:"1.2.3.4",
+ * server.port:1234}
+ */
+ if (virJSONValueObjectCreate(&ret,
+ "s:driver", protocol,
+ "s:vdisk-id", src->path,
+ "a:server", server, NULL) < 0)
+ virJSONValueFree(server);
+
+ return ret;
+}
+
+
static char *
qemuBuildNetworkDriveURI(virStorageSourcePtr src,
qemuDomainSecretInfoPtr secinfo)
@@ -1034,6 +1096,7 @@ qemuBuildNetworkDriveStr(virStorageSourcePtr src,
case VIR_STORAGE_NET_PROTOCOL_TFTP:
case VIR_STORAGE_NET_PROTOCOL_ISCSI:
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
ret = qemuBuildNetworkDriveURI(src, secinfo);
break;
@@ -1148,6 +1211,11 @@ qemuGetDriveSourceProps(virStorageSourcePtr src,
if (!(fileprops = qemuBuildGlusterDriveJSON(src)))
return -1;
}
+
+ if (src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS) {
+ if (!(fileprops = qemuBuildVxHSDriveJSON(src)))
+ return -1;
+ }
break;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b359e77..c76e9d4 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13788,6 +13788,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
case VIR_STORAGE_NET_PROTOCOL_FTPS:
case VIR_STORAGE_NET_PROTOCOL_TFTP:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("external inactive snapshots are not supported on "
@@ -13851,6 +13852,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
case VIR_STORAGE_NET_PROTOCOL_FTPS:
case VIR_STORAGE_NET_PROTOCOL_TFTP:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("external active snapshots are not supported on "
@@ -13996,6 +13998,7 @@ qemuDomainSnapshotPrepareDiskInternal(virConnectPtr conn,
case VIR_STORAGE_NET_PROTOCOL_FTPS:
case VIR_STORAGE_NET_PROTOCOL_TFTP:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("internal inactive snapshots are not supported on "
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 405e655..aab287a 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -263,6 +263,17 @@ qemuParseNBDString(virDomainDiskDefPtr disk)
return -1;
}
+static int
+qemuParseVxHSString(virDomainDiskDefPtr def)
+{
+ virURIPtr uri = NULL;
+
+ if (!(uri = virURIParse(def->src->path)))
+ return -1;
+
+ return qemuParseDriveURIString(def, uri, "vxhs");
+}
+
/*
* This method takes a string representing a QEMU command line ARGV set
@@ -737,6 +748,12 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
if (VIR_STRDUP(def->src->path, vdi) < 0)
goto error;
}
+ } else if (STRPREFIX(def->src->path, "vxhs:")) {
+ def->src->type = VIR_STORAGE_TYPE_NETWORK;
+ def->src->protocol = VIR_STORAGE_NET_PROTOCOL_VXHS;
+
+ if (qemuParseVxHSString(def) < 0)
+ goto error;
} else {
def->src->type = VIR_STORAGE_TYPE_FILE;
}
@@ -1947,6 +1964,10 @@ qemuParseCommandLine(virCapsPtr caps,
disk->src->type = VIR_STORAGE_TYPE_NETWORK;
disk->src->protocol = VIR_STORAGE_NET_PROTOCOL_SHEEPDOG;
val += strlen("sheepdog:");
+ } else if (STRPREFIX(val, "vxhs:")) {
+ disk->src->type = VIR_STORAGE_TYPE_NETWORK;
+ disk->src->protocol = VIR_STORAGE_NET_PROTOCOL_VXHS;
+ val += strlen("vxhs:");
} else {
disk->src->type = VIR_STORAGE_TYPE_FILE;
}
@@ -2023,6 +2044,11 @@ qemuParseCommandLine(virCapsPtr caps,
goto error;
break;
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
+ if (qemuParseVxHSString(disk) < 0)
+ goto error;
+
+ break;
case VIR_STORAGE_NET_PROTOCOL_HTTP:
case VIR_STORAGE_NET_PROTOCOL_HTTPS:
case VIR_STORAGE_NET_PROTOCOL_FTP:
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index ce6d213..e62f4e6 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -85,7 +85,8 @@ VIR_ENUM_IMPL(virStorageNetProtocol, VIR_STORAGE_NET_PROTOCOL_LAST,
"ftp",
"ftps",
"tftp",
- "ssh")
+ "ssh",
+ "vxhs")
VIR_ENUM_IMPL(virStorageNetHostTransport, VIR_STORAGE_NET_HOST_TRANS_LAST,
"tcp",
@@ -2633,6 +2634,7 @@ virStorageSourceParseBackingColon(virStorageSourcePtr src,
case VIR_STORAGE_NET_PROTOCOL_ISCSI:
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("malformed backing store path for protocol %s"),
protocol);
@@ -2964,6 +2966,64 @@ virStorageSourceParseBackingJSONRBD(virStorageSourcePtr src,
}
+static int
+virStorageSourceParseBackingJSONVXHS(virStorageSourcePtr src,
+ virJSONValuePtr json,
+ int opaque ATTRIBUTE_UNUSED)
+{
+ virJSONValuePtr server;
+ const char *hostname, *port;
+ const char *uri = virJSONValueObjectGetString(json, "filename");
+ const char *vdisk_id = virJSONValueObjectGetString(json, "vdisk-id");
+
+ src->type = VIR_STORAGE_TYPE_NETWORK;
+ src->protocol = VIR_STORAGE_NET_PROTOCOL_VXHS;
+
+ /* legacy URI based syntax passed via 'filename' option */
+ if (uri)
+ return virStorageSourceParseBackingJSONUriStr(src, uri,
+ VIR_STORAGE_NET_PROTOCOL_VXHS);
+
+ server = virJSONValueObjectGetObject(json, "server");
+ hostname = virJSONValueObjectGetString(server, "host");
+ port = virJSONValueObjectGetString(server, "port");
+
+ if (!vdisk_id) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("missing 'vdisk-id' attribute in "
+ "JSON backing definition for VxHS volume"));
+ return -1;
+ }
+ if (!server) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("missing 'server' attribute in "
+ "JSON backing definition for VxHS volume"));
+ return -1;
+ }
+ if (!hostname) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("missing hostname for tcp backing server in "
+ "JSON backing definition for VxHS volume"));
+ return -1;
+ }
+
+
+ if (VIR_STRDUP(src->path, vdisk_id) < 0)
+ return -1;
+
+ if (VIR_ALLOC_N(src->hosts, 1) < 0)
+ return -1;
+ src->nhosts = 1;
+
+ src->hosts[0].transport = VIR_STORAGE_NET_HOST_TRANS_TCP;
+
+ if (VIR_STRDUP(src->hosts[0].name, hostname) < 0 ||
+ VIR_STRDUP(src->hosts[0].port, port) < 0)
+ return -1;
+
+ return 0;
+}
+
struct virStorageSourceJSONDriverParser {
const char *drvname;
int (*func)(virStorageSourcePtr src, virJSONValuePtr json, int opaque);
@@ -2985,6 +3045,7 @@ static const struct virStorageSourceJSONDriverParser jsonParsers[] = {
{"sheepdog", virStorageSourceParseBackingJSONSheepdog, 0},
{"ssh", virStorageSourceParseBackingJSONSSH, 0},
{"rbd", virStorageSourceParseBackingJSONRBD, 0},
+ {"vxhs", virStorageSourceParseBackingJSONVXHS, 0},
};
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 1f62244..e60b6e9 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -134,6 +134,7 @@ typedef enum {
VIR_STORAGE_NET_PROTOCOL_FTPS,
VIR_STORAGE_NET_PROTOCOL_TFTP,
VIR_STORAGE_NET_PROTOCOL_SSH,
+ VIR_STORAGE_NET_PROTOCOL_VXHS,
VIR_STORAGE_NET_PROTOCOL_LAST
} virStorageNetProtocol;
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index 18d9fe3..9fe24d6 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -942,6 +942,7 @@ xenFormatXLDiskSrcNet(virStorageSourcePtr src)
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_LAST:
case VIR_STORAGE_NET_PROTOCOL_NONE:
virReportError(VIR_ERR_NO_SUPPORT,
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs-multi-host.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs-multi-host.xml
new file mode 100644
index 0000000..660bcde
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs-multi-host.xml
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</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/libexec/qemu-kvm</emulator>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251'>
+ <host name='192.168.0.1' port='9999'/>
+ <host name='192.168.0.2' port='9999'/>
+ </source>
+ <backingStore/>
+ <target dev='vda' bus='virtio'/>
+ <serial>eb90327c-8302-4725-9e1b-4e85ed4dc251</serial>
+ <alias name='virtio-disk0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.args
new file mode 100644
index 0000000..23045e1
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/libexec/qemu-kvm \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-cpu qemu32 \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
+file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
+id=drive-virtio-disk0,cache=none \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.xml
new file mode 100644
index 0000000..45c807f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-vxhs.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</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/libexec/qemu-kvm</emulator>
+ <disk type='network' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251'>
+ <host name='192.168.0.1' port='9999'/>
+ </source>
+ <backingStore/>
+ <target dev='vda' bus='virtio'/>
+ <serial>eb90327c-8302-4725-9e1b-4e85ed4dc251</serial>
+ <alias name='virtio-disk0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ab3ad08..f751ec9 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -892,6 +892,8 @@ mymain(void)
# endif
DO_TEST("disk-drive-network-rbd-ipv6", NONE);
DO_TEST_FAILURE("disk-drive-network-rbd-no-colon", NONE);
+ DO_TEST("disk-drive-network-vxhs", NONE);
+ DO_TEST_FAILURE("disk-drive-network-vxhs-multi-host", NONE);
DO_TEST("disk-drive-no-boot",
QEMU_CAPS_BOOTINDEX);
DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid",
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index f766df1..a28fbd9 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1492,6 +1492,22 @@ mymain(void)
"<source protocol='rbd' name='testshare'>\n"
" <host name='example.com'/>\n"
"</source>\n");
+ TEST_BACKING_PARSE("json:{\"file.driver\":\"vxhs\","
+ "\"file.filename\":\"vxhs://192.168.0.1:9999/c6718f6b-0401-441d-a8c3-1f0064d75ee0\""
+ "}",
+ "<source protocol='vxhs' name='c6718f6b-0401-441d-a8c3-1f0064d75ee0'>\n"
+ " <host name='192.168.0.1' port='9999'/>\n"
+ "</source>\n");
+ TEST_BACKING_PARSE("json:{\"file\":{\"driver\":\"vxhs\","
+ "\"vdisk-id\":\"c6718f6b-0401-441d-a8c3-1f0064d75ee0\","
+ "\"server\": { \"host\":\"example.com\","
+ "\"port\":\"1234\""
+ "}"
+ "}"
+ "}",
+ "<source protocol='vxhs' name='c6718f6b-0401-441d-a8c3-1f0064d75ee0'>\n"
+ " <host name='example.com' port='1234'/>\n"
+ "</source>\n");
cleanup:
/* Final cleanup */
--
2.5.5
7 years, 9 months
[libvirt] [PATCH] qemu: Fix indentation in qemu_interface.h
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/qemu/qemu_interface.h | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h
index 66ead2a..a7faa0b 100644
--- a/src/qemu/qemu_interface.h
+++ b/src/qemu/qemu_interface.h
@@ -35,16 +35,17 @@ int qemuInterfaceStopDevice(virDomainNetDefPtr net);
int qemuInterfaceStopDevices(virDomainDefPtr def);
int qemuInterfaceDirectConnect(virDomainDefPtr def,
- virQEMUDriverPtr driver,
- virDomainNetDefPtr net,
- int *tapfd,
- size_t tapfdSize,
- virNetDevVPortProfileOp vmop);
-int qemuInterfaceEthernetConnect(virDomainDefPtr def,
virQEMUDriverPtr driver,
virDomainNetDefPtr net,
int *tapfd,
- size_t tapfdSize);
+ size_t tapfdSize,
+ virNetDevVPortProfileOp vmop);
+
+int qemuInterfaceEthernetConnect(virDomainDefPtr def,
+ virQEMUDriverPtr driver,
+ virDomainNetDefPtr net,
+ int *tapfd,
+ size_t tapfdSize);
int qemuInterfaceBridgeConnect(virDomainDefPtr def,
virQEMUDriverPtr driver,
--
2.1.0
7 years, 9 months
[libvirt] char: Logging serial pty output when disconnected
by Ed Swierk
Interactive access to a guest serial console can be enabled by hooking
the serial device to a pty backend, e.g. -device
isa-serial,chardev=cs0 -chardev pty,id=cs0. With libvirt this can be
configured via <console type='pty'><target type='serial'
port='0'/></console>.
Output from the same serial device can also be logged to a file by
adding logfile=/somefile to the -chardev option (<log file=/somefile/>
in libvirt).
Unfortunately output gets logged only when a client like virsh console
is connected to the pty; otherwise qemu drops it on the floor. This
makes chardev logging much less useful than it could be for debugging
guest problems after the fact.
Currently qemu_chr_fe_write() calls qemu_chr_fe_write_log() only for
data consumed by the backend chr_write function. With the pty backend,
pty_chr_write() returns 0 indicating that the data was not consumed
when the pty is disconnected. Simply changing it to return len instead
of 0 tricks the caller into logging the data even when the pty is
disconnected. I don't know what problems this might cause, but one
data point is that tcp_chr_write() already happens to work this way.
Alternatively, qemu_chr_fe_write() could be modified to log everything
passed to it, regardless of how much data chr_write claims to have
consumed. The trouble is that the serial device retries writing
unconsumed data, so when the pty is disconnected you'd see every
character duplicated 4 times in the log file.
Any opinions on either approach, or other suggestions? If there are no
objections to the first one, I'll prepare a patch.
--Ed
7 years, 9 months
[libvirt] CfP 12th Virtualization in High-Performance Cloud Computing Workshop (VHPC '17)
by VHPC 17
====================================================================
CALL FOR PAPERS
12th Workshop on Virtualization in High-Performance Cloud Computing (VHPC
'17)
held in conjunction with the International Supercomputing Conference - High
Performance,
June 18-22, 2017, Frankfurt, Germany.
(Springer LNCS Proceedings)
====================================================================
Date: June 22, 2017
Workshop URL: http://vhpc.org
Abstract Submission Deadline: February 28, 2017
Paper Submission Deadline: April 25, 2017 (Springer LNCS)
Abstract/Paper Submission Link: https://edas.info/newPaper.php?c=23179
Call for Papers
Virtualization technologies constitute a key enabling factor for flexible
resource management
in modern data centers, and particularly in cloud environments. Cloud
providers need to
manage complex infrastructures in a seamless fashion to support the highly
dynamic and
heterogeneous workloads and hosted applications customers deploy.
Similarly, HPC
environments have been increasingly adopting techniques that enable
flexible management of
vast computing and networking resources, close to marginal provisioning
cost, which is
unprecedented in the history of scientific and commercial computing.
Various virtualization technologies contribute to the overall picture in
different ways: machine
virtualization, with its capability to enable consolidation of multiple
underutilized servers with
heterogeneous software and operating systems (OSes), and its capability to
live-migrate a
fully operating virtual machine (VM) with a very short downtime, enables
novel and dynamic
ways to manage physical servers; OS-level virtualization (i.e.,
containerization), with its
capability to isolate multiple user-space environments and to allow for
their coexistence within
the same OS kernel, promises to provide many of the advantages of machine
virtualization
with high levels of responsiveness and performance; I/O Virtualization
allows physical
NICs/HBAs to take traffic from multiple VMs or containers; network
virtualization, with its
capability to create logical network overlays that are independent of the
underlying physical
topology and IP addressing, provides the fundamental ground on top of which
evolved
network services can be realized with an unprecedented level of dynamicity
and flexibility; the
increasingly adopted paradigm of Software-Defined Networking (SDN)
promises to extend
this flexibility to the control and data planes of network paths.
Publication
Accepted papers will be published in a Springer LNCS proceedings volume.
Topics of Interest
The VHPC program committee solicits original, high-quality submissions
related to
virtualization across the entire software stack with a special focus on the
intersection of HPC
and the cloud.
Major Topics
- Virtualization in supercomputing environments, HPC clusters, HPC in the
cloud and grids
- OS-level virtualization and containers (Docker, rkt, Singularity,
Shifter, i.a.)
- Lightweight/specialized operating systems, unikernels
- Optimizations of virtual machine monitor platforms and hypervisors
- Hypervisor support for heterogenous resources (GPUs, co-processors,
FPGAs, etc.)
- Virtualization support for emerging memory technologies
- Virtualization in enterprise HPC and microvisors
- Software defined networks and network virtualization
- Management, deployment of virtualized environments and orchestration
(Kubernetes i.a.),
- Workflow-pipeline container-based composability
- Performance measurement, modelling and monitoring of virtualized/cloud
workloads
- Virtualization in data intensive computing and Big Data processing - HPC
convergence
- Adaptation of HPC technologies in the cloud (high performance networks,
RDMA, etc.)
- ARM-based hypervisors, ARM virtualization extensions
- I/O virtualization and cloud based storage systems
- GPU, FPGA and many-core accelerator virtualization
- Job scheduling/control/policy and container placement in virtualized
environments
- Cloud reliability, fault-tolerance and high-availability
- QoS and SLA in virtualized environments
- IaaS platforms, cloud frameworks and APIs
- Large-scale virtualization in domains such as finance and government
- Energy-efficient and power-aware virtualization
- Container security
- Configuration management tools for containers (including CFEngine,
Puppet, i.a.)
- Emerging topics including multi-kernel approaches and,NUMA in hypervisors
The Workshop on Virtualization in High-Performance Cloud Computing (VHPC)
aims to
bring together researchers and industrial practitioners facing the
challenges
posed by virtualization in order to foster discussion, collaboration,
mutual exchange
of knowledge and experience, enabling research to ultimately provide novel
solutions for virtualized computing systems of tomorrow.
The workshop will be one day in length, composed of 20 min paper
presentations, each
followed by 10 min discussion sections, plus lightning talks that are
limited to 5 minutes.
Presentations may be accompanied by interactive demonstrations.
Important Dates
February 28, 2017 - Abstract Submission Deadline
April 25, 2017 - Paper submission deadline
May 30, 2017 - Acceptance notification
June 22, 2017 - Workshop Day
June 25, 2017 - Camera-ready version due
Chair
Michael Alexander (chair), scaledinfra technologies, Austria
Anastassios Nanos (co-chair), NTUA, Greece
Balazs Gerofi (co-chair), RIKEN Advanced Institute for Computational
Science, Japan
Program committee
Stergios Anastasiadis, University of Ioannina, Greece
Jakob Blomer, CERN, Europe
Ron Brightwell, Sandia National Laboratories, USA
Eduardo César, Universidad Autonoma de Barcelona, Spain
Julian Chesterfield, OnApp, UK
Stephen Crago, USC ISI, USA
Christoffer Dall, Columbia University, USA
Patrick Dreher, MIT, USA
Robert Futrick, Cycle Computing, USA
Maria Girone, CERN, Europe
Kyle Hale, Northwestern University, USA
Romeo Kinzler, IBM, Switzerland
Brian Kocoloski, University of Pittsburgh, USA
Nectarios Koziris, National Technical University of Athens, Greece
John Lange, University of Pittsburgh, USA
Che-Rung Lee, National Tsing Hua University, Taiwan
Giuseppe Lettieri, University of Pisa, Italy
Qing Liu, Oak Ridge National Laboratory, USA
Nikos Parlavantzas, IRISA, France
Kevin Pedretti, Sandia National Laboratories, USA
Amer Qouneh, University of Florida, USA
Carlos Reaño, Technical University of Valencia, Spain
Thomas Ryd, CFEngine, Norway
Josh Simons, VMWare, USA
Borja Sotomayor, University of Chicago, USA
Craig Stewart, Indiana University, USA
Anata Tiwari, San Diego Supercomputer Center, USA
Kurt Tutschku, Blekinge Institute of Technology, Sweden
Yasuhiro Watashiba, Osaka University, Japan
Nicholas Wright, Lawrence Berkeley National Laboratory, USA
Chao-Tung Yang, Tunghai University, Taiwan
Paper Submission-Publication
Papers submitted to the workshop will be reviewed by at least two
members of the program committee and external reviewers. Submissions
should include abstract, key words, the e-mail address of the
corresponding author, and must not exceed 10 pages, including tables
and figures at a main font size no smaller than 11 point. Submission
of a paper should be regarded as a commitment that, should the paper
be accepted, at least one of the authors will register and attend the
conference to present the work. Accepted papers will be published in a
Springer LNCS volume. .
The format must be according to the Springer LNCS Style. Initial
submissions are in PDF; authors of accepted papers will be requested
to provide source files.
Format Guidelines:
ftp://ftp.springer.de/pub/tex/latex/llncs/latex2e/llncs2e.zip
Abstract, Paper Submission Link:
https://edas.info/newPaper.php?c=23179
Lightning Talks
Lightning Talks are non-paper track, synoptical in nature and are strictly
limited to 5 minutes.
They can be used to gain early feedback on ongoing research, for
demonstrations, to present
research results, early research ideas, perspectives and positions of
interest to the community.
Submit abstract via the main submission link.
General Information
The workshop is one day in length and will be held in conjunction with the
International
Supercomputing Conference - High Performance (ISC) 2017, June 18-22,
Frankfurt,
Germany.
7 years, 9 months
[libvirt] [PATCH] util: Fix domain object leaks on closecallbacks
by John Ferlan
Originally/discovered proposed by "Wang King <king.wang(a)huawei.com>"
When the virCloseCallbacksSet is first called, it increments the refcnt
on the domain object to ensure it doesn't get deleted before the callback
is called. The refcnt would be decremented in virCloseCallbacksUnset once
the entry is removed from the closeCallbacks has table.
When (mostly) normal shutdown occurs, the qemuProcessStop will end up
calling qemuProcessAutoDestroyRemove and will remove the callback from
the list and hash table normally and decrement the refcnt.
However, when qemuConnectClose calls virCloseCallbacksRun, it will scan
the (locked) closeCallbacks list for matching domain and callback function.
If an entry is found, it will be removed from the closeCallbacks list and
placed into a lookaside list to be processed when the closeCallbacks lock
is dropped. The callback function (e.g. qemuProcessAutoDestroy) is called
and will run qemuProcessStop. That code will fail to find the callback
in the list when qemuProcessAutoDestroyRemove is called and thus not decrement
the domain refcnt. Instead since the entry isn't found the code will just
return (mostly) harmlessly.
This patch will resolve the issue by taking another ref during the
search UUID process during virCloseCallackRun, decrementing the refcnt
taken by virCloseCallbacksSet, calling the callback routine and returning
overwriting the vm (since it could return NULL). Finally, it will call the
virDomainObjEndAPI to lower the refcnt and remove the lock taken during
the search UUID processing. This may cause the vm to be destroyed.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/util/virclosecallbacks.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/util/virclosecallbacks.c b/src/util/virclosecallbacks.c
index 2f430cf..4db50e8 100644
--- a/src/util/virclosecallbacks.c
+++ b/src/util/virclosecallbacks.c
@@ -346,17 +346,24 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
for (i = 0; i < list->nentries; i++) {
virDomainObjPtr vm;
- if (!(vm = virDomainObjListFindByUUID(domains,
- list->entries[i].uuid))) {
+ /* Grab a ref and lock to the vm */
+ if (!(vm = virDomainObjListFindByUUIDRef(domains,
+ list->entries[i].uuid))) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(list->entries[i].uuid, uuidstr);
VIR_DEBUG("No domain object with UUID %s", uuidstr);
continue;
}
- vm = list->entries[i].callback(vm, conn, opaque);
- if (vm)
- virObjectUnlock(vm);
+ /* Remove the ref taken out during virCloseCallbacksSet since
+ * we're about to call the callback function and we have another
+ * ref anyway (so it cannot be deleted).
+ *
+ * Call the callback function, ignoring the return since it might be
+ * NULL. Once we're done with the object, then end the API usage. */
+ virObjectUnref(vm);
+ ignore_value(list->entries[i].callback(vm, conn, opaque));
+ virDomainObjEndAPI(&vm);
}
VIR_FREE(list->entries);
VIR_FREE(list);
--
2.7.4
7 years, 9 months
[libvirt] [PATCH 0/2] qemu: Don't lose group_name
by Martin Kletzander
Don't lose group_name: the movie. I mean, the series.
Martin Kletzander (2):
conf: Add virDomainDiskSetBlockIOTune
qemu: Don't lose group_name
src/conf/domain_conf.c | 27 +++++++++++++++++++++++++++
src/conf/domain_conf.h | 4 ++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 31 +++++++++++++++++++------------
4 files changed, 51 insertions(+), 12 deletions(-)
--
2.11.0
7 years, 9 months
[libvirt] [PATCH 0/5] Yet another qemu namespace fixes
by Michal Privoznik
*** BLURB HERE ***
Michal Privoznik (5):
lxc: Move lxcContainerAvailable to virprocess
lxc_container: Drop userns_supported
util: Introduce virFileMoveMount
qemu: Use namespaces iff available on the host kernel
qemuDomainCreateDevice: Canonicalize paths
src/libvirt_private.syms | 2 ++
src/lxc/lxc_container.c | 54 ++---------------------------
src/lxc/lxc_container.h | 2 --
src/lxc/lxc_driver.c | 7 ++--
src/qemu/qemu_conf.c | 6 +++-
src/qemu/qemu_domain.c | 90 ++++++++++++++++++------------------------------
src/util/virfile.c | 28 +++++++++++++++
src/util/virfile.h | 3 ++
src/util/virprocess.c | 72 ++++++++++++++++++++++++++++++++++++++
src/util/virprocess.h | 10 ++++++
10 files changed, 162 insertions(+), 112 deletions(-)
--
2.11.0
7 years, 9 months