[libvirt] [PATCH]Support virtio-scsi disk XML with tag 'model'
by Chen Hanxiao
From: ChenHanxiao <chenhanxiao(a)cn.fujitsu.com>
If we add a virtio-disk, we need to add a SCSI controller with
model 'virtio-scsi'.
This patch allows libvirt to analyze disks XML with tag 'model':
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sdb'/>
<target dev='sda' bus='scsi' model = 'virtio-scsi'/>
</disk>
If we got a disks XML with bus='scsi' model = 'virtio-scsi',
we'll add a SCSI controller with model 'virtio-scsi' automatically.
Signed-off-by: ChenHanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/conf/domain_conf.c | 29 ++++++++++++++++++++++++-----
src/conf/domain_conf.h | 2 ++
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 99f03a9..0032df4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3528,6 +3528,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
virDomainDiskHostDefPtr hosts = NULL;
int nhosts = 0;
char *bus = NULL;
+ char *model = NULL;
char *cachetag = NULL;
char *error_policy = NULL;
char *rerror_policy = NULL;
@@ -3667,6 +3668,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
target = virXMLPropString(cur, "dev");
bus = virXMLPropString(cur, "bus");
tray = virXMLPropString(cur, "tray");
+ model = virXMLPropString(cur, "model");
/* HACK: Work around for compat with Xen
* driver in previous libvirt releases */
@@ -4015,6 +4017,14 @@ virDomainDiskDefParseXML(virCapsPtr caps,
}
}
+ if (model) {
+ if ((def->model = virDomainControllerModelSCSITypeFromString(model)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown disk bus model type '%s'"), bus);
+ goto error;
+ }
+ }
+
if (tray) {
if ((def->tray_status = virDomainDiskTrayTypeFromString(tray)) < 0) {
virReportError(VIR_ERR_XML_ERROR,
@@ -4221,6 +4231,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
cleanup:
VIR_FREE(bus);
+ VIR_FREE(model);
VIR_FREE(type);
VIR_FREE(snapshot);
VIR_FREE(rawio);
@@ -8499,6 +8510,7 @@ virDomainLookupVcpuPin(virDomainDefPtr def,
static int virDomainDefMaybeAddController(virDomainDefPtr def,
int type,
+ int model,
int idx)
{
int found = 0;
@@ -8521,7 +8533,7 @@ static int virDomainDefMaybeAddController(virDomainDefPtr def,
cont->type = type;
cont->idx = idx;
- cont->model = -1;
+ cont->model = model;
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) {
cont->opts.vioserial.ports = -1;
@@ -9508,7 +9520,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
if (def->virtType == VIR_DOMAIN_VIRT_QEMU ||
def->virtType == VIR_DOMAIN_VIRT_KQEMU ||
def->virtType == VIR_DOMAIN_VIRT_KVM)
- if (virDomainDefMaybeAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_USB, 0) < 0)
+ if (virDomainDefMaybeAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_USB,
+ VIR_DOMAIN_CONTROLLER_MODEL_UNDEF, 0) < 0)
goto error;
/* analysis of the resource leases */
@@ -11390,6 +11403,7 @@ static int virDomainDefAddDiskControllersForType(virDomainDefPtr def,
{
int i;
int maxController = -1;
+ int model = VIR_DOMAIN_CONTROLLER_MODEL_UNDEF;
for (i = 0 ; i < def->ndisks ; i++) {
if (def->disks[i]->bus != diskBus)
@@ -11400,10 +11414,12 @@ static int virDomainDefAddDiskControllersForType(virDomainDefPtr def,
if ((int)def->disks[i]->info.addr.drive.controller > maxController)
maxController = def->disks[i]->info.addr.drive.controller;
+
+ model = def->disks[i]->model;
}
for (i = 0 ; i <= maxController ; i++) {
- if (virDomainDefMaybeAddController(def, controllerType, i) < 0)
+ if (virDomainDefMaybeAddController(def, controllerType, model, i) < 0)
return -1;
}
@@ -11425,7 +11441,8 @@ static int virDomainDefMaybeAddVirtioSerialController(virDomainDefPtr def)
idx = channel->info.addr.vioserial.controller;
if (virDomainDefMaybeAddController(def,
- VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, idx) < 0)
+ VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
+ VIR_DOMAIN_CONTROLLER_MODEL_UNDEF, idx) < 0)
return -1;
}
}
@@ -11440,7 +11457,8 @@ static int virDomainDefMaybeAddVirtioSerialController(virDomainDefPtr def)
idx = console->info.addr.vioserial.controller;
if (virDomainDefMaybeAddController(def,
- VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, idx) < 0)
+ VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
+ VIR_DOMAIN_CONTROLLER_MODEL_UNDEF, idx) < 0)
return -1;
}
}
@@ -11480,6 +11498,7 @@ virDomainDefMaybeAddSmartcardController(virDomainDefPtr def)
if (virDomainDefMaybeAddController(def,
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
+ VIR_DOMAIN_CONTROLLER_MODEL_UNDEF,
idx) < 0)
return -1;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6539281..ba7accf 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -553,6 +553,7 @@ struct _virDomainDiskDef {
int type;
int device;
int bus;
+ int model;
char *src;
char *dst;
int tray_status;
@@ -672,6 +673,7 @@ struct _virDomainControllerDef {
virDomainDeviceInfo info;
};
+#define VIR_DOMAIN_CONTROLLER_MODEL_UNDEF -1
/* Two types of disk backends */
enum virDomainFSType {
--
1.7.1
12 years
[libvirt] [PATCH 0/3] Fix nodeinfo data for strange NUMA machines
by Peter Krempa
This series adds detection of situations when the nodeinfo detection code
doesn't work well to report the data in the fallback format that was
documented.
This patch also adds 2 test data sets taken from the machines that exposed the
strange behavior.
Peter Krempa (3):
nodeinfo: Add check and workaround to guarantee valid cpu topologies
nodeinfotest: Add test data for 2 processor host with broken NUMA
nodeinfotest: Add test data from a AMD bulldozer machine.
src/nodeinfo.c | 37 +-
.../linux-test7/cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu0/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu1/online | 1 +
.../linux-test7/cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu1/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu10/online | 1 +
.../linux-test7/cpu/cpu10/topology/core_id | 1 +
.../cpu/cpu10/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu10/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu11/online | 1 +
.../linux-test7/cpu/cpu11/topology/core_id | 1 +
.../cpu/cpu11/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu11/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu12/online | 1 +
.../linux-test7/cpu/cpu12/topology/core_id | 1 +
.../cpu/cpu12/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu12/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu13/online | 1 +
.../linux-test7/cpu/cpu13/topology/core_id | 1 +
.../cpu/cpu13/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu13/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu14/online | 1 +
.../linux-test7/cpu/cpu14/topology/core_id | 1 +
.../cpu/cpu14/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu14/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu15/online | 1 +
.../linux-test7/cpu/cpu15/topology/core_id | 1 +
.../cpu/cpu15/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu15/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu16/online | 1 +
.../linux-test7/cpu/cpu16/topology/core_id | 1 +
.../cpu/cpu16/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu16/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu17/online | 1 +
.../linux-test7/cpu/cpu17/topology/core_id | 1 +
.../cpu/cpu17/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu17/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu18/online | 1 +
.../linux-test7/cpu/cpu18/topology/core_id | 1 +
.../cpu/cpu18/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu18/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu19/online | 1 +
.../linux-test7/cpu/cpu19/topology/core_id | 1 +
.../cpu/cpu19/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu19/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu2/online | 1 +
.../linux-test7/cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu2/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu20/online | 1 +
.../linux-test7/cpu/cpu20/topology/core_id | 1 +
.../cpu/cpu20/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu20/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu21/online | 1 +
.../linux-test7/cpu/cpu21/topology/core_id | 1 +
.../cpu/cpu21/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu21/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu22/online | 1 +
.../linux-test7/cpu/cpu22/topology/core_id | 1 +
.../cpu/cpu22/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu22/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu23/online | 1 +
.../linux-test7/cpu/cpu23/topology/core_id | 1 +
.../cpu/cpu23/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu23/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu3/online | 1 +
.../linux-test7/cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu3/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu4/online | 1 +
.../linux-test7/cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu4/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu5/online | 1 +
.../linux-test7/cpu/cpu5/topology/core_id | 1 +
.../cpu/cpu5/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu5/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu6/online | 1 +
.../linux-test7/cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu6/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu7/online | 1 +
.../linux-test7/cpu/cpu7/topology/core_id | 1 +
.../cpu/cpu7/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu7/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu8/online | 1 +
.../linux-test7/cpu/cpu8/topology/core_id | 1 +
.../cpu/cpu8/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu8/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/cpu/cpu9/online | 1 +
.../linux-test7/cpu/cpu9/topology/core_id | 1 +
.../cpu/cpu9/topology/physical_package_id | 1 +
.../linux-test7/cpu/cpu9/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu0 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu1 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu10 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu11 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu12 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu13 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu14 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu15 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu16 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu17 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu18 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu19 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu2 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu20 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu21 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu22 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu23 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu3 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu4 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu5 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu6 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu7 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu8 | 1 +
tests/nodeinfodata/linux-test7/node/node0/cpu9 | 1 +
tests/nodeinfodata/linux-test7/node/node0/meminfo | 29 +
tests/nodeinfodata/linux-test7/node/online | 1 +
tests/nodeinfodata/linux-test7/node/possible | 1 +
.../linux-test8/cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu0/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu1/online | 1 +
.../linux-test8/cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu1/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu10/online | 1 +
.../linux-test8/cpu/cpu10/topology/core_id | 1 +
.../cpu/cpu10/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu10/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu11/online | 1 +
.../linux-test8/cpu/cpu11/topology/core_id | 1 +
.../cpu/cpu11/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu11/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu12/online | 1 +
.../linux-test8/cpu/cpu12/topology/core_id | 1 +
.../cpu/cpu12/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu12/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu13/online | 1 +
.../linux-test8/cpu/cpu13/topology/core_id | 1 +
.../cpu/cpu13/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu13/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu14/online | 1 +
.../linux-test8/cpu/cpu14/topology/core_id | 1 +
.../cpu/cpu14/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu14/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu15/online | 1 +
.../linux-test8/cpu/cpu15/topology/core_id | 1 +
.../cpu/cpu15/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu15/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu16/online | 1 +
.../linux-test8/cpu/cpu16/topology/core_id | 1 +
.../cpu/cpu16/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu16/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu17/online | 1 +
.../linux-test8/cpu/cpu17/topology/core_id | 1 +
.../cpu/cpu17/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu17/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu18/online | 1 +
.../linux-test8/cpu/cpu18/topology/core_id | 1 +
.../cpu/cpu18/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu18/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu19/online | 1 +
.../linux-test8/cpu/cpu19/topology/core_id | 1 +
.../cpu/cpu19/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu19/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu2/online | 1 +
.../linux-test8/cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu2/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu20/online | 1 +
.../linux-test8/cpu/cpu20/topology/core_id | 1 +
.../cpu/cpu20/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu20/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu21/online | 1 +
.../linux-test8/cpu/cpu21/topology/core_id | 1 +
.../cpu/cpu21/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu21/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu22/online | 1 +
.../linux-test8/cpu/cpu22/topology/core_id | 1 +
.../cpu/cpu22/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu22/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu23/online | 1 +
.../linux-test8/cpu/cpu23/topology/core_id | 1 +
.../cpu/cpu23/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu23/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu24/online | 1 +
.../linux-test8/cpu/cpu24/topology/core_id | 1 +
.../cpu/cpu24/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu24/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu25/online | 1 +
.../linux-test8/cpu/cpu25/topology/core_id | 1 +
.../cpu/cpu25/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu25/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu26/online | 1 +
.../linux-test8/cpu/cpu26/topology/core_id | 1 +
.../cpu/cpu26/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu26/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu27/online | 1 +
.../linux-test8/cpu/cpu27/topology/core_id | 1 +
.../cpu/cpu27/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu27/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu28/online | 1 +
.../linux-test8/cpu/cpu28/topology/core_id | 1 +
.../cpu/cpu28/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu28/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu29/online | 1 +
.../linux-test8/cpu/cpu29/topology/core_id | 1 +
.../cpu/cpu29/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu29/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu3/online | 1 +
.../linux-test8/cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu3/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu30/online | 1 +
.../linux-test8/cpu/cpu30/topology/core_id | 1 +
.../cpu/cpu30/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu30/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu31/online | 1 +
.../linux-test8/cpu/cpu31/topology/core_id | 1 +
.../cpu/cpu31/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu31/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu32/online | 1 +
.../linux-test8/cpu/cpu32/topology/core_id | 1 +
.../cpu/cpu32/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu32/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu33/online | 1 +
.../linux-test8/cpu/cpu33/topology/core_id | 1 +
.../cpu/cpu33/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu33/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu34/online | 1 +
.../linux-test8/cpu/cpu34/topology/core_id | 1 +
.../cpu/cpu34/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu34/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu35/online | 1 +
.../linux-test8/cpu/cpu35/topology/core_id | 1 +
.../cpu/cpu35/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu35/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu36/online | 1 +
.../linux-test8/cpu/cpu36/topology/core_id | 1 +
.../cpu/cpu36/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu36/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu37/online | 1 +
.../linux-test8/cpu/cpu37/topology/core_id | 1 +
.../cpu/cpu37/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu37/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu38/online | 1 +
.../linux-test8/cpu/cpu38/topology/core_id | 1 +
.../cpu/cpu38/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu38/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu39/online | 1 +
.../linux-test8/cpu/cpu39/topology/core_id | 1 +
.../cpu/cpu39/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu39/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu4/online | 1 +
.../linux-test8/cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu4/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu40/online | 1 +
.../linux-test8/cpu/cpu40/topology/core_id | 1 +
.../cpu/cpu40/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu40/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu41/online | 1 +
.../linux-test8/cpu/cpu41/topology/core_id | 1 +
.../cpu/cpu41/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu41/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu42/online | 1 +
.../linux-test8/cpu/cpu42/topology/core_id | 1 +
.../cpu/cpu42/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu42/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu43/online | 1 +
.../linux-test8/cpu/cpu43/topology/core_id | 1 +
.../cpu/cpu43/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu43/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu44/online | 1 +
.../linux-test8/cpu/cpu44/topology/core_id | 1 +
.../cpu/cpu44/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu44/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu45/online | 1 +
.../linux-test8/cpu/cpu45/topology/core_id | 1 +
.../cpu/cpu45/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu45/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu46/online | 1 +
.../linux-test8/cpu/cpu46/topology/core_id | 1 +
.../cpu/cpu46/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu46/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu47/online | 1 +
.../linux-test8/cpu/cpu47/topology/core_id | 1 +
.../cpu/cpu47/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu47/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu48/online | 1 +
.../linux-test8/cpu/cpu48/topology/core_id | 1 +
.../cpu/cpu48/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu48/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu49/online | 1 +
.../linux-test8/cpu/cpu49/topology/core_id | 1 +
.../cpu/cpu49/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu49/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu5/online | 1 +
.../linux-test8/cpu/cpu5/topology/core_id | 1 +
.../cpu/cpu5/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu5/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu50/online | 1 +
.../linux-test8/cpu/cpu50/topology/core_id | 1 +
.../cpu/cpu50/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu50/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu51/online | 1 +
.../linux-test8/cpu/cpu51/topology/core_id | 1 +
.../cpu/cpu51/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu51/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu52/online | 1 +
.../linux-test8/cpu/cpu52/topology/core_id | 1 +
.../cpu/cpu52/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu52/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu53/online | 1 +
.../linux-test8/cpu/cpu53/topology/core_id | 1 +
.../cpu/cpu53/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu53/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu54/online | 1 +
.../linux-test8/cpu/cpu54/topology/core_id | 1 +
.../cpu/cpu54/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu54/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu55/online | 1 +
.../linux-test8/cpu/cpu55/topology/core_id | 1 +
.../cpu/cpu55/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu55/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu56/online | 1 +
.../linux-test8/cpu/cpu56/topology/core_id | 1 +
.../cpu/cpu56/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu56/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu57/online | 1 +
.../linux-test8/cpu/cpu57/topology/core_id | 1 +
.../cpu/cpu57/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu57/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu58/online | 1 +
.../linux-test8/cpu/cpu58/topology/core_id | 1 +
.../cpu/cpu58/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu58/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu59/online | 1 +
.../linux-test8/cpu/cpu59/topology/core_id | 1 +
.../cpu/cpu59/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu59/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu6/online | 1 +
.../linux-test8/cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu6/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu60/online | 1 +
.../linux-test8/cpu/cpu60/topology/core_id | 1 +
.../cpu/cpu60/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu60/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu61/online | 1 +
.../linux-test8/cpu/cpu61/topology/core_id | 1 +
.../cpu/cpu61/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu61/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu62/online | 1 +
.../linux-test8/cpu/cpu62/topology/core_id | 1 +
.../cpu/cpu62/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu62/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu63/online | 1 +
.../linux-test8/cpu/cpu63/topology/core_id | 1 +
.../cpu/cpu63/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu63/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu7/online | 1 +
.../linux-test8/cpu/cpu7/topology/core_id | 1 +
.../cpu/cpu7/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu7/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu8/online | 1 +
.../linux-test8/cpu/cpu8/topology/core_id | 1 +
.../cpu/cpu8/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu8/topology/thread_siblings | 1 +
tests/nodeinfodata/linux-test8/cpu/cpu9/online | 1 +
.../linux-test8/cpu/cpu9/topology/core_id | 1 +
.../cpu/cpu9/topology/physical_package_id | 1 +
.../linux-test8/cpu/cpu9/topology/thread_siblings | 1 +
.../linux-test8/cpu/cpuidle/current_driver | 1 +
.../linux-test8/cpu/cpuidle/current_governor_ro | 1 +
tests/nodeinfodata/linux-test8/cpu/kernel_max | 1 +
tests/nodeinfodata/linux-test8/cpu/offline | 1 +
tests/nodeinfodata/linux-test8/cpu/online | 1 +
tests/nodeinfodata/linux-test8/cpu/possible | 1 +
tests/nodeinfodata/linux-test8/cpu/present | 1 +
.../linux-test8/cpu/sched_mc_power_savings | 1 +
.../linux-test8/cpu/sched_smt_power_savings | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu0 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu12 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu16 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu20 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu24 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu28 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu4 | 1 +
tests/nodeinfodata/linux-test8/node/node0/cpu8 | 1 +
tests/nodeinfodata/linux-test8/node/node0/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node1/cpu32 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu36 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu40 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu44 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu48 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu52 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu56 | 1 +
tests/nodeinfodata/linux-test8/node/node1/cpu60 | 1 +
tests/nodeinfodata/linux-test8/node/node1/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node2/cpu1 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu13 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu17 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu21 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu25 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu29 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu5 | 1 +
tests/nodeinfodata/linux-test8/node/node2/cpu9 | 1 +
tests/nodeinfodata/linux-test8/node/node2/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node3/cpu33 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu37 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu41 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu45 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu49 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu53 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu57 | 1 +
tests/nodeinfodata/linux-test8/node/node3/cpu61 | 1 +
tests/nodeinfodata/linux-test8/node/node3/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node4/cpu10 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu14 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu18 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu2 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu22 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu26 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu30 | 1 +
tests/nodeinfodata/linux-test8/node/node4/cpu6 | 1 +
tests/nodeinfodata/linux-test8/node/node4/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node5/cpu34 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu38 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu42 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu46 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu50 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu54 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu58 | 1 +
tests/nodeinfodata/linux-test8/node/node5/cpu62 | 1 +
tests/nodeinfodata/linux-test8/node/node5/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node6/cpu35 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu39 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu43 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu47 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu51 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu55 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu59 | 1 +
tests/nodeinfodata/linux-test8/node/node6/cpu63 | 1 +
tests/nodeinfodata/linux-test8/node/node6/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/node7/cpu11 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu15 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu19 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu23 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu27 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu3 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu31 | 1 +
tests/nodeinfodata/linux-test8/node/node7/cpu7 | 1 +
tests/nodeinfodata/linux-test8/node/node7/meminfo | 29 +
tests/nodeinfodata/linux-test8/node/online | 1 +
tests/nodeinfodata/linux-test8/node/possible | 1 +
tests/nodeinfodata/linux-x86-test7.cpuinfo | 648 ++++++++
tests/nodeinfodata/linux-x86-test7.expected | 1 +
tests/nodeinfodata/linux-x86-test8.cpuinfo | 1664 ++++++++++++++++++++
tests/nodeinfodata/linux-x86-test8.expected | 1 +
tests/nodeinfotest.c | 2 +
466 files changed, 3059 insertions(+), 6 deletions(-)
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu10/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu10/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu10/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu10/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu11/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu11/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu11/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu11/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu12/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu12/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu12/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu12/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu13/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu13/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu13/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu13/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu14/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu14/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu14/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu14/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu15/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu15/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu15/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu15/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu16/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu16/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu16/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu16/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu17/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu17/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu17/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu17/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu18/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu18/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu18/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu18/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu19/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu19/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu19/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu19/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu20/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu20/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu20/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu20/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu21/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu21/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu21/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu21/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu22/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu22/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu22/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu22/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu23/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu23/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu23/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu23/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu5/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu7/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu7/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu8/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu8/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu8/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu8/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu9/online
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu9/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu9/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test7/cpu/cpu9/topology/thread_siblings
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu1
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu10
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu11
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu12
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu13
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu14
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu15
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu16
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu17
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu18
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu19
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu2
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu20
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu21
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu22
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu23
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu3
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu4
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu5
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu6
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu7
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu8
create mode 120000 tests/nodeinfodata/linux-test7/node/node0/cpu9
create mode 100644 tests/nodeinfodata/linux-test7/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-test7/node/online
create mode 100644 tests/nodeinfodata/linux-test7/node/possible
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu10/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu10/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu10/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu10/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu11/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu11/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu11/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu11/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu12/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu12/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu12/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu12/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu13/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu13/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu13/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu13/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu14/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu14/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu14/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu14/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu15/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu15/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu15/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu15/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu16/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu16/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu16/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu16/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu17/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu17/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu17/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu17/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu18/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu18/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu18/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu18/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu19/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu19/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu19/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu19/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu20/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu20/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu20/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu20/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu21/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu21/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu21/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu21/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu22/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu22/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu22/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu22/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu23/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu23/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu23/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu23/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu24/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu24/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu24/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu24/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu25/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu25/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu25/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu25/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu26/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu26/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu26/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu26/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu27/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu27/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu27/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu27/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu28/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu28/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu28/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu28/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu29/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu29/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu29/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu29/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu30/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu30/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu30/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu30/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu31/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu31/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu31/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu31/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu32/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu32/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu32/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu32/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu33/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu33/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu33/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu33/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu34/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu34/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu34/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu34/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu35/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu35/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu35/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu35/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu36/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu36/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu36/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu36/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu37/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu37/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu37/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu37/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu38/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu38/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu38/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu38/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu39/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu39/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu39/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu39/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu40/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu40/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu40/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu40/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu41/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu41/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu41/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu41/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu42/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu42/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu42/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu42/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu43/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu43/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu43/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu43/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu44/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu44/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu44/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu44/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu45/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu45/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu45/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu45/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu46/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu46/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu46/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu46/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu47/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu47/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu47/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu47/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu48/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu48/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu48/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu48/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu49/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu49/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu49/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu49/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu5/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu50/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu50/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu50/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu50/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu51/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu51/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu51/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu51/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu52/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu52/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu52/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu52/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu53/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu53/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu53/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu53/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu54/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu54/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu54/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu54/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu55/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu55/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu55/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu55/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu56/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu56/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu56/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu56/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu57/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu57/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu57/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu57/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu58/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu58/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu58/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu58/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu59/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu59/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu59/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu59/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu60/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu60/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu60/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu60/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu61/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu61/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu61/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu61/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu62/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu62/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu62/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu62/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu63/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu63/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu63/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu63/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu7/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu7/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu8/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu8/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu8/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu8/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu9/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu9/topology/core_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu9/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpu9/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
create mode 100644 tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
create mode 100644 tests/nodeinfodata/linux-test8/cpu/kernel_max
create mode 100644 tests/nodeinfodata/linux-test8/cpu/offline
create mode 100644 tests/nodeinfodata/linux-test8/cpu/online
create mode 100644 tests/nodeinfodata/linux-test8/cpu/possible
create mode 100644 tests/nodeinfodata/linux-test8/cpu/present
create mode 100644 tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
create mode 100644 tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu0
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu12
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu16
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu20
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu24
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu28
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu4
create mode 120000 tests/nodeinfodata/linux-test8/node/node0/cpu8
create mode 100644 tests/nodeinfodata/linux-test8/node/node0/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu32
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu36
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu40
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu44
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu48
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu52
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu56
create mode 120000 tests/nodeinfodata/linux-test8/node/node1/cpu60
create mode 100644 tests/nodeinfodata/linux-test8/node/node1/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu1
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu13
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu17
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu21
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu25
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu29
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu5
create mode 120000 tests/nodeinfodata/linux-test8/node/node2/cpu9
create mode 100644 tests/nodeinfodata/linux-test8/node/node2/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu33
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu37
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu41
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu45
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu49
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu53
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu57
create mode 120000 tests/nodeinfodata/linux-test8/node/node3/cpu61
create mode 100644 tests/nodeinfodata/linux-test8/node/node3/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu10
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu14
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu18
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu2
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu22
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu26
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu30
create mode 120000 tests/nodeinfodata/linux-test8/node/node4/cpu6
create mode 100644 tests/nodeinfodata/linux-test8/node/node4/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu34
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu38
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu42
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu46
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu50
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu54
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu58
create mode 120000 tests/nodeinfodata/linux-test8/node/node5/cpu62
create mode 100644 tests/nodeinfodata/linux-test8/node/node5/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu35
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu39
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu43
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu47
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu51
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu55
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu59
create mode 120000 tests/nodeinfodata/linux-test8/node/node6/cpu63
create mode 100644 tests/nodeinfodata/linux-test8/node/node6/meminfo
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu11
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu15
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu19
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu23
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu27
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu3
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu31
create mode 120000 tests/nodeinfodata/linux-test8/node/node7/cpu7
create mode 100644 tests/nodeinfodata/linux-test8/node/node7/meminfo
create mode 100644 tests/nodeinfodata/linux-test8/node/online
create mode 100644 tests/nodeinfodata/linux-test8/node/possible
create mode 100644 tests/nodeinfodata/linux-x86-test7.cpuinfo
create mode 100644 tests/nodeinfodata/linux-x86-test7.expected
create mode 100644 tests/nodeinfodata/linux-x86-test8.cpuinfo
create mode 100644 tests/nodeinfodata/linux-x86-test8.expected
--
1.8.0
12 years
[libvirt] [PATCH] sanlock: Retry after EINPROGRESS
by Michal Privoznik
It may take some time for sanlock to add a lockspace. And if user
restart libvirtd service meanwhile, the fresh daemon can fail adding the
same lockspace with EINPROGRESS. Hence, we should retry a few times
before claiming an error. This issue can be easily reproduced:
for i in {1..1000} ; do echo $i; service libvirtd restart; sleep 2; done
20
Stopping libvirtd daemon: [FAILED]
Starting libvirtd daemon: [ OK ]
21
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: [ OK ]
22
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: [ OK ]
error : virLockManagerSanlockSetupLockspace:334 : Unable to add
lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Operation now in
progress
---
src/locking/lock_driver_sanlock.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index d24f3d6..6d02ac6 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -184,6 +184,11 @@ static int virLockManagerSanlockLoadConfig(const char *configFile)
return 0;
}
+/* How much ms sleep before retrying to add a lockspace? */
+#define LOCKSPACE_SLEEP 100
+/* How many times try adding a lockspace? */
+#define LOCKSPACE_RETRIES 10
+
static int virLockManagerSanlockSetupLockspace(void)
{
int fd = -1;
@@ -192,6 +197,7 @@ static int virLockManagerSanlockSetupLockspace(void)
struct sanlk_lockspace ls;
char *path = NULL;
char *dir = NULL;
+ int retries = LOCKSPACE_RETRIES;
if (virAsprintf(&path, "%s/%s",
driver->autoDiskLeasePath,
@@ -320,9 +326,17 @@ static int virLockManagerSanlockSetupLockspace(void)
ls.host_id = driver->hostID;
/* Stage 2: Try to register the lockspace with the daemon.
* If the lockspace is already registered, we should get EEXIST back
- * in which case we can just carry on with life
+ * in which case we can just carry on with life, or EINPROGRESS if
+ * previous libvirtd instance started the work but didn't finish.
+ * Unfortunately, sanlock lacks an API to determine state of lockspace,
+ * so we have to do this blindly.
*/
+retry:
if ((rv = sanlock_add_lockspace(&ls, 0)) < 0) {
+ if (retries-- && -rv == EINPROGRESS) {
+ usleep(LOCKSPACE_SLEEP * 1000);
+ goto retry;
+ }
if (-rv != EEXIST) {
if (rv <= -200)
virReportError(VIR_ERR_INTERNAL_ERROR,
--
1.7.8.6
12 years
[libvirt] [PATCH 0/6] dnsmasq conf-file, DHCPv6, dnsmasq-RA updates
by Gene Czarcinski
OK, here it is. There are a related set of patches in that they are
mostly dependent and need to be applied in the order show..
The individual patch files explain what each one is.
Note that patch file 0003 for DHCPv6 adds some test files.
Note that patch file 0006 add a test for the dnsmasq version for
DHCPv6 support and if it is less that 2.64, it errors out.
Gene Czarcinski (6):
v6-6: put dnsmasq parameters into a file
v6-6: add dnsmasq interface= parameter
v6-7: Add support for DHCPv6
v1: get, parse, and save dnsmasq version id
v1: use dnsmasq instead of radvd to handle RA service
v1: for DHCPv6, add dnsmasq version check
docs/formatnetwork.html.in | 108 +++-
src/conf/network_conf.c | 100 ++--
src/conf/network_conf.h | 3 +
src/network/bridge_driver.c | 541 ++++++++++++++-------
src/network/bridge_driver.h | 7 +-
src/util/dnsmasq.c | 9 +-
tests/networkxml2argvdata/dhcp6-network.argv | 17 +
tests/networkxml2argvdata/dhcp6-network.xml | 16 +
tests/networkxml2argvdata/isolated-network.argv | 25 +-
tests/networkxml2argvdata/nat-network-dhcp6.argv | 20 +
tests/networkxml2argvdata/nat-network-dhcp6.xml | 26 +
.../networkxml2argvdata/nat-network-dns-hosts.argv | 15 +-
.../nat-network-dns-srv-record-minimal.argv | 37 +-
.../nat-network-dns-srv-record.argv | 37 +-
.../nat-network-dns-txt-record.argv | 31 +-
tests/networkxml2argvdata/nat-network.argv | 29 +-
tests/networkxml2argvdata/netboot-network.argv | 29 +-
.../networkxml2argvdata/netboot-proxy-network.argv | 26 +-
.../routed-network-dhcphost.argv | 15 +
.../routed-network-dhcphost.xml | 19 +
tests/networkxml2argvdata/routed-network.argv | 13 +-
tests/networkxml2argvtest.c | 49 +-
22 files changed, 822 insertions(+), 350 deletions(-)
create mode 100644 tests/networkxml2argvdata/dhcp6-network.argv
create mode 100644 tests/networkxml2argvdata/dhcp6-network.xml
create mode 100644 tests/networkxml2argvdata/nat-network-dhcp6.argv
create mode 100644 tests/networkxml2argvdata/nat-network-dhcp6.xml
create mode 100644 tests/networkxml2argvdata/routed-network-dhcphost.argv
create mode 100644 tests/networkxml2argvdata/routed-network-dhcphost.xml
--
1.7.11.7
12 years
Re: [libvirt] [Qemu-devel] qemu-kvm not listed by command "virsh list --all"
by Stefan Hajnoczi
On Mon, Nov 12, 2012 at 9:01 AM, Peter Cheung <mcheung63(a)hotmail.com> wrote:
> Dear All
> Run a VM by qemu-kvm, and then i cannot list it by command "virsh list
> --all". Why?
> I am sure the VM is running because i can vnc to it.
Libvirt does not manage qemu-kvm processes that were started outside
its control by default.
If you want to do this, please look at the virsh qemu-attach <pid> command.
Stefan
12 years
[libvirt] [PATCH 1/2] qemu: refactor graphics code to not hardcode a single display
by Alon Levy
The check for a single display remains so no new functionality is added.
---
Concerning both patches, I've tested running with all three simultaneously (sdl+spice+vnc) and with spice+vnc, using a single qxl device.
src/qemu/qemu_command.c | 2425 ++++++++++++++++++++++++-----------------------
src/qemu/qemu_process.c | 70 +-
2 files changed, 1259 insertions(+), 1236 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1e96982..f9e4d4d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4410,171 +4410,499 @@ error:
return -1;
}
-/*
- * Constructs a argv suitable for launching qemu with config defined
- * for a given virtual machine.
- *
- * XXX 'conn' is only required to resolve network -> bridge name
- * figure out how to remove this requirement some day
- */
-virCommandPtr
-qemuBuildCommandLine(virConnectPtr conn,
- struct qemud_driver *driver,
- virDomainDefPtr def,
- virDomainChrSourceDefPtr monitor_chr,
- bool monitor_json,
- qemuCapsPtr caps,
- const char *migrateFrom,
- int migrateFd,
- virDomainSnapshotObjPtr snapshot,
- enum virNetDevVPortProfileOp vmop)
+enum {
+ OK=0,
+ ERROR=1,
+ NO_MEMORY=2,
+};
+
+static int
+qemuBuildGraphicsCommandLine(struct qemud_driver *driver,
+ virCommandPtr cmd,
+ virDomainDefPtr def,
+ qemuCapsPtr caps,
+ virDomainGraphicsDefPtr graphics)
{
- int i, j;
- struct utsname ut;
- int disableKQEMU = 0;
- int enableKQEMU = 0;
- int disableKVM = 0;
- int enableKVM = 0;
- const char *emulator;
- char uuid[VIR_UUID_STRING_BUFLEN];
- char *cpu;
- char *smp;
- int last_good_net = -1;
- bool hasHwVirt = false;
- virCommandPtr cmd = NULL;
- bool emitBootindex = false;
- int usbcontroller = 0;
- bool usblegacy = false;
- uname_normalize(&ut);
- int contOrder[] = {
- /* We don't add an explicit IDE or FD controller because the
- * provided PIIX4 device already includes one. It isn't possible to
- * remove the PIIX4. */
- VIR_DOMAIN_CONTROLLER_TYPE_USB,
- VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
- VIR_DOMAIN_CONTROLLER_TYPE_SATA,
- VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
- VIR_DOMAIN_CONTROLLER_TYPE_CCID,
- };
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
+ virBuffer opt = VIR_BUFFER_INITIALIZER;
- VIR_DEBUG("conn=%p driver=%p def=%p mon=%p json=%d "
- "caps=%p migrateFrom=%s migrateFD=%d "
- "snapshot=%p vmop=%d",
- conn, driver, def, monitor_chr, monitor_json,
- caps, migrateFrom, migrateFd, snapshot, vmop);
+ if (!qemuCapsGet(caps, QEMU_CAPS_VNC)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("vnc graphics are not supported with this QEMU"));
+ return ERROR;
+ }
- virUUIDFormat(def->uuid, uuid);
+ if (graphics->data.vnc.socket ||
+ driver->vncAutoUnixSocket) {
- emulator = def->emulator;
+ if (!graphics->data.vnc.socket &&
+ virAsprintf(&graphics->data.vnc.socket,
+ "%s/%s.vnc", driver->libDir, def->name) == -1) {
+ return NO_MEMORY;
+ }
- /*
- * do not use boot=on for drives when not using KVM since this
- * is not supported at all in upstream QEmu.
- */
- if (qemuCapsGet(caps, QEMU_CAPS_KVM) &&
- (def->virtType == VIR_DOMAIN_VIRT_QEMU))
- qemuCapsClear(caps, QEMU_CAPS_DRIVE_BOOT);
+ virBufferAsprintf(&opt, "unix:%s",
+ graphics->data.vnc.socket);
- switch (def->virtType) {
- case VIR_DOMAIN_VIRT_QEMU:
- if (qemuCapsGet(caps, QEMU_CAPS_KQEMU))
- disableKQEMU = 1;
- if (qemuCapsGet(caps, QEMU_CAPS_KVM))
- disableKVM = 1;
- break;
+ } else if (qemuCapsGet(caps, QEMU_CAPS_VNC_COLON)) {
+ const char *listenNetwork;
+ const char *listenAddr = NULL;
+ char *netAddr = NULL;
+ bool escapeAddr;
+ int ret;
- case VIR_DOMAIN_VIRT_KQEMU:
- if (qemuCapsGet(caps, QEMU_CAPS_KVM))
- disableKVM = 1;
+ switch (virDomainGraphicsListenGetType(graphics, 0)) {
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
+ listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
+ break;
- if (qemuCapsGet(caps, QEMU_CAPS_ENABLE_KQEMU)) {
- enableKQEMU = 1;
- } else if (!qemuCapsGet(caps, QEMU_CAPS_KQEMU)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("the QEMU binary %s does not support kqemu"),
- emulator);
- goto error;
- }
- break;
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
+ listenNetwork = virDomainGraphicsListenGetNetwork(graphics, 0);
+ if (!listenNetwork)
+ break;
+ ret = networkGetNetworkAddress(listenNetwork, &netAddr);
+ if (ret <= -2) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("network-based listen not possible, "
+ "network driver not present"));
+ return 1;
+ }
+ if (ret < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("listen network '%s' had no usable address"),
+ listenNetwork);
+ return 1;
+ }
+ listenAddr = netAddr;
+ /* store the address we found in the <graphics> element so it will
+ * show up in status. */
+ if (virDomainGraphicsListenSetAddress(graphics, 0,
+ listenAddr, -1, false) < 0)
+ return 1;
+ break;
+ }
- case VIR_DOMAIN_VIRT_KVM:
- if (qemuCapsGet(caps, QEMU_CAPS_KQEMU))
- disableKQEMU = 1;
+ if (!listenAddr)
+ listenAddr = driver->vncListen;
- if (qemuCapsGet(caps, QEMU_CAPS_ENABLE_KVM)) {
- enableKVM = 1;
- } else if (!qemuCapsGet(caps, QEMU_CAPS_KVM)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("the QEMU binary %s does not support kvm"),
- emulator);
- goto error;
+ escapeAddr = strchr(listenAddr, ':') != NULL;
+ if (escapeAddr)
+ virBufferAsprintf(&opt, "[%s]", listenAddr);
+ else
+ virBufferAdd(&opt, listenAddr, -1);
+ virBufferAsprintf(&opt, ":%d",
+ graphics->data.vnc.port - 5900);
+
+ VIR_FREE(netAddr);
+ } else {
+ virBufferAsprintf(&opt, "%d",
+ graphics->data.vnc.port - 5900);
}
- break;
- case VIR_DOMAIN_VIRT_XEN:
- /* XXX better check for xenner */
- break;
+ if (qemuCapsGet(caps, QEMU_CAPS_VNC_COLON)) {
+ if (graphics->data.vnc.auth.passwd ||
+ driver->vncPassword)
+ virBufferAddLit(&opt, ",password");
- default:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("the QEMU binary %s does not support %s"),
- emulator, virDomainVirtTypeToString(def->virtType));
- break;
- }
+ if (driver->vncTLS) {
+ virBufferAddLit(&opt, ",tls");
+ if (driver->vncTLSx509verify) {
+ virBufferAsprintf(&opt, ",x509verify=%s",
+ driver->vncTLSx509certdir);
+ } else {
+ virBufferAsprintf(&opt, ",x509=%s",
+ driver->vncTLSx509certdir);
+ }
+ }
- cmd = virCommandNew(emulator);
+ if (driver->vncSASL) {
+ virBufferAddLit(&opt, ",sasl");
- virCommandAddEnvPassCommon(cmd);
+ if (driver->vncSASLdir)
+ virCommandAddEnvPair(cmd, "SASL_CONF_DIR",
+ driver->vncSASLdir);
- if (qemuCapsGet(caps, QEMU_CAPS_NAME)) {
- virCommandAddArg(cmd, "-name");
- if (driver->setProcessName &&
- qemuCapsGet(caps, QEMU_CAPS_NAME_PROCESS)) {
- virCommandAddArgFormat(cmd, "%s,process=qemu:%s",
- def->name, def->name);
+ /* TODO: Support ACLs later */
+ }
+ }
+
+ virCommandAddArg(cmd, "-vnc");
+ virCommandAddArgBuffer(cmd, &opt);
+ if (graphics->data.vnc.keymap) {
+ virCommandAddArgList(cmd, "-k", graphics->data.vnc.keymap,
+ NULL);
+ }
+
+ /* Unless user requested it, set the audio backend to none, to
+ * prevent it opening the host OS audio devices, since that causes
+ * security issues and might not work when using VNC.
+ */
+ if (driver->vncAllowHostAudio) {
+ virCommandAddEnvPass(cmd, "QEMU_AUDIO_DRV");
} else {
- virCommandAddArg(cmd, def->name);
+ virCommandAddEnvString(cmd, "QEMU_AUDIO_DRV=none");
+ }
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
+ if (qemuCapsGet(caps, QEMU_CAPS_0_10) &&
+ !qemuCapsGet(caps, QEMU_CAPS_SDL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("sdl not supported by '%s'"),
+ def->emulator);
+ return 1;
}
- }
- virCommandAddArg(cmd, "-S"); /* freeze CPU */
- if (qemuBuildMachineArgStr(cmd, def, caps) < 0)
- goto error;
+ if (graphics->data.sdl.xauth)
+ virCommandAddEnvPair(cmd, "XAUTHORITY",
+ graphics->data.sdl.xauth);
+ if (graphics->data.sdl.display)
+ virCommandAddEnvPair(cmd, "DISPLAY",
+ graphics->data.sdl.display);
+ if (graphics->data.sdl.fullscreen)
+ virCommandAddArg(cmd, "-full-screen");
- if (qemuBuildCpuArgStr(driver, def, emulator, caps,
- &ut, &cpu, &hasHwVirt, !!migrateFrom) < 0)
- goto error;
+ /* If using SDL for video, then we should just let it
+ * use QEMU's host audio drivers, possibly SDL too
+ * User can set these two before starting libvirtd
+ */
+ virCommandAddEnvPass(cmd, "QEMU_AUDIO_DRV");
+ virCommandAddEnvPass(cmd, "SDL_AUDIODRIVER");
- if (cpu) {
- virCommandAddArgList(cmd, "-cpu", cpu, NULL);
- VIR_FREE(cpu);
+ /* New QEMU has this flag to let us explicitly ask for
+ * SDL graphics. This is better than relying on the
+ * default, since the default changes :-( */
+ if (qemuCapsGet(caps, QEMU_CAPS_SDL))
+ virCommandAddArg(cmd, "-sdl");
- if (qemuCapsGet(caps, QEMU_CAPS_NESTING) &&
- hasHwVirt)
- virCommandAddArg(cmd, "-enable-nesting");
- }
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ virBuffer opt = VIR_BUFFER_INITIALIZER;
+ const char *listenNetwork;
+ const char *listenAddr = NULL;
+ char *netAddr = NULL;
+ int ret;
+ int defaultMode = graphics->data.spice.defaultMode;
- if (disableKQEMU)
- virCommandAddArg(cmd, "-no-kqemu");
- else if (enableKQEMU)
- virCommandAddArgList(cmd, "-enable-kqemu", "-kernel-kqemu", NULL);
- if (disableKVM)
- virCommandAddArg(cmd, "-no-kvm");
- if (enableKVM)
- virCommandAddArg(cmd, "-enable-kvm");
+ if (!qemuCapsGet(caps, QEMU_CAPS_SPICE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice graphics are not supported with this QEMU"));
+ return 1;
+ }
- if (def->os.loader) {
- virCommandAddArg(cmd, "-bios");
- virCommandAddArg(cmd, def->os.loader);
- }
+ virBufferAsprintf(&opt, "port=%u", graphics->data.spice.port);
- /* Set '-m MB' based on maxmem, because the lower 'memory' limit
- * is set post-startup using the balloon driver. If balloon driver
- * is not supported, then they're out of luck anyway. Update the
- * XML to reflect our rounding.
- */
- virCommandAddArg(cmd, "-m");
- def->mem.max_balloon = VIR_DIV_UP(def->mem.max_balloon, 1024) * 1024;
+ if (graphics->data.spice.tlsPort > 0) {
+ if (!driver->spiceTLS) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice TLS port set in XML configuration,"
+ " but TLS is disabled in qemu.conf"));
+ return 1;
+ }
+ virBufferAsprintf(&opt, ",tls-port=%u",
+ graphics->data.spice.tlsPort);
+ }
+
+ switch (virDomainGraphicsListenGetType(graphics, 0)) {
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
+ listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
+ listenNetwork = virDomainGraphicsListenGetNetwork(graphics, 0);
+ if (!listenNetwork)
+ break;
+ ret = networkGetNetworkAddress(listenNetwork, &netAddr);
+ if (ret <= -2) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("network-based listen not possible, "
+ "network driver not present"));
+ return 1;
+ }
+ if (ret < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("listen network '%s' had no usable address"),
+ listenNetwork);
+ return 1;
+ }
+ listenAddr = netAddr;
+ /* store the address we found in the <graphics> element so it will
+ * show up in status. */
+ if (virDomainGraphicsListenSetAddress(graphics, 0,
+ listenAddr, -1, false) < 0)
+ return 1;
+ break;
+ }
+
+ if (!listenAddr)
+ listenAddr = driver->spiceListen;
+ if (listenAddr)
+ virBufferAsprintf(&opt, ",addr=%s", listenAddr);
+
+ VIR_FREE(netAddr);
+
+ int mm = graphics->data.spice.mousemode;
+ if (mm) {
+ switch (mm) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
+ virBufferAsprintf(&opt, ",agent-mouse=off");
+ break;
+ case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT:
+ virBufferAsprintf(&opt, ",agent-mouse=on");
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* In the password case we set it via monitor command, to avoid
+ * making it visible on CLI, so there's no use of password=XXX
+ * in this bit of the code */
+ if (!graphics->data.spice.auth.passwd &&
+ !driver->spicePassword)
+ virBufferAddLit(&opt, ",disable-ticketing");
+
+ if (driver->spiceTLS)
+ virBufferAsprintf(&opt, ",x509-dir=%s",
+ driver->spiceTLSx509certdir);
+
+ switch (defaultMode) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+ virBufferAsprintf(&opt, ",tls-channel=default");
+ break;
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ virBufferAsprintf(&opt, ",plaintext-channel=default");
+ break;
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+ /* nothing */
+ break;
+ }
+
+ for (int i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
+ int mode = graphics->data.spice.channels[i];
+ switch (mode) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+ if (!driver->spiceTLS) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice secure channels set in XML configuration, but TLS is disabled in qemu.conf"));
+ return 1;
+ }
+ virBufferAsprintf(&opt, ",tls-channel=%s",
+ virDomainGraphicsSpiceChannelNameTypeToString(i));
+ break;
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ virBufferAsprintf(&opt, ",plaintext-channel=%s",
+ virDomainGraphicsSpiceChannelNameTypeToString(i));
+ break;
+ }
+ }
+ if (graphics->data.spice.image)
+ virBufferAsprintf(&opt, ",image-compression=%s",
+ virDomainGraphicsSpiceImageCompressionTypeToString(graphics->data.spice.image));
+ if (graphics->data.spice.jpeg)
+ virBufferAsprintf(&opt, ",jpeg-wan-compression=%s",
+ virDomainGraphicsSpiceJpegCompressionTypeToString(graphics->data.spice.jpeg));
+ if (graphics->data.spice.zlib)
+ virBufferAsprintf(&opt, ",zlib-glz-wan-compression=%s",
+ virDomainGraphicsSpiceZlibCompressionTypeToString(graphics->data.spice.zlib));
+ if (graphics->data.spice.playback)
+ virBufferAsprintf(&opt, ",playback-compression=%s",
+ virDomainGraphicsSpicePlaybackCompressionTypeToString(graphics->data.spice.playback));
+ if (graphics->data.spice.streaming)
+ virBufferAsprintf(&opt, ",streaming-video=%s",
+ virDomainGraphicsSpiceStreamingModeTypeToString(graphics->data.spice.streaming));
+ if (graphics->data.spice.copypaste == VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_NO)
+ virBufferAddLit(&opt, ",disable-copy-paste");
+
+ if (qemuCapsGet(caps, QEMU_CAPS_SEAMLESS_MIGRATION)) {
+ /* If qemu supports seamless migration turn it
+ * unconditionally on. If migration destination
+ * doesn't support it, it fallbacks to previous
+ * migration algorithm silently. */
+ virBufferAddLit(&opt, ",seamless-migration=on");
+ }
+
+ virCommandAddArg(cmd, "-spice");
+ virCommandAddArgBuffer(cmd, &opt);
+ if (graphics->data.spice.keymap)
+ virCommandAddArgList(cmd, "-k",
+ graphics->data.spice.keymap, NULL);
+ /* SPICE includes native support for tunnelling audio, so we
+ * set the audio backend to point at SPICE's own driver
+ */
+ virCommandAddEnvString(cmd, "QEMU_AUDIO_DRV=spice");
+
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported graphics type '%s'"),
+ virDomainGraphicsTypeToString(graphics->type));
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ * Constructs a argv suitable for launching qemu with config defined
+ * for a given virtual machine.
+ *
+ * XXX 'conn' is only required to resolve network -> bridge name
+ * figure out how to remove this requirement some day
+ */
+virCommandPtr
+qemuBuildCommandLine(virConnectPtr conn,
+ struct qemud_driver *driver,
+ virDomainDefPtr def,
+ virDomainChrSourceDefPtr monitor_chr,
+ bool monitor_json,
+ qemuCapsPtr caps,
+ const char *migrateFrom,
+ int migrateFd,
+ virDomainSnapshotObjPtr snapshot,
+ enum virNetDevVPortProfileOp vmop)
+{
+ int i, j;
+ struct utsname ut;
+ int disableKQEMU = 0;
+ int enableKQEMU = 0;
+ int disableKVM = 0;
+ int enableKVM = 0;
+ const char *emulator;
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ char *cpu;
+ char *smp;
+ int last_good_net = -1;
+ bool hasHwVirt = false;
+ virCommandPtr cmd = NULL;
+ bool emitBootindex = false;
+ int usbcontroller = 0;
+ bool usblegacy = false;
+ uname_normalize(&ut);
+ int contOrder[] = {
+ /* We don't add an explicit IDE or FD controller because the
+ * provided PIIX4 device already includes one. It isn't possible to
+ * remove the PIIX4. */
+ VIR_DOMAIN_CONTROLLER_TYPE_USB,
+ VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
+ VIR_DOMAIN_CONTROLLER_TYPE_SATA,
+ VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
+ VIR_DOMAIN_CONTROLLER_TYPE_CCID,
+ };
+
+ VIR_DEBUG("conn=%p driver=%p def=%p mon=%p json=%d "
+ "caps=%p migrateFrom=%s migrateFD=%d "
+ "snapshot=%p vmop=%d",
+ conn, driver, def, monitor_chr, monitor_json,
+ caps, migrateFrom, migrateFd, snapshot, vmop);
+
+ virUUIDFormat(def->uuid, uuid);
+
+ emulator = def->emulator;
+
+ /*
+ * do not use boot=on for drives when not using KVM since this
+ * is not supported at all in upstream QEmu.
+ */
+ if (qemuCapsGet(caps, QEMU_CAPS_KVM) &&
+ (def->virtType == VIR_DOMAIN_VIRT_QEMU))
+ qemuCapsClear(caps, QEMU_CAPS_DRIVE_BOOT);
+
+ switch (def->virtType) {
+ case VIR_DOMAIN_VIRT_QEMU:
+ if (qemuCapsGet(caps, QEMU_CAPS_KQEMU))
+ disableKQEMU = 1;
+ if (qemuCapsGet(caps, QEMU_CAPS_KVM))
+ disableKVM = 1;
+ break;
+
+ case VIR_DOMAIN_VIRT_KQEMU:
+ if (qemuCapsGet(caps, QEMU_CAPS_KVM))
+ disableKVM = 1;
+
+ if (qemuCapsGet(caps, QEMU_CAPS_ENABLE_KQEMU)) {
+ enableKQEMU = 1;
+ } else if (!qemuCapsGet(caps, QEMU_CAPS_KQEMU)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("the QEMU binary %s does not support kqemu"),
+ emulator);
+ goto error;
+ }
+ break;
+
+ case VIR_DOMAIN_VIRT_KVM:
+ if (qemuCapsGet(caps, QEMU_CAPS_KQEMU))
+ disableKQEMU = 1;
+
+ if (qemuCapsGet(caps, QEMU_CAPS_ENABLE_KVM)) {
+ enableKVM = 1;
+ } else if (!qemuCapsGet(caps, QEMU_CAPS_KVM)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("the QEMU binary %s does not support kvm"),
+ emulator);
+ goto error;
+ }
+ break;
+
+ case VIR_DOMAIN_VIRT_XEN:
+ /* XXX better check for xenner */
+ break;
+
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("the QEMU binary %s does not support %s"),
+ emulator, virDomainVirtTypeToString(def->virtType));
+ break;
+ }
+
+ cmd = virCommandNew(emulator);
+
+ virCommandAddEnvPassCommon(cmd);
+
+ if (qemuCapsGet(caps, QEMU_CAPS_NAME)) {
+ virCommandAddArg(cmd, "-name");
+ if (driver->setProcessName &&
+ qemuCapsGet(caps, QEMU_CAPS_NAME_PROCESS)) {
+ virCommandAddArgFormat(cmd, "%s,process=qemu:%s",
+ def->name, def->name);
+ } else {
+ virCommandAddArg(cmd, def->name);
+ }
+ }
+ virCommandAddArg(cmd, "-S"); /* freeze CPU */
+
+ if (qemuBuildMachineArgStr(cmd, def, caps) < 0)
+ goto error;
+
+ if (qemuBuildCpuArgStr(driver, def, emulator, caps,
+ &ut, &cpu, &hasHwVirt, !!migrateFrom) < 0)
+ goto error;
+
+ if (cpu) {
+ virCommandAddArgList(cmd, "-cpu", cpu, NULL);
+ VIR_FREE(cpu);
+
+ if (qemuCapsGet(caps, QEMU_CAPS_NESTING) &&
+ hasHwVirt)
+ virCommandAddArg(cmd, "-enable-nesting");
+ }
+
+ if (disableKQEMU)
+ virCommandAddArg(cmd, "-no-kqemu");
+ else if (enableKQEMU)
+ virCommandAddArgList(cmd, "-enable-kqemu", "-kernel-kqemu", NULL);
+ if (disableKVM)
+ virCommandAddArg(cmd, "-no-kvm");
+ if (enableKVM)
+ virCommandAddArg(cmd, "-enable-kvm");
+
+ if (def->os.loader) {
+ virCommandAddArg(cmd, "-bios");
+ virCommandAddArg(cmd, def->os.loader);
+ }
+
+ /* Set '-m MB' based on maxmem, because the lower 'memory' limit
+ * is set post-startup using the balloon driver. If balloon driver
+ * is not supported, then they're out of luck anyway. Update the
+ * XML to reflect our rounding.
+ */
+ virCommandAddArg(cmd, "-m");
+ def->mem.max_balloon = VIR_DIV_UP(def->mem.max_balloon, 1024) * 1024;
virCommandAddArgFormat(cmd, "%llu", def->mem.max_balloon / 1024);
if (def->mem.hugepage_backed) {
if (!driver->hugetlbfs_mount) {
@@ -4954,1231 +5282,924 @@ qemuBuildCommandLine(virConnectPtr conn,
break;
case VIR_DOMAIN_BOOT_NET:
boot[i] = 'n';
- break;
- default:
- boot[i] = 'c';
- break;
- }
- }
- boot[def->os.nBootDevs] = '\0';
-
- virBufferAsprintf(&boot_buf, "%s", boot);
- boot_nparams++;
- }
-
- if (def->os.bootmenu) {
- if (qemuCapsGet(caps, QEMU_CAPS_BOOT_MENU)) {
- if (boot_nparams++)
- virBufferAddChar(&boot_buf, ',');
-
- if (def->os.bootmenu == VIR_DOMAIN_BOOT_MENU_ENABLED)
- virBufferAsprintf(&boot_buf, "menu=on");
- else
- virBufferAsprintf(&boot_buf, "menu=off");
- } else {
- /* We cannot emit an error when bootmenu is enabled but
- * unsupported because of backward compatibility */
- VIR_WARN("bootmenu is enabled but not "
- "supported by this QEMU binary");
- }
- }
-
- if (def->os.bios.rt_set) {
- if (!qemuCapsGet(caps, QEMU_CAPS_REBOOT_TIMEOUT)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("reboot timeout is not supported "
- "by this QEMU binary"));
- goto error;
- }
-
- if (boot_nparams++)
- virBufferAddChar(&boot_buf, ',');
-
- virBufferAsprintf(&boot_buf,
- "reboot-timeout=%d",
- def->os.bios.rt_delay);
- }
-
- if (boot_nparams > 0) {
- virCommandAddArg(cmd, "-boot");
-
- if (boot_nparams < 2 || emitBootindex) {
- virCommandAddArgBuffer(cmd, &boot_buf);
- } else {
- virCommandAddArgFormat(cmd,
- "order=%s",
- virBufferContentAndReset(&boot_buf));
- }
- }
-
- if (def->os.kernel)
- virCommandAddArgList(cmd, "-kernel", def->os.kernel, NULL);
- if (def->os.initrd)
- virCommandAddArgList(cmd, "-initrd", def->os.initrd, NULL);
- if (def->os.cmdline)
- virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);
- } else {
- virCommandAddArgList(cmd, "-bootloader", def->os.bootloader, NULL);
- }
-
- for (i = 0 ; i < def->ndisks ; i++) {
- virDomainDiskDefPtr disk = def->disks[i];
-
- if (disk->driverName != NULL &&
- !STREQ(disk->driverName, "qemu")) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported driver name '%s' for disk '%s'"),
- disk->driverName, disk->src);
- goto error;
- }
- }
-
- if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- for (j = 0; j < ARRAY_CARDINALITY(contOrder); j++) {
- for (i = 0; i < def->ncontrollers; i++) {
- virDomainControllerDefPtr cont = def->controllers[i];
-
- if (cont->type != contOrder[j])
- continue;
-
- /* Also, skip USB controllers with type none.*/
- if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
- cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
- usbcontroller = -1; /* mark we don't want a controller */
- continue;
- }
-
- /* Only recent QEMU implements a SATA (AHCI) controller */
- if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
- if (!qemuCapsGet(caps, QEMU_CAPS_ICH9_AHCI)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("SATA is not supported with this "
- "QEMU binary"));
- goto error;
- } else {
- char *devstr;
-
- virCommandAddArg(cmd, "-device");
- if (!(devstr = qemuBuildControllerDevStr(def, cont,
- caps, NULL)))
- goto error;
-
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- }
- } else if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
- cont->model == -1 &&
- !qemuCapsGet(caps, QEMU_CAPS_PIIX3_USB_UHCI)) {
- if (usblegacy) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Multiple legacy USB controllers are "
- "not supported"));
- goto error;
- }
- usblegacy = true;
- } else {
- virCommandAddArg(cmd, "-device");
-
- char *devstr;
- if (!(devstr = qemuBuildControllerDevStr(def, cont, caps,
- &usbcontroller)))
- goto error;
-
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- }
- }
- }
- }
-
- if (usbcontroller == 0)
- virCommandAddArg(cmd, "-usb");
-
- for (i = 0 ; i < def->nhubs ; i++) {
- virDomainHubDefPtr hub = def->hubs[i];
- char *optstr;
-
- virCommandAddArg(cmd, "-device");
- if (!(optstr = qemuBuildHubDevStr(hub, caps)))
- goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
- }
-
- /* If QEMU supports -drive param instead of old -hda, -hdb, -cdrom .. */
- if (qemuCapsGet(caps, QEMU_CAPS_DRIVE)) {
- int bootCD = 0, bootFloppy = 0, bootDisk = 0;
-
- if ((qemuCapsGet(caps, QEMU_CAPS_DRIVE_BOOT) || emitBootindex)) {
- /* bootDevs will get translated into either bootindex=N or boot=on
- * depending on what qemu supports */
- for (i = 0 ; i < def->os.nBootDevs ; i++) {
- switch (def->os.bootDevs[i]) {
- case VIR_DOMAIN_BOOT_CDROM:
- bootCD = i + 1;
- break;
- case VIR_DOMAIN_BOOT_FLOPPY:
- bootFloppy = i + 1;
- break;
- case VIR_DOMAIN_BOOT_DISK:
- bootDisk = i + 1;
- break;
- }
- }
- }
-
- for (i = 0 ; i < def->ndisks ; i++) {
- char *optstr;
- int bootindex = 0;
- virDomainDiskDefPtr disk = def->disks[i];
- int withDeviceArg = 0;
- bool deviceFlagMasked = false;
-
- /* Unless we have -device, then USB disks need special
- handling */
- if ((disk->bus == VIR_DOMAIN_DISK_BUS_USB) &&
- !qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
- virCommandAddArg(cmd, "-usbdevice");
- virCommandAddArgFormat(cmd, "disk:%s", disk->src);
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported usb disk type for '%s'"),
- disk->src);
- goto error;
- }
- continue;
- }
-
- switch (disk->device) {
- case VIR_DOMAIN_DISK_DEVICE_CDROM:
- bootindex = bootCD;
- bootCD = 0;
- break;
- case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
- bootindex = bootFloppy;
- bootFloppy = 0;
- break;
- case VIR_DOMAIN_DISK_DEVICE_DISK:
- case VIR_DOMAIN_DISK_DEVICE_LUN:
- bootindex = bootDisk;
- bootDisk = 0;
- break;
- }
-
- virCommandAddArg(cmd, "-drive");
-
- /* Unfortunately it is not possible to use
- -device for floppies, or Xen paravirt
- devices. Fortunately, those don't need
- static PCI addresses, so we don't really
- care that we can't use -device */
- if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- if (disk->bus != VIR_DOMAIN_DISK_BUS_XEN) {
- withDeviceArg = 1;
- } else {
- qemuCapsClear(caps, QEMU_CAPS_DEVICE);
- deviceFlagMasked = true;
+ break;
+ default:
+ boot[i] = 'c';
+ break;
}
}
- optstr = qemuBuildDriveStr(conn, disk,
- emitBootindex ? false : !!bootindex,
- caps);
- if (deviceFlagMasked)
- qemuCapsSet(caps, QEMU_CAPS_DEVICE);
- if (!optstr)
- goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
-
- if (!emitBootindex)
- bootindex = 0;
- else if (disk->info.bootIndex)
- bootindex = disk->info.bootIndex;
+ boot[def->os.nBootDevs] = '\0';
- if (withDeviceArg) {
- if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
- virCommandAddArg(cmd, "-global");
- virCommandAddArgFormat(cmd, "isa-fdc.drive%c=drive-%s",
- disk->info.addr.drive.unit
- ? 'B' : 'A',
- disk->info.alias);
+ virBufferAsprintf(&boot_buf, "%s", boot);
+ boot_nparams++;
+ }
- if (bootindex) {
- virCommandAddArg(cmd, "-global");
- virCommandAddArgFormat(cmd, "isa-fdc.bootindex%c=%d",
- disk->info.addr.drive.unit
- ? 'B' : 'A',
- bootindex);
- }
- } else {
- virCommandAddArg(cmd, "-device");
+ if (def->os.bootmenu) {
+ if (qemuCapsGet(caps, QEMU_CAPS_BOOT_MENU)) {
+ if (boot_nparams++)
+ virBufferAddChar(&boot_buf, ',');
- if (!(optstr = qemuBuildDriveDevStr(def, disk, bootindex,
- caps)))
- goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
- }
+ if (def->os.bootmenu == VIR_DOMAIN_BOOT_MENU_ENABLED)
+ virBufferAsprintf(&boot_buf, "menu=on");
+ else
+ virBufferAsprintf(&boot_buf, "menu=off");
+ } else {
+ /* We cannot emit an error when bootmenu is enabled but
+ * unsupported because of backward compatibility */
+ VIR_WARN("bootmenu is enabled but not "
+ "supported by this QEMU binary");
}
}
- } else {
- for (i = 0 ; i < def->ndisks ; i++) {
- char dev[NAME_MAX];
- char *file;
- const char *fmt;
- virDomainDiskDefPtr disk = def->disks[i];
- if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) &&
- (disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) {
+ if (def->os.bios.rt_set) {
+ if (!qemuCapsGet(caps, QEMU_CAPS_REBOOT_TIMEOUT)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("tray status 'open' is invalid for "
- "block type disk"));
+ _("reboot timeout is not supported "
+ "by this QEMU binary"));
goto error;
}
- if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
- virCommandAddArg(cmd, "-usbdevice");
- virCommandAddArgFormat(cmd, "disk:%s", disk->src);
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported usb disk type for '%s'"),
- disk->src);
- goto error;
- }
- continue;
- }
+ if (boot_nparams++)
+ virBufferAddChar(&boot_buf, ',');
- if (STREQ(disk->dst, "hdc") &&
- disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
- if (disk->src) {
- snprintf(dev, NAME_MAX, "-%s", "cdrom");
- } else {
- continue;
- }
- } else {
- if (STRPREFIX(disk->dst, "hd") ||
- STRPREFIX(disk->dst, "fd")) {
- snprintf(dev, NAME_MAX, "-%s", disk->dst);
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported disk type '%s'"), disk->dst);
- goto error;
- }
- }
+ virBufferAsprintf(&boot_buf,
+ "reboot-timeout=%d",
+ def->os.bios.rt_delay);
+ }
- if (disk->type == VIR_DOMAIN_DISK_TYPE_DIR) {
- /* QEMU only supports magic FAT format for now */
- if (disk->format > 0 && disk->format != VIR_STORAGE_FILE_FAT) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unsupported disk driver type for '%s'"),
- virStorageFileFormatTypeToString(disk->format));
- goto error;
- }
- if (!disk->readonly) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot create virtual FAT disks in read-write mode"));
- goto error;
- }
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)
- fmt = "fat:floppy:%s";
- else
- fmt = "fat:%s";
+ if (boot_nparams > 0) {
+ virCommandAddArg(cmd, "-boot");
- if (virAsprintf(&file, fmt, disk->src) < 0) {
- goto no_memory;
- }
- } else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) {
- switch (disk->protocol) {
- case VIR_DOMAIN_DISK_PROTOCOL_NBD:
- if (disk->nhosts != 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("NBD accepts only one host"));
- goto error;
- }
- if (virAsprintf(&file, "nbd:%s:%s,", disk->hosts->name,
- disk->hosts->port) < 0) {
- goto no_memory;
- }
- break;
- case VIR_DOMAIN_DISK_PROTOCOL_RBD:
- {
- virBuffer opt = VIR_BUFFER_INITIALIZER;
- if (qemuBuildRBDString(conn, disk, &opt) < 0)
- goto error;
- if (virBufferError(&opt)) {
- virReportOOMError();
- goto error;
- }
- file = virBufferContentAndReset(&opt);
- }
- break;
- case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
- if (disk->nhosts == 0) {
- if (virAsprintf(&file, "sheepdog:%s,", disk->src) < 0) {
- goto no_memory;
- }
- } else {
- /* only one host is supported now */
- if (virAsprintf(&file, "sheepdog:%s:%s:%s,",
- disk->hosts->name, disk->hosts->port,
- disk->src) < 0) {
- goto no_memory;
- }
- }
- break;
- }
+ if (boot_nparams < 2 || emitBootindex) {
+ virCommandAddArgBuffer(cmd, &boot_buf);
} else {
- if (!(file = strdup(disk->src))) {
- goto no_memory;
- }
+ virCommandAddArgFormat(cmd,
+ "order=%s",
+ virBufferContentAndReset(&boot_buf));
}
-
- /* Don't start with source if the tray is open for
- * CDROM and Floppy device.
- */
- if (!((disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY ||
- disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) &&
- disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN))
- virCommandAddArgList(cmd, dev, file, NULL);
- VIR_FREE(file);
}
- }
-
- if (qemuCapsGet(caps, QEMU_CAPS_FSDEV)) {
- for (i = 0 ; i < def->nfss ; i++) {
- char *optstr;
- virDomainFSDefPtr fs = def->fss[i];
-
- virCommandAddArg(cmd, "-fsdev");
- if (!(optstr = qemuBuildFSStr(fs, caps)))
- goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
- virCommandAddArg(cmd, "-device");
- if (!(optstr = qemuBuildFSDevStr(fs, caps)))
- goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
- }
+ if (def->os.kernel)
+ virCommandAddArgList(cmd, "-kernel", def->os.kernel, NULL);
+ if (def->os.initrd)
+ virCommandAddArgList(cmd, "-initrd", def->os.initrd, NULL);
+ if (def->os.cmdline)
+ virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);
} else {
- if (def->nfss) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("filesystem passthrough not supported by this QEMU"));
- goto error;
- }
+ virCommandAddArgList(cmd, "-bootloader", def->os.bootloader, NULL);
}
- if (!def->nnets) {
- /* If we have -device, then we set -nodefault already */
- if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE))
- virCommandAddArgList(cmd, "-net", "none", NULL);
- } else {
- int bootNet = 0;
+ for (i = 0 ; i < def->ndisks ; i++) {
+ virDomainDiskDefPtr disk = def->disks[i];
- if (emitBootindex) {
- /* convert <boot dev='network'/> to bootindex since we didn't emit
- * -boot n
- */
- for (i = 0 ; i < def->os.nBootDevs ; i++) {
- if (def->os.bootDevs[i] == VIR_DOMAIN_BOOT_NET) {
- bootNet = i + 1;
- break;
- }
- }
+ if (disk->driverName != NULL &&
+ !STREQ(disk->driverName, "qemu")) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported driver name '%s' for disk '%s'"),
+ disk->driverName, disk->src);
+ goto error;
}
+ }
- for (i = 0 ; i < def->nnets ; i++) {
- virDomainNetDefPtr net = def->nets[i];
- char *nic, *host;
- char tapfd_name[50] = "";
- char vhostfd_name[50] = "";
- int vlan;
- int bootindex = bootNet;
- int actualType;
-
- bootNet = 0;
- if (!bootindex)
- bootindex = net->info.bootIndex;
+ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ for (j = 0; j < ARRAY_CARDINALITY(contOrder); j++) {
+ for (i = 0; i < def->ncontrollers; i++) {
+ virDomainControllerDefPtr cont = def->controllers[i];
- /* VLANs are not used with -netdev, so don't record them */
- if (qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
- qemuCapsGet(caps, QEMU_CAPS_DEVICE))
- vlan = -1;
- else
- vlan = i;
+ if (cont->type != contOrder[j])
+ continue;
- /* If appropriate, grab a physical device from the configured
- * network's pool of devices, or resolve bridge device name
- * to the one defined in the network definition.
- */
- if (networkAllocateActualDevice(net) < 0)
- goto error;
+ /* Also, skip USB controllers with type none.*/
+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
+ usbcontroller = -1; /* mark we don't want a controller */
+ continue;
+ }
- actualType = virDomainNetGetActualType(net);
- if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
- if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
- virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net);
- virDomainHostdevDefPtr found;
- /* For a network with <forward mode='hostdev'>, there is a need to
- * add the newly minted hostdev to the hostdevs array.
- */
- if (qemuAssignDeviceHostdevAlias(def, hostdev,
- (def->nhostdevs-1)) < 0) {
+ /* Only recent QEMU implements a SATA (AHCI) controller */
+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
+ if (!qemuCapsGet(caps, QEMU_CAPS_ICH9_AHCI)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("SATA is not supported with this "
+ "QEMU binary"));
goto error;
- }
+ } else {
+ char *devstr;
- if (virDomainHostdevFind(def, hostdev, &found) < 0) {
- if (virDomainHostdevInsert(def, hostdev) < 0) {
- virReportOOMError();
- goto error;
- }
- if (qemuPrepareHostdevPCIDevices(driver, def->name, def->uuid,
- &hostdev, 1) < 0) {
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildControllerDevStr(def, cont,
+ caps, NULL)))
goto error;
- }
+
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
}
- else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("PCI device %04x:%02x:%02x.%x "
- "allocated from network %s is already "
- "in use by domain %s"),
- hostdev->source.subsys.u.pci.domain,
- hostdev->source.subsys.u.pci.bus,
- hostdev->source.subsys.u.pci.slot,
- hostdev->source.subsys.u.pci.function,
- net->data.network.name,
- def->name);
+ } else if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+ cont->model == -1 &&
+ !qemuCapsGet(caps, QEMU_CAPS_PIIX3_USB_UHCI)) {
+ if (usblegacy) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Multiple legacy USB controllers are "
+ "not supported"));
goto error;
}
+ usblegacy = true;
+ } else {
+ virCommandAddArg(cmd, "-device");
+
+ char *devstr;
+ if (!(devstr = qemuBuildControllerDevStr(def, cont, caps,
+ &usbcontroller)))
+ goto error;
+
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
}
- continue;
}
+ }
+ }
- if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
- actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
- /*
- * If type='bridge' then we attempt to allocate the tap fd here only if
- * running under a privilged user or -netdev bridge option is not
- * supported.
- */
- if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
- driver->privileged ||
- (!qemuCapsGet(caps, QEMU_CAPS_NETDEV_BRIDGE))) {
- int tapfd = qemuNetworkIfaceConnect(def, conn, driver, net,
- caps);
- if (tapfd < 0)
- goto error;
+ if (usbcontroller == 0)
+ virCommandAddArg(cmd, "-usb");
- last_good_net = i;
- virCommandTransferFD(cmd, tapfd);
+ for (i = 0 ; i < def->nhubs ; i++) {
+ virDomainHubDefPtr hub = def->hubs[i];
+ char *optstr;
- if (snprintf(tapfd_name, sizeof(tapfd_name), "%d",
- tapfd) >= sizeof(tapfd_name))
- goto no_memory;
- }
- } else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
- int tapfd = qemuPhysIfaceConnect(def, driver, net,
- caps, vmop);
- if (tapfd < 0)
- goto error;
+ virCommandAddArg(cmd, "-device");
+ if (!(optstr = qemuBuildHubDevStr(hub, caps)))
+ goto error;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+ }
- last_good_net = i;
- virCommandTransferFD(cmd, tapfd);
+ /* If QEMU supports -drive param instead of old -hda, -hdb, -cdrom .. */
+ if (qemuCapsGet(caps, QEMU_CAPS_DRIVE)) {
+ int bootCD = 0, bootFloppy = 0, bootDisk = 0;
- if (snprintf(tapfd_name, sizeof(tapfd_name), "%d",
- tapfd) >= sizeof(tapfd_name))
- goto no_memory;
+ if ((qemuCapsGet(caps, QEMU_CAPS_DRIVE_BOOT) || emitBootindex)) {
+ /* bootDevs will get translated into either bootindex=N or boot=on
+ * depending on what qemu supports */
+ for (i = 0 ; i < def->os.nBootDevs ; i++) {
+ switch (def->os.bootDevs[i]) {
+ case VIR_DOMAIN_BOOT_CDROM:
+ bootCD = i + 1;
+ break;
+ case VIR_DOMAIN_BOOT_FLOPPY:
+ bootFloppy = i + 1;
+ break;
+ case VIR_DOMAIN_BOOT_DISK:
+ bootDisk = i + 1;
+ break;
+ }
}
+ }
- if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
- actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
- actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
- /* Attempt to use vhost-net mode for these types of
- network device */
- int vhostfd;
+ for (i = 0 ; i < def->ndisks ; i++) {
+ char *optstr;
+ int bootindex = 0;
+ virDomainDiskDefPtr disk = def->disks[i];
+ int withDeviceArg = 0;
+ bool deviceFlagMasked = false;
- if (qemuOpenVhostNet(def, net, caps, &vhostfd) < 0)
+ /* Unless we have -device, then USB disks need special
+ handling */
+ if ((disk->bus == VIR_DOMAIN_DISK_BUS_USB) &&
+ !qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
+ virCommandAddArg(cmd, "-usbdevice");
+ virCommandAddArgFormat(cmd, "disk:%s", disk->src);
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported usb disk type for '%s'"),
+ disk->src);
goto error;
- if (vhostfd >= 0) {
- virCommandTransferFD(cmd, vhostfd);
-
- if (snprintf(vhostfd_name, sizeof(vhostfd_name), "%d",
- vhostfd) >= sizeof(vhostfd_name))
- goto no_memory;
}
+ continue;
}
- /* Possible combinations:
- *
- * 1. Old way: -net nic,model=e1000,vlan=1 -net tap,vlan=1
- * 2. Semi-new: -device e1000,vlan=1 -net tap,vlan=1
- * 3. Best way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
- *
- * NB, no support for -netdev without use of -device
- */
- if (qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
- qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virCommandAddArg(cmd, "-netdev");
- if (!(host = qemuBuildHostNetStr(net, driver, caps,
- ',', vlan, tapfd_name,
- vhostfd_name)))
- goto error;
- virCommandAddArg(cmd, host);
- VIR_FREE(host);
+
+ switch (disk->device) {
+ case VIR_DOMAIN_DISK_DEVICE_CDROM:
+ bootindex = bootCD;
+ bootCD = 0;
+ break;
+ case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
+ bootindex = bootFloppy;
+ bootFloppy = 0;
+ break;
+ case VIR_DOMAIN_DISK_DEVICE_DISK:
+ case VIR_DOMAIN_DISK_DEVICE_LUN:
+ bootindex = bootDisk;
+ bootDisk = 0;
+ break;
}
+
+ virCommandAddArg(cmd, "-drive");
+
+ /* Unfortunately it is not possible to use
+ -device for floppies, or Xen paravirt
+ devices. Fortunately, those don't need
+ static PCI addresses, so we don't really
+ care that we can't use -device */
if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virCommandAddArg(cmd, "-device");
- nic = qemuBuildNicDevStr(net, vlan, bootindex, caps);
- if (!nic)
- goto error;
- virCommandAddArg(cmd, nic);
- VIR_FREE(nic);
- } else {
- virCommandAddArg(cmd, "-net");
- if (!(nic = qemuBuildNicStr(net, "nic,", vlan)))
- goto error;
- virCommandAddArg(cmd, nic);
- VIR_FREE(nic);
- }
- if (!(qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
- qemuCapsGet(caps, QEMU_CAPS_DEVICE))) {
- virCommandAddArg(cmd, "-net");
- if (!(host = qemuBuildHostNetStr(net, driver, caps,
- ',', vlan, tapfd_name,
- vhostfd_name)))
- goto error;
- virCommandAddArg(cmd, host);
- VIR_FREE(host);
+ if (disk->bus != VIR_DOMAIN_DISK_BUS_XEN) {
+ withDeviceArg = 1;
+ } else {
+ qemuCapsClear(caps, QEMU_CAPS_DEVICE);
+ deviceFlagMasked = true;
+ }
}
- }
- }
+ optstr = qemuBuildDriveStr(conn, disk,
+ emitBootindex ? false : !!bootindex,
+ caps);
+ if (deviceFlagMasked)
+ qemuCapsSet(caps, QEMU_CAPS_DEVICE);
+ if (!optstr)
+ goto error;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+
+ if (!emitBootindex)
+ bootindex = 0;
+ else if (disk->info.bootIndex)
+ bootindex = disk->info.bootIndex;
- if (def->nsmartcards) {
- /* -device usb-ccid was already emitted along with other
- * controllers. For now, qemu handles only one smartcard. */
- virDomainSmartcardDefPtr smartcard = def->smartcards[0];
- char *devstr;
- virBuffer opt = VIR_BUFFER_INITIALIZER;
- const char *database;
+ if (withDeviceArg) {
+ if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
+ virCommandAddArg(cmd, "-global");
+ virCommandAddArgFormat(cmd, "isa-fdc.drive%c=drive-%s",
+ disk->info.addr.drive.unit
+ ? 'B' : 'A',
+ disk->info.alias);
- if (def->nsmartcards > 1 ||
- smartcard->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID ||
- smartcard->info.addr.ccid.controller != 0 ||
- smartcard->info.addr.ccid.slot != 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("this QEMU binary lacks multiple smartcard "
- "support"));
- virBufferFreeAndReset(&opt);
- goto error;
- }
+ if (bootindex) {
+ virCommandAddArg(cmd, "-global");
+ virCommandAddArgFormat(cmd, "isa-fdc.bootindex%c=%d",
+ disk->info.addr.drive.unit
+ ? 'B' : 'A',
+ bootindex);
+ }
+ } else {
+ virCommandAddArg(cmd, "-device");
- switch (smartcard->type) {
- case VIR_DOMAIN_SMARTCARD_TYPE_HOST:
- if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
- !qemuCapsGet(caps, QEMU_CAPS_CCID_EMULATED)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("this QEMU binary lacks smartcard host "
- "mode support"));
- goto error;
+ if (!(optstr = qemuBuildDriveDevStr(def, disk, bootindex,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+ }
}
+ }
+ } else {
+ for (i = 0 ; i < def->ndisks ; i++) {
+ char dev[NAME_MAX];
+ char *file;
+ const char *fmt;
+ virDomainDiskDefPtr disk = def->disks[i];
- virBufferAddLit(&opt, "ccid-card-emulated,backend=nss-emulated");
- break;
-
- case VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES:
- if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
- !qemuCapsGet(caps, QEMU_CAPS_CCID_EMULATED)) {
+ if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) &&
+ (disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("this QEMU binary lacks smartcard host "
- "mode support"));
+ _("tray status 'open' is invalid for "
+ "block type disk"));
goto error;
}
- virBufferAddLit(&opt, "ccid-card-emulated,backend=certificates");
- for (j = 0; j < VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES; j++) {
- if (strchr(smartcard->data.cert.file[j], ',')) {
- virBufferFreeAndReset(&opt);
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("invalid certificate name: %s"),
- smartcard->data.cert.file[j]);
+ if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
+ virCommandAddArg(cmd, "-usbdevice");
+ virCommandAddArgFormat(cmd, "disk:%s", disk->src);
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported usb disk type for '%s'"),
+ disk->src);
goto error;
}
- virBufferAsprintf(&opt, ",cert%d=%s", j + 1,
- smartcard->data.cert.file[j]);
+ continue;
}
- if (smartcard->data.cert.database) {
- if (strchr(smartcard->data.cert.database, ',')) {
- virBufferFreeAndReset(&opt);
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("invalid database name: %s"),
- smartcard->data.cert.database);
- goto error;
+
+ if (STREQ(disk->dst, "hdc") &&
+ disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
+ if (disk->src) {
+ snprintf(dev, NAME_MAX, "-%s", "cdrom");
+ } else {
+ continue;
}
- database = smartcard->data.cert.database;
} else {
- database = VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE;
+ if (STRPREFIX(disk->dst, "hd") ||
+ STRPREFIX(disk->dst, "fd")) {
+ snprintf(dev, NAME_MAX, "-%s", disk->dst);
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported disk type '%s'"), disk->dst);
+ goto error;
+ }
}
- virBufferAsprintf(&opt, ",database=%s", database);
- break;
- case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH:
- if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
- !qemuCapsGet(caps, QEMU_CAPS_CCID_PASSTHRU)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("this QEMU binary lacks smartcard "
- "passthrough mode support"));
- goto error;
- }
+ if (disk->type == VIR_DOMAIN_DISK_TYPE_DIR) {
+ /* QEMU only supports magic FAT format for now */
+ if (disk->format > 0 && disk->format != VIR_STORAGE_FILE_FAT) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unsupported disk driver type for '%s'"),
+ virStorageFileFormatTypeToString(disk->format));
+ goto error;
+ }
+ if (!disk->readonly) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot create virtual FAT disks in read-write mode"));
+ goto error;
+ }
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)
+ fmt = "fat:floppy:%s";
+ else
+ fmt = "fat:%s";
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(&smartcard->data.passthru,
- smartcard->info.alias,
- caps))) {
- virBufferFreeAndReset(&opt);
- goto error;
+ if (virAsprintf(&file, fmt, disk->src) < 0) {
+ goto no_memory;
+ }
+ } else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) {
+ switch (disk->protocol) {
+ case VIR_DOMAIN_DISK_PROTOCOL_NBD:
+ if (disk->nhosts != 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("NBD accepts only one host"));
+ goto error;
+ }
+ if (virAsprintf(&file, "nbd:%s:%s,", disk->hosts->name,
+ disk->hosts->port) < 0) {
+ goto no_memory;
+ }
+ break;
+ case VIR_DOMAIN_DISK_PROTOCOL_RBD:
+ {
+ virBuffer opt = VIR_BUFFER_INITIALIZER;
+ if (qemuBuildRBDString(conn, disk, &opt) < 0)
+ goto error;
+ if (virBufferError(&opt)) {
+ virReportOOMError();
+ goto error;
+ }
+ file = virBufferContentAndReset(&opt);
+ }
+ break;
+ case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
+ if (disk->nhosts == 0) {
+ if (virAsprintf(&file, "sheepdog:%s,", disk->src) < 0) {
+ goto no_memory;
+ }
+ } else {
+ /* only one host is supported now */
+ if (virAsprintf(&file, "sheepdog:%s:%s:%s,",
+ disk->hosts->name, disk->hosts->port,
+ disk->src) < 0) {
+ goto no_memory;
+ }
+ }
+ break;
+ }
+ } else {
+ if (!(file = strdup(disk->src))) {
+ goto no_memory;
+ }
}
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
-
- virBufferAsprintf(&opt, "ccid-card-passthru,chardev=char%s",
- smartcard->info.alias);
- break;
- default:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected smartcard type %d"),
- smartcard->type);
- virBufferFreeAndReset(&opt);
- goto error;
+ /* Don't start with source if the tray is open for
+ * CDROM and Floppy device.
+ */
+ if (!((disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY ||
+ disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) &&
+ disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN))
+ virCommandAddArgList(cmd, dev, file, NULL);
+ VIR_FREE(file);
}
- virCommandAddArg(cmd, "-device");
- virBufferAsprintf(&opt, ",id=%s,bus=ccid0.0", smartcard->info.alias);
- virCommandAddArgBuffer(cmd, &opt);
}
- if (!def->nserials) {
- /* If we have -device, then we set -nodefault already */
- if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE))
- virCommandAddArgList(cmd, "-serial", "none", NULL);
- } else {
- for (i = 0 ; i < def->nserials ; i++) {
- virDomainChrDefPtr serial = def->serials[i];
- char *devstr;
-
- /* Use -chardev with -device if they are available */
- if (qemuCapsGet(caps, QEMU_CAPS_CHARDEV) &&
- qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(&serial->source,
- serial->info.alias,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ if (qemuCapsGet(caps, QEMU_CAPS_FSDEV)) {
+ for (i = 0 ; i < def->nfss ; i++) {
+ char *optstr;
+ virDomainFSDefPtr fs = def->fss[i];
- virCommandAddArg(cmd, "-device");
- if (!(devstr = qemuBuildChrDeviceStr(serial, caps,
- def->os.arch,
- def->os.machine)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- } else {
- virCommandAddArg(cmd, "-serial");
- if (!(devstr = qemuBuildChrArgStr(&serial->source, NULL)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- }
+ virCommandAddArg(cmd, "-fsdev");
+ if (!(optstr = qemuBuildFSStr(fs, caps)))
+ goto error;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+
+ virCommandAddArg(cmd, "-device");
+ if (!(optstr = qemuBuildFSDevStr(fs, caps)))
+ goto error;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+ }
+ } else {
+ if (def->nfss) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("filesystem passthrough not supported by this QEMU"));
+ goto error;
}
}
- if (!def->nparallels) {
+ if (!def->nnets) {
/* If we have -device, then we set -nodefault already */
if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE))
- virCommandAddArgList(cmd, "-parallel", "none", NULL);
+ virCommandAddArgList(cmd, "-net", "none", NULL);
} else {
- for (i = 0 ; i < def->nparallels ; i++) {
- virDomainChrDefPtr parallel = def->parallels[i];
- char *devstr;
-
- /* Use -chardev with -device if they are available */
- if (qemuCapsGet(caps, QEMU_CAPS_CHARDEV) &&
- qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(¶llel->source,
- parallel->info.alias,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ int bootNet = 0;
- virCommandAddArg(cmd, "-device");
- virCommandAddArgFormat(cmd, "isa-parallel,chardev=char%s,id=%s",
- parallel->info.alias,
- parallel->info.alias);
- } else {
- virCommandAddArg(cmd, "-parallel");
- if (!(devstr = qemuBuildChrArgStr(¶llel->source, NULL)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ if (emitBootindex) {
+ /* convert <boot dev='network'/> to bootindex since we didn't emit
+ * -boot n
+ */
+ for (i = 0 ; i < def->os.nBootDevs ; i++) {
+ if (def->os.bootDevs[i] == VIR_DOMAIN_BOOT_NET) {
+ bootNet = i + 1;
+ break;
+ }
}
}
- }
-
- for (i = 0 ; i < def->nchannels ; i++) {
- virDomainChrDefPtr channel = def->channels[i];
- char *devstr;
- char *addr;
- int port;
- switch (channel->targetType) {
- case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
- if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
- !qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("guestfwd requires QEMU to support -chardev & -device"));
- goto error;
- }
+ for (i = 0 ; i < def->nnets ; i++) {
+ virDomainNetDefPtr net = def->nets[i];
+ char *nic, *host;
+ char tapfd_name[50] = "";
+ char vhostfd_name[50] = "";
+ int vlan;
+ int bootindex = bootNet;
+ int actualType;
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(&channel->source,
- channel->info.alias,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ bootNet = 0;
+ if (!bootindex)
+ bootindex = net->info.bootIndex;
- addr = virSocketAddrFormat(channel->target.addr);
- if (!addr)
- goto error;
- port = virSocketAddrGetPort(channel->target.addr);
+ /* VLANs are not used with -netdev, so don't record them */
+ if (qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
+ qemuCapsGet(caps, QEMU_CAPS_DEVICE))
+ vlan = -1;
+ else
+ vlan = i;
- virCommandAddArg(cmd, "-netdev");
- virCommandAddArgFormat(cmd,
- "user,guestfwd=tcp:%s:%i,chardev=char%s,id=user-%s",
- addr, port, channel->info.alias,
- channel->info.alias);
- VIR_FREE(addr);
- break;
+ /* If appropriate, grab a physical device from the configured
+ * network's pool of devices, or resolve bridge device name
+ * to the one defined in the network definition.
+ */
+ if (networkAllocateActualDevice(net) < 0)
+ goto error;
- case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
- if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("virtio channel requires QEMU to support -device"));
- goto error;
- }
+ actualType = virDomainNetGetActualType(net);
+ if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
+ virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net);
+ virDomainHostdevDefPtr found;
+ /* For a network with <forward mode='hostdev'>, there is a need to
+ * add the newly minted hostdev to the hostdevs array.
+ */
+ if (qemuAssignDeviceHostdevAlias(def, hostdev,
+ (def->nhostdevs-1)) < 0) {
+ goto error;
+ }
- if (qemuCapsGet(caps, QEMU_CAPS_DEVICE_SPICEVMC) &&
- channel->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) {
- /* spicevmc was originally introduced via a -device
- * with a backend internal to qemu; although we prefer
- * the newer -chardev interface. */
- ;
- } else {
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(&channel->source,
- channel->info.alias,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ if (virDomainHostdevFind(def, hostdev, &found) < 0) {
+ if (virDomainHostdevInsert(def, hostdev) < 0) {
+ virReportOOMError();
+ goto error;
+ }
+ if (qemuPrepareHostdevPCIDevices(driver, def->name, def->uuid,
+ &hostdev, 1) < 0) {
+ goto error;
+ }
+ }
+ else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("PCI device %04x:%02x:%02x.%x "
+ "allocated from network %s is already "
+ "in use by domain %s"),
+ hostdev->source.subsys.u.pci.domain,
+ hostdev->source.subsys.u.pci.bus,
+ hostdev->source.subsys.u.pci.slot,
+ hostdev->source.subsys.u.pci.function,
+ net->data.network.name,
+ def->name);
+ goto error;
+ }
+ }
+ continue;
}
- virCommandAddArg(cmd, "-device");
- if (!(devstr = qemuBuildVirtioSerialPortDevStr(channel,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- break;
- }
- }
-
- /* Explicit console devices */
- for (i = 0 ; i < def->nconsoles ; i++) {
- virDomainChrDefPtr console = def->consoles[i];
- char *devstr;
+ if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
+ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
+ /*
+ * If type='bridge' then we attempt to allocate the tap fd here only if
+ * running under a privilged user or -netdev bridge option is not
+ * supported.
+ */
+ if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
+ driver->privileged ||
+ (!qemuCapsGet(caps, QEMU_CAPS_NETDEV_BRIDGE))) {
+ int tapfd = qemuNetworkIfaceConnect(def, conn, driver, net,
+ caps);
+ if (tapfd < 0)
+ goto error;
- switch (console->targetType) {
- case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
- if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("virtio channel requires QEMU to support -device"));
- goto error;
- }
+ last_good_net = i;
+ virCommandTransferFD(cmd, tapfd);
- virCommandAddArg(cmd, "-chardev");
- if (!(devstr = qemuBuildChrChardevStr(&console->source,
- console->info.alias,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ if (snprintf(tapfd_name, sizeof(tapfd_name), "%d",
+ tapfd) >= sizeof(tapfd_name))
+ goto no_memory;
+ }
+ } else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
+ int tapfd = qemuPhysIfaceConnect(def, driver, net,
+ caps, vmop);
+ if (tapfd < 0)
+ goto error;
- virCommandAddArg(cmd, "-device");
- if (!(devstr = qemuBuildVirtioSerialPortDevStr(console,
- caps)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
- break;
+ last_good_net = i;
+ virCommandTransferFD(cmd, tapfd);
- case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL:
- break;
+ if (snprintf(tapfd_name, sizeof(tapfd_name), "%d",
+ tapfd) >= sizeof(tapfd_name))
+ goto no_memory;
+ }
- default:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported console target type %s"),
- NULLSTR(virDomainChrConsoleTargetTypeToString(console->targetType)));
- goto error;
- }
- }
+ if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
+ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+ actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
+ /* Attempt to use vhost-net mode for these types of
+ network device */
+ int vhostfd;
- for (i = 0 ; i < def->ninputs ; i++) {
- virDomainInputDefPtr input = def->inputs[i];
+ if (qemuOpenVhostNet(def, net, caps, &vhostfd) < 0)
+ goto error;
+ if (vhostfd >= 0) {
+ virCommandTransferFD(cmd, vhostfd);
- if (input->bus == VIR_DOMAIN_INPUT_BUS_USB) {
+ if (snprintf(vhostfd_name, sizeof(vhostfd_name), "%d",
+ vhostfd) >= sizeof(vhostfd_name))
+ goto no_memory;
+ }
+ }
+ /* Possible combinations:
+ *
+ * 1. Old way: -net nic,model=e1000,vlan=1 -net tap,vlan=1
+ * 2. Semi-new: -device e1000,vlan=1 -net tap,vlan=1
+ * 3. Best way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
+ *
+ * NB, no support for -netdev without use of -device
+ */
+ if (qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
+ qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virCommandAddArg(cmd, "-netdev");
+ if (!(host = qemuBuildHostNetStr(net, driver, caps,
+ ',', vlan, tapfd_name,
+ vhostfd_name)))
+ goto error;
+ virCommandAddArg(cmd, host);
+ VIR_FREE(host);
+ }
if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
- char *optstr;
virCommandAddArg(cmd, "-device");
- if (!(optstr = qemuBuildUSBInputDevStr(input, caps)))
+ nic = qemuBuildNicDevStr(net, vlan, bootindex, caps);
+ if (!nic)
goto error;
- virCommandAddArg(cmd, optstr);
- VIR_FREE(optstr);
+ virCommandAddArg(cmd, nic);
+ VIR_FREE(nic);
} else {
- virCommandAddArgList(cmd, "-usbdevice",
- input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE
- ? "mouse" : "tablet", NULL);
+ virCommandAddArg(cmd, "-net");
+ if (!(nic = qemuBuildNicStr(net, "nic,", vlan)))
+ goto error;
+ virCommandAddArg(cmd, nic);
+ VIR_FREE(nic);
+ }
+ if (!(qemuCapsGet(caps, QEMU_CAPS_NETDEV) &&
+ qemuCapsGet(caps, QEMU_CAPS_DEVICE))) {
+ virCommandAddArg(cmd, "-net");
+ if (!(host = qemuBuildHostNetStr(net, driver, caps,
+ ',', vlan, tapfd_name,
+ vhostfd_name)))
+ goto error;
+ virCommandAddArg(cmd, host);
+ VIR_FREE(host);
}
}
}
- if (def->ngraphics > 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("only 1 graphics device is supported"));
- goto error;
- }
-
- if ((def->ngraphics == 1) &&
- def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
+ if (def->nsmartcards) {
+ /* -device usb-ccid was already emitted along with other
+ * controllers. For now, qemu handles only one smartcard. */
+ virDomainSmartcardDefPtr smartcard = def->smartcards[0];
+ char *devstr;
virBuffer opt = VIR_BUFFER_INITIALIZER;
+ const char *database;
- if (!qemuCapsGet(caps, QEMU_CAPS_VNC)) {
+ if (def->nsmartcards > 1 ||
+ smartcard->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID ||
+ smartcard->info.addr.ccid.controller != 0 ||
+ smartcard->info.addr.ccid.slot != 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("vnc graphics are not supported with this QEMU"));
+ _("this QEMU binary lacks multiple smartcard "
+ "support"));
+ virBufferFreeAndReset(&opt);
goto error;
}
- if (def->graphics[0]->data.vnc.socket ||
- driver->vncAutoUnixSocket) {
-
- if (!def->graphics[0]->data.vnc.socket &&
- virAsprintf(&def->graphics[0]->data.vnc.socket,
- "%s/%s.vnc", driver->libDir, def->name) == -1) {
- goto no_memory;
+ switch (smartcard->type) {
+ case VIR_DOMAIN_SMARTCARD_TYPE_HOST:
+ if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
+ !qemuCapsGet(caps, QEMU_CAPS_CCID_EMULATED)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("this QEMU binary lacks smartcard host "
+ "mode support"));
+ goto error;
}
- virBufferAsprintf(&opt, "unix:%s",
- def->graphics[0]->data.vnc.socket);
-
- } else if (qemuCapsGet(caps, QEMU_CAPS_VNC_COLON)) {
- const char *listenNetwork;
- const char *listenAddr = NULL;
- char *netAddr = NULL;
- bool escapeAddr;
- int ret;
+ virBufferAddLit(&opt, "ccid-card-emulated,backend=nss-emulated");
+ break;
- switch (virDomainGraphicsListenGetType(def->graphics[0], 0)) {
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
- listenAddr = virDomainGraphicsListenGetAddress(def->graphics[0], 0);
- break;
+ case VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES:
+ if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
+ !qemuCapsGet(caps, QEMU_CAPS_CCID_EMULATED)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("this QEMU binary lacks smartcard host "
+ "mode support"));
+ goto error;
+ }
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
- listenNetwork = virDomainGraphicsListenGetNetwork(def->graphics[0], 0);
- if (!listenNetwork)
- break;
- ret = networkGetNetworkAddress(listenNetwork, &netAddr);
- if (ret <= -2) {
+ virBufferAddLit(&opt, "ccid-card-emulated,backend=certificates");
+ for (j = 0; j < VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES; j++) {
+ if (strchr(smartcard->data.cert.file[j], ',')) {
+ virBufferFreeAndReset(&opt);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("network-based listen not possible, "
- "network driver not present"));
+ _("invalid certificate name: %s"),
+ smartcard->data.cert.file[j]);
goto error;
}
- if (ret < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("listen network '%s' had no usable address"),
- listenNetwork);
+ virBufferAsprintf(&opt, ",cert%d=%s", j + 1,
+ smartcard->data.cert.file[j]);
+ }
+ if (smartcard->data.cert.database) {
+ if (strchr(smartcard->data.cert.database, ',')) {
+ virBufferFreeAndReset(&opt);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("invalid database name: %s"),
+ smartcard->data.cert.database);
goto error;
}
- listenAddr = netAddr;
- /* store the address we found in the <graphics> element so it will
- * show up in status. */
- if (virDomainGraphicsListenSetAddress(def->graphics[0], 0,
- listenAddr, -1, false) < 0)
- goto error;
- break;
+ database = smartcard->data.cert.database;
+ } else {
+ database = VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE;
}
+ virBufferAsprintf(&opt, ",database=%s", database);
+ break;
- if (!listenAddr)
- listenAddr = driver->vncListen;
-
- escapeAddr = strchr(listenAddr, ':') != NULL;
- if (escapeAddr)
- virBufferAsprintf(&opt, "[%s]", listenAddr);
- else
- virBufferAdd(&opt, listenAddr, -1);
- virBufferAsprintf(&opt, ":%d",
- def->graphics[0]->data.vnc.port - 5900);
-
- VIR_FREE(netAddr);
- } else {
- virBufferAsprintf(&opt, "%d",
- def->graphics[0]->data.vnc.port - 5900);
- }
-
- if (qemuCapsGet(caps, QEMU_CAPS_VNC_COLON)) {
- if (def->graphics[0]->data.vnc.auth.passwd ||
- driver->vncPassword)
- virBufferAddLit(&opt, ",password");
-
- if (driver->vncTLS) {
- virBufferAddLit(&opt, ",tls");
- if (driver->vncTLSx509verify) {
- virBufferAsprintf(&opt, ",x509verify=%s",
- driver->vncTLSx509certdir);
- } else {
- virBufferAsprintf(&opt, ",x509=%s",
- driver->vncTLSx509certdir);
- }
+ case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH:
+ if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
+ !qemuCapsGet(caps, QEMU_CAPS_CCID_PASSTHRU)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("this QEMU binary lacks smartcard "
+ "passthrough mode support"));
+ goto error;
}
- if (driver->vncSASL) {
- virBufferAddLit(&opt, ",sasl");
-
- if (driver->vncSASLdir)
- virCommandAddEnvPair(cmd, "SASL_CONF_DIR",
- driver->vncSASLdir);
-
- /* TODO: Support ACLs later */
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(&smartcard->data.passthru,
+ smartcard->info.alias,
+ caps))) {
+ virBufferFreeAndReset(&opt);
+ goto error;
}
- }
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
- virCommandAddArg(cmd, "-vnc");
- virCommandAddArgBuffer(cmd, &opt);
- if (def->graphics[0]->data.vnc.keymap) {
- virCommandAddArgList(cmd, "-k", def->graphics[0]->data.vnc.keymap,
- NULL);
- }
+ virBufferAsprintf(&opt, "ccid-card-passthru,chardev=char%s",
+ smartcard->info.alias);
+ break;
- /* Unless user requested it, set the audio backend to none, to
- * prevent it opening the host OS audio devices, since that causes
- * security issues and might not work when using VNC.
- */
- if (driver->vncAllowHostAudio) {
- virCommandAddEnvPass(cmd, "QEMU_AUDIO_DRV");
- } else {
- virCommandAddEnvString(cmd, "QEMU_AUDIO_DRV=none");
- }
- } else if ((def->ngraphics == 1) &&
- def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
- if (qemuCapsGet(caps, QEMU_CAPS_0_10) &&
- !qemuCapsGet(caps, QEMU_CAPS_SDL)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("sdl not supported by '%s'"),
- def->emulator);
+ default:
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected smartcard type %d"),
+ smartcard->type);
+ virBufferFreeAndReset(&opt);
goto error;
}
+ virCommandAddArg(cmd, "-device");
+ virBufferAsprintf(&opt, ",id=%s,bus=ccid0.0", smartcard->info.alias);
+ virCommandAddArgBuffer(cmd, &opt);
+ }
- if (def->graphics[0]->data.sdl.xauth)
- virCommandAddEnvPair(cmd, "XAUTHORITY",
- def->graphics[0]->data.sdl.xauth);
- if (def->graphics[0]->data.sdl.display)
- virCommandAddEnvPair(cmd, "DISPLAY",
- def->graphics[0]->data.sdl.display);
- if (def->graphics[0]->data.sdl.fullscreen)
- virCommandAddArg(cmd, "-full-screen");
+ if (!def->nserials) {
+ /* If we have -device, then we set -nodefault already */
+ if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE))
+ virCommandAddArgList(cmd, "-serial", "none", NULL);
+ } else {
+ for (i = 0 ; i < def->nserials ; i++) {
+ virDomainChrDefPtr serial = def->serials[i];
+ char *devstr;
- /* If using SDL for video, then we should just let it
- * use QEMU's host audio drivers, possibly SDL too
- * User can set these two before starting libvirtd
- */
- virCommandAddEnvPass(cmd, "QEMU_AUDIO_DRV");
- virCommandAddEnvPass(cmd, "SDL_AUDIODRIVER");
+ /* Use -chardev with -device if they are available */
+ if (qemuCapsGet(caps, QEMU_CAPS_CHARDEV) &&
+ qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(&serial->source,
+ serial->info.alias,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildChrDeviceStr(serial, caps,
+ def->os.arch,
+ def->os.machine)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+ } else {
+ virCommandAddArg(cmd, "-serial");
+ if (!(devstr = qemuBuildChrArgStr(&serial->source, NULL)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+ }
+ }
+ }
- /* New QEMU has this flag to let us explicitly ask for
- * SDL graphics. This is better than relying on the
- * default, since the default changes :-( */
- if (qemuCapsGet(caps, QEMU_CAPS_SDL))
- virCommandAddArg(cmd, "-sdl");
+ if (!def->nparallels) {
+ /* If we have -device, then we set -nodefault already */
+ if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE))
+ virCommandAddArgList(cmd, "-parallel", "none", NULL);
+ } else {
+ for (i = 0 ; i < def->nparallels ; i++) {
+ virDomainChrDefPtr parallel = def->parallels[i];
+ char *devstr;
- } else if ((def->ngraphics == 1) &&
- def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
- virBuffer opt = VIR_BUFFER_INITIALIZER;
- const char *listenNetwork;
- const char *listenAddr = NULL;
- char *netAddr = NULL;
- int ret;
- int defaultMode = def->graphics[0]->data.spice.defaultMode;
+ /* Use -chardev with -device if they are available */
+ if (qemuCapsGet(caps, QEMU_CAPS_CHARDEV) &&
+ qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(¶llel->source,
+ parallel->info.alias,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
- if (!qemuCapsGet(caps, QEMU_CAPS_SPICE)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("spice graphics are not supported with this QEMU"));
- goto error;
+ virCommandAddArg(cmd, "-device");
+ virCommandAddArgFormat(cmd, "isa-parallel,chardev=char%s,id=%s",
+ parallel->info.alias,
+ parallel->info.alias);
+ } else {
+ virCommandAddArg(cmd, "-parallel");
+ if (!(devstr = qemuBuildChrArgStr(¶llel->source, NULL)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+ }
}
+ }
- virBufferAsprintf(&opt, "port=%u", def->graphics[0]->data.spice.port);
+ for (i = 0 ; i < def->nchannels ; i++) {
+ virDomainChrDefPtr channel = def->channels[i];
+ char *devstr;
+ char *addr;
+ int port;
- if (def->graphics[0]->data.spice.tlsPort > 0) {
- if (!driver->spiceTLS) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("spice TLS port set in XML configuration,"
- " but TLS is disabled in qemu.conf"));
+ switch (channel->targetType) {
+ case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
+ if (!qemuCapsGet(caps, QEMU_CAPS_CHARDEV) ||
+ !qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("guestfwd requires QEMU to support -chardev & -device"));
goto error;
}
- virBufferAsprintf(&opt, ",tls-port=%u",
- def->graphics[0]->data.spice.tlsPort);
- }
- switch (virDomainGraphicsListenGetType(def->graphics[0], 0)) {
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
- listenAddr = virDomainGraphicsListenGetAddress(def->graphics[0], 0);
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(&channel->source,
+ channel->info.alias,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+
+ addr = virSocketAddrFormat(channel->target.addr);
+ if (!addr)
+ goto error;
+ port = virSocketAddrGetPort(channel->target.addr);
+
+ virCommandAddArg(cmd, "-netdev");
+ virCommandAddArgFormat(cmd,
+ "user,guestfwd=tcp:%s:%i,chardev=char%s,id=user-%s",
+ addr, port, channel->info.alias,
+ channel->info.alias);
+ VIR_FREE(addr);
break;
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
- listenNetwork = virDomainGraphicsListenGetNetwork(def->graphics[0], 0);
- if (!listenNetwork)
- break;
- ret = networkGetNetworkAddress(listenNetwork, &netAddr);
- if (ret <= -2) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("network-based listen not possible, "
- "network driver not present"));
+ case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
+ if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("virtio channel requires QEMU to support -device"));
goto error;
}
- if (ret < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("listen network '%s' had no usable address"),
- listenNetwork);
- goto error;
+
+ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE_SPICEVMC) &&
+ channel->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) {
+ /* spicevmc was originally introduced via a -device
+ * with a backend internal to qemu; although we prefer
+ * the newer -chardev interface. */
+ ;
+ } else {
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(&channel->source,
+ channel->info.alias,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
}
- listenAddr = netAddr;
- /* store the address we found in the <graphics> element so it will
- * show up in status. */
- if (virDomainGraphicsListenSetAddress(def->graphics[0], 0,
- listenAddr, -1, false) < 0)
- goto error;
+
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildVirtioSerialPortDevStr(channel,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
break;
}
+ }
- if (!listenAddr)
- listenAddr = driver->spiceListen;
- if (listenAddr)
- virBufferAsprintf(&opt, ",addr=%s", listenAddr);
-
- VIR_FREE(netAddr);
+ /* Explicit console devices */
+ for (i = 0 ; i < def->nconsoles ; i++) {
+ virDomainChrDefPtr console = def->consoles[i];
+ char *devstr;
- int mm = def->graphics[0]->data.spice.mousemode;
- if (mm) {
- switch (mm) {
- case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
- virBufferAsprintf(&opt, ",agent-mouse=off");
- break;
- case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT:
- virBufferAsprintf(&opt, ",agent-mouse=on");
- break;
- default:
- break;
+ switch (console->targetType) {
+ case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
+ if (!qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("virtio channel requires QEMU to support -device"));
+ goto error;
}
- }
-
- /* In the password case we set it via monitor command, to avoid
- * making it visible on CLI, so there's no use of password=XXX
- * in this bit of the code */
- if (!def->graphics[0]->data.spice.auth.passwd &&
- !driver->spicePassword)
- virBufferAddLit(&opt, ",disable-ticketing");
- if (driver->spiceTLS)
- virBufferAsprintf(&opt, ",x509-dir=%s",
- driver->spiceTLSx509certdir);
+ virCommandAddArg(cmd, "-chardev");
+ if (!(devstr = qemuBuildChrChardevStr(&console->source,
+ console->info.alias,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
- switch (defaultMode) {
- case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
- virBufferAsprintf(&opt, ",tls-channel=default");
- break;
- case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
- virBufferAsprintf(&opt, ",plaintext-channel=default");
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildVirtioSerialPortDevStr(console,
+ caps)))
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
break;
- case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
- /* nothing */
+
+ case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL:
break;
+
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported console target type %s"),
+ NULLSTR(virDomainChrConsoleTargetTypeToString(console->targetType)));
+ goto error;
}
+ }
- for (i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
- int mode = def->graphics[0]->data.spice.channels[i];
- switch (mode) {
- case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
- if (!driver->spiceTLS) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("spice secure channels set in XML configuration, but TLS is disabled in qemu.conf"));
+ for (i = 0 ; i < def->ninputs ; i++) {
+ virDomainInputDefPtr input = def->inputs[i];
+
+ if (input->bus == VIR_DOMAIN_INPUT_BUS_USB) {
+ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE)) {
+ char *optstr;
+ virCommandAddArg(cmd, "-device");
+ if (!(optstr = qemuBuildUSBInputDevStr(input, caps)))
goto error;
- }
- virBufferAsprintf(&opt, ",tls-channel=%s",
- virDomainGraphicsSpiceChannelNameTypeToString(i));
- break;
- case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
- virBufferAsprintf(&opt, ",plaintext-channel=%s",
- virDomainGraphicsSpiceChannelNameTypeToString(i));
- break;
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+ } else {
+ virCommandAddArgList(cmd, "-usbdevice",
+ input->type == VIR_DOMAIN_INPUT_TYPE_MOUSE
+ ? "mouse" : "tablet", NULL);
}
}
- if (def->graphics[0]->data.spice.image)
- virBufferAsprintf(&opt, ",image-compression=%s",
- virDomainGraphicsSpiceImageCompressionTypeToString(def->graphics[0]->data.spice.image));
- if (def->graphics[0]->data.spice.jpeg)
- virBufferAsprintf(&opt, ",jpeg-wan-compression=%s",
- virDomainGraphicsSpiceJpegCompressionTypeToString(def->graphics[0]->data.spice.jpeg));
- if (def->graphics[0]->data.spice.zlib)
- virBufferAsprintf(&opt, ",zlib-glz-wan-compression=%s",
- virDomainGraphicsSpiceZlibCompressionTypeToString(def->graphics[0]->data.spice.zlib));
- if (def->graphics[0]->data.spice.playback)
- virBufferAsprintf(&opt, ",playback-compression=%s",
- virDomainGraphicsSpicePlaybackCompressionTypeToString(def->graphics[0]->data.spice.playback));
- if (def->graphics[0]->data.spice.streaming)
- virBufferAsprintf(&opt, ",streaming-video=%s",
- virDomainGraphicsSpiceStreamingModeTypeToString(def->graphics[0]->data.spice.streaming));
- if (def->graphics[0]->data.spice.copypaste == VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_NO)
- virBufferAddLit(&opt, ",disable-copy-paste");
-
- if (qemuCapsGet(caps, QEMU_CAPS_SEAMLESS_MIGRATION)) {
- /* If qemu supports seamless migration turn it
- * unconditionally on. If migration destination
- * doesn't support it, it fallbacks to previous
- * migration algorithm silently. */
- virBufferAddLit(&opt, ",seamless-migration=on");
- }
-
- virCommandAddArg(cmd, "-spice");
- virCommandAddArgBuffer(cmd, &opt);
- if (def->graphics[0]->data.spice.keymap)
- virCommandAddArgList(cmd, "-k",
- def->graphics[0]->data.spice.keymap, NULL);
- /* SPICE includes native support for tunnelling audio, so we
- * set the audio backend to point at SPICE's own driver
- */
- virCommandAddEnvString(cmd, "QEMU_AUDIO_DRV=spice");
+ }
- } else if ((def->ngraphics == 1)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported graphics type '%s'"),
- virDomainGraphicsTypeToString(def->graphics[0]->type));
+ if (def->ngraphics > 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only 1 graphics device is supported"));
goto error;
}
+ for (i = 0 ; i < def->ngraphics ; ++i) {
+ switch (qemuBuildGraphicsCommandLine(driver, cmd, def, caps,
+ def->graphics[i])) {
+ case ERROR:
+ goto error;
+ case NO_MEMORY:
+ goto no_memory;
+ }
+ }
if (def->nvideos > 0) {
if (qemuCapsGet(caps, QEMU_CAPS_VGA)) {
if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_XEN) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d8cf4c3..2a77290 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2081,16 +2081,17 @@ qemuProcessInitPasswords(virConnectPtr conn,
int ret = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
- if (vm->def->ngraphics == 1) {
- if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
+ for (int i = 0 ; i < vm->def->ngraphics; ++i) {
+ virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
ret = qemuDomainChangeGraphicsPasswords(driver, vm,
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
- &vm->def->graphics[0]->data.vnc.auth,
+ &graphics->data.vnc.auth,
driver->vncPassword);
- } else if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
ret = qemuDomainChangeGraphicsPasswords(driver, vm,
VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
- &vm->def->graphics[0]->data.spice.auth,
+ &graphics->data.spice.auth,
driver->spicePassword);
}
}
@@ -3484,21 +3485,22 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Ensuring no historical cgroup is lying around");
qemuRemoveCgroup(driver, vm, 1);
- if (vm->def->ngraphics == 1) {
- if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
- !vm->def->graphics[0]->data.vnc.socket &&
- vm->def->graphics[0]->data.vnc.autoport) {
+ for (i = 0 ; i < vm->def->ngraphics; ++i) {
+ virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
+ !graphics->data.vnc.socket &&
+ graphics->data.vnc.autoport) {
int port = qemuProcessNextFreePort(driver, driver->remotePortMin);
if (port < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused port for VNC"));
goto cleanup;
}
- vm->def->graphics[0]->data.vnc.port = port;
- } else if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ graphics->data.vnc.port = port;
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
int port = -1;
- if (vm->def->graphics[0]->data.spice.autoport ||
- vm->def->graphics[0]->data.spice.port == -1) {
+ if (graphics->data.spice.autoport ||
+ graphics->data.spice.port == -1) {
port = qemuProcessNextFreePort(driver, driver->remotePortMin);
if (port < 0) {
@@ -3507,13 +3509,13 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
}
- vm->def->graphics[0]->data.spice.port = port;
+ graphics->data.spice.port = port;
}
if (driver->spiceTLS &&
- (vm->def->graphics[0]->data.spice.autoport ||
- vm->def->graphics[0]->data.spice.tlsPort == -1)) {
+ (graphics->data.spice.autoport ||
+ graphics->data.spice.tlsPort == -1)) {
int tlsPort = qemuProcessNextFreePort(driver,
- vm->def->graphics[0]->data.spice.port + 1);
+ graphics->data.spice.port + 1);
if (tlsPort < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused port for SPICE TLS"));
@@ -3521,20 +3523,19 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
}
- vm->def->graphics[0]->data.spice.tlsPort = tlsPort;
+ graphics->data.spice.tlsPort = tlsPort;
}
}
- if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC ||
- vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
- virDomainGraphicsDefPtr graphics = vm->def->graphics[0];
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC ||
+ graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
if (graphics->nListens == 0) {
if (VIR_EXPAND_N(graphics->listens, graphics->nListens, 1) < 0) {
virReportOOMError();
goto cleanup;
}
graphics->listens[0].type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS;
- if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
graphics->listens[0].address = strdup(driver->vncListen);
else
graphics->listens[0].address = strdup(driver->spiceListen);
@@ -4150,19 +4151,20 @@ retry:
qemuProcessRemoveDomainStatus(driver, vm);
- /* Remove VNC port from port reservation bitmap, but only if it was
- reserved by the driver (autoport=yes)
+ /* Remove VNC and Spice ports from port reservation bitmap, but only if
+ they were reserved by the driver (autoport=yes)
*/
- if ((vm->def->ngraphics == 1) &&
- vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
- vm->def->graphics[0]->data.vnc.autoport) {
- qemuProcessReturnPort(driver, vm->def->graphics[0]->data.vnc.port);
- }
- if ((vm->def->ngraphics == 1) &&
- vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
- vm->def->graphics[0]->data.spice.autoport) {
- qemuProcessReturnPort(driver, vm->def->graphics[0]->data.spice.port);
- qemuProcessReturnPort(driver, vm->def->graphics[0]->data.spice.tlsPort);
+ for (i = 0 ; i < vm->def->ngraphics; ++i) {
+ virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
+ graphics->data.vnc.autoport) {
+ qemuProcessReturnPort(driver, graphics->data.vnc.port);
+ }
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
+ graphics->data.spice.autoport) {
+ qemuProcessReturnPort(driver, graphics->data.spice.port);
+ qemuProcessReturnPort(driver, graphics->data.spice.tlsPort);
+ }
}
vm->taint = 0;
--
1.8.0
12 years
[libvirt] [PATCH v2] qemu: Allow migration to be cancelled at prepare phase
by Michal Privoznik
Currently, if user calls virDomainAbortJob we just issue
'migrate_cancel' and hope for the best. However, if user calls
the API in wrong phase when migration hasn't been started yet
(perform phase) the cancel request is just ignored. With this
patch, the request is remembered and as soon as perform phase
starts, migration is cancelled.
---
diff to v1:
-don't move 'migrate_cancel'
-drop qemuDomainObjAbortAsyncJobRequested()
-detect asyncAbort earlier
src/qemu/qemu_domain.c | 12 ++++++++++++
src/qemu/qemu_domain.h | 2 ++
src/qemu/qemu_driver.c | 1 +
src/qemu/qemu_migration.c | 11 +++++++++++
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index a5592b9..e0d6951 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -160,6 +160,7 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv)
job->mask = DEFAULT_JOB_MASK;
job->start = 0;
job->dump_memory_only = false;
+ job->asyncAbort = false;
memset(&job->info, 0, sizeof(job->info));
}
@@ -959,6 +960,17 @@ qemuDomainObjEndAsyncJob(struct qemud_driver *driver, virDomainObjPtr obj)
return virObjectUnref(obj);
}
+void
+qemuDomainObjAbortAsyncJob(virDomainObjPtr obj)
+{
+ qemuDomainObjPrivatePtr priv = obj->privateData;
+
+ VIR_DEBUG("Requesting abort of async job: %s",
+ qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
+
+ priv->job.asyncAbort = true;
+}
+
static int
qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
bool driver_locked,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 9c2f67c..a2acc0a 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -111,6 +111,7 @@ struct qemuDomainJobObj {
unsigned long long start; /* When the async job started */
bool dump_memory_only; /* use dump-guest-memory to do dump */
virDomainJobInfo info; /* Async job progress data */
+ bool asyncAbort; /* abort of async job requested */
};
typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
@@ -204,6 +205,7 @@ bool qemuDomainObjEndJob(struct qemud_driver *driver,
bool qemuDomainObjEndAsyncJob(struct qemud_driver *driver,
virDomainObjPtr obj)
ATTRIBUTE_RETURN_CHECK;
+void qemuDomainObjAbortAsyncJob(virDomainObjPtr obj);
void qemuDomainObjSetJobPhase(struct qemud_driver *driver,
virDomainObjPtr obj,
int phase);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 01ba7eb..9aa8340 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10373,6 +10373,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) {
}
VIR_DEBUG("Cancelling job at client request");
+ qemuDomainObjAbortAsyncJob(vm);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorMigrateCancel(priv->mon);
qemuDomainObjExitMonitor(driver, vm);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 5f8a9c5..0a52486 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2168,6 +2168,17 @@ qemuMigrationRun(struct qemud_driver *driver,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
goto cleanup;
+ if (priv->job.asyncAbort) {
+ /* explicitly do this *after* we entered the monitor,
+ * as this is a critical section so we are guaranteed
+ * priv->job.asyncAbort will not change */
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
+ virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
+ qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
+ _("canceled by client"));
+ goto cleanup;
+ }
+
if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
goto cleanup;
--
1.7.8.6
12 years
[libvirt] [PATCH v3 1/2] 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 usage had been discussed before,
http://www.redhat.com/archives/libvir-list/2011-December/msg00451.html
maybe there're some flaws:
- It did not handle more about complete situations
suggested by Daniel P. Berrange,
https://www.redhat.com/archives/libvir-list/2012-October/msg00407.html
but may try to take care of them later.
so, now only normal disk image files be handled.
- for creation of disk images, size was setting as 0xffffffff boldly,
hope it can consolidate qemu, haven't constructed a comfortable
idea to solve it.
v2:
1. handle disk encrytion case
2. check kvm-img & qemu-img
3. set disk image size to 0xfffffffK bytes blindly
v3:
1.use qemuImgBinary to create disk image
2.set max size for different disk image format respectively
qcow and qcow2: 1PiB
qed:64TiB
raw:1TiB
from qemu's setting,
qcow and qcow2's max size is 2EiB,
qed's max size is 64TiB
raw's max size is 1TiB
Signed-off-by: liguang <lig.fnst(a)cn.fujitsu.com>
---
src/qemu/qemu_migration.c | 122 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 120 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index db69a0a..80abb51 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -49,6 +49,7 @@
#include "storage_file.h"
#include "viruri.h"
#include "hooks.h"
+#include "dirname.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
@@ -70,6 +71,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 +79,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 +442,9 @@ 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:
@@ -721,6 +732,9 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig,
qemuMigrationCookieAddPersistent(mig, dom) < 0)
return -1;
+ if (flags & QEMU_MIGRATION_COOKIE_COPYSTORAGE)
+ mig->flags |= QEMU_MIGRATION_COOKIE_COPYSTORAGE;
+
if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, mig)))
return -1;
@@ -1168,6 +1182,14 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
QEMU_MIGRATION_COOKIE_LOCKSTATE) < 0)
goto cleanup;
+ if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
+ VIR_MIGRATE_NON_SHARED_INC)) {
+ if (qemuMigrationBakeCookie(mig, driver, vm,
+ cookieout, cookieoutlen,
+ QEMU_MIGRATION_COOKIE_COPYSTORAGE) < 0)
+ goto cleanup;
+ }
+
if (xmlin) {
if (!(def = virDomainDefParseString(driver->caps, xmlin,
QEMU_EXPECTED_VIRT_TYPES,
@@ -1215,6 +1237,89 @@ qemuMigrationPrepareCleanup(struct qemud_driver *driver,
qemuDomainObjDiscardAsyncJob(driver, vm);
}
+/*
+ if gen_del is 1, find out disk images migration required,
+ so try to generate them at target,
+ if gen_del is 0, delete disk images generated before.
+*/
+static int qemuMigrationHandleDiskFiles(struct qemud_driver *driver,
+ virDomainDefPtr def, int gen_del)
+{
+ char *tmp_dir = NULL, *outbuf = NULL;
+ char *img_tool = driver->qemuImgBinary;
+ virCommandPtr cmd = NULL;
+ int i, ret = -1;
+
+ if (!def->ndisks)
+ return 0;
+
+ if (img_tool == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to find kvm-img or qemu-img"));
+ goto error;
+ }
+
+ for (i = 0; i < def->ndisks; i++) {
+ if (STRNEQ(def->disks[i]->driverName, "qemu"))
+ continue;
+ if (def->disks[i]->src == NULL)
+ continue;
+ if (def->disks[i]->driverType == NULL)
+ continue;
+ if (virFileExists(def->disks[i]->src) && gen_del)
+ continue;
+ if (!gen_del && !virFileExists(def->disks[i]->src))
+ continue;
+ if ((tmp_dir = mdir_name(def->disks[i]->src)) == NULL)
+ continue;
+ if (!virFileExists(tmp_dir))
+ if (virFileMakePath(tmp_dir) < 0)
+ continue;
+ if (gen_del) {
+ cmd = virCommandNewArgList(img_tool, "create", "-f",
+ def->disks[i]->driverType, def->disks[i]->src, NULL);
+ if (STREQ(def->disks[i]->driverType, "qcow2") ||
+ STREQ(def->disks[i]->driverType, "qcow"))
+ virCommandAddArgFormat(cmd, "%lluK", 0xffffffffff);
+ else if (STREQ(def->disks[i]->driverType, "qed"))
+ virCommandAddArgFormat(cmd, "%llu", 0x400000000000);
+ else if (STREQ(def->disks[i]->driverType, "raw"))
+ virCommandAddArgFormat(cmd, "%llu", 0xffffffffff);
+ else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only suport qcow,qcow2,qed,raw format"));
+ goto cleanup;
+ }
+ if (def->disks[i]->encryption)
+ virCommandAddArgList(cmd, "-o", "encryption=on", NULL);
+ virCommandSetOutputBuffer(cmd, &outbuf);
+ if (virCommandRun(cmd, NULL) < 0) {
+ virReportSystemError(errno, "%s", outbuf);
+ goto cleanup;
+ }
+ } else {
+ if (unlink(def->disks[i]->src) < 0) {
+ virReportError(errno, "%s", _("fail to unlink disk image file"));
+ goto cleanup;
+ }
+ }
+ virCommandFree(cmd);
+ VIR_FREE(tmp_dir);
+ VIR_FREE(outbuf);
+ }
+
+ ret = 0;
+
+cleanup:
+ if (ret < 0) {
+ virCommandFree(cmd);
+ VIR_FREE(tmp_dir);
+ VIR_FREE(outbuf);
+ }
+error:
+ return ret;
+}
+
static int
qemuMigrationPrepareAny(struct qemud_driver *driver,
virConnectPtr dconn,
@@ -1308,6 +1413,15 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
/* virDomainAssignDef already set the error */
goto cleanup;
}
+
+ if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
+ QEMU_MIGRATION_COOKIE_COPYSTORAGE)))
+ goto cleanup;
+
+ if (mig->flags & QEMU_MIGRATION_COOKIE_COPYSTORAGE)
+ if (qemuMigrationHandleDiskFiles(driver, def, 1) < 0)
+ goto cleanup;
+
def = NULL;
priv = vm->privateData;
priv->origname = origname;
@@ -2929,7 +3043,7 @@ 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;
VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
@@ -3088,7 +3202,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(driver, vm->def, 0);
if (qemuMigrationJobFinish(driver, vm) == 0) {
vm = NULL;
} else if (!vm->persistent && !virDomainObjIsActive(vm)) {
--
1.7.1
12 years
[libvirt] [PATCH] capabilities: defaultConsoleTargetType can depend on architecture
by Viktor Mihajlovski
For S390, the default console target type cannot be of type 'serial'.
It is necessary to at least interpret the 'arch' attribute
value of the os/type element to produce the correct default type.
Therefore we need to extend the signature of defaultConsoleTargetType
to account for architecture. As a consequence all the drivers
supporting this capability function must be updated.
Despite the amount of changed files, the only change in behavior is
that for S390 the default console target type will be 'virtio'.
N.B.: A more future-proof approach could be to to use hypervisor
specific capabilities to determine the best possible console type.
For instance one could add an opaque private data pointer to the
virCaps structure (in case of QEMU to hold capsCache) which could
then be passed to the defaultConsoleTargetType callback to determine
the console target type.
Seems to be however a bit overengineered for the use case...
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/conf/capabilities.h | 2 +-
src/conf/domain_conf.c | 2 +-
src/esx/esx_driver.c | 3 ++-
src/libxl/libxl_conf.c | 3 ++-
src/lxc/lxc_conf.c | 3 ++-
src/openvz/openvz_conf.c | 3 ++-
src/parallels/parallels_driver.c | 3 ++-
src/phyp/phyp_driver.c | 3 ++-
src/qemu/qemu_capabilities.c | 8 ++++++--
src/security/virt-aa-helper.c | 3 ++-
src/test/test_driver.c | 3 ++-
src/uml/uml_conf.c | 3 ++-
src/vbox/vbox_tmpl.c | 3 ++-
src/vmware/vmware_conf.c | 3 ++-
src/xen/xen_hypervisor.c | 3 ++-
src/xenapi/xenapi_driver.c | 3 ++-
tests/testutilslxc.c | 3 ++-
tests/testutilsqemu.c | 8 ++++++--
tests/testutilsxen.c | 3 ++-
tests/vmx2xmltest.c | 3 ++-
tests/xml2vmxtest.c | 3 ++-
21 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index 99056f8..641f279 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -150,7 +150,7 @@ struct _virCaps {
unsigned int emulatorRequired : 1;
const char *defaultDiskDriverName;
int defaultDiskDriverType; /* enum virStorageFileFormat */
- int (*defaultConsoleTargetType)(const char *ostype);
+ int (*defaultConsoleTargetType)(const char *ostype, const char *arch);
void *(*privateDataAllocFunc)(void);
void (*privateDataFreeFunc)(void *);
int (*privateDataXMLFormat)(virBufferPtr, void *);
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e105a02..bb1d632 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5284,7 +5284,7 @@ virDomainChrDefaultTargetType(virCapsPtr caps,
_("Driver does not have a default console type set"));
return -1;
}
- target = caps->defaultConsoleTargetType(def->os.type);
+ target = caps->defaultConsoleTargetType(def->os.type, def->os.arch);
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 13e8887..56f31bb 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -566,7 +566,8 @@ esxLookupHostSystemBiosUuid(esxPrivate *priv, unsigned char *uuid)
}
-static int esxDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int esxDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 52771b8..1c3130b 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -117,7 +117,8 @@ libxlNextFreeVncPort(libxlDriverPrivatePtr driver, int startPort)
}
-static int libxlDefaultConsoleType(const char *ostype)
+static int libxlDefaultConsoleType(const char *ostype,
+ const char *arch ATTRIBUTE_UNUSED)
{
if (STREQ(ostype, "hvm"))
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index 138b697..e512b8f 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -42,7 +42,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
-static int lxcDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int lxcDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC;
}
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index ea86a0e..2bd9caf 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -169,7 +169,8 @@ error:
}
-static int openvzDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int openvzDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ;
}
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 28779fa..50efd1d 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -87,7 +87,8 @@ parallelsDriverUnlock(parallelsConnPtr driver)
}
static int
-parallelsDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+parallelsDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index a3885a7..e8cef4f 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -288,7 +288,8 @@ phypGetVIOSPartitionID(virConnectPtr conn)
}
-static int phypDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int phypDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1859f53..f4649b6 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -807,9 +807,13 @@ error:
}
-static int qemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int qemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch)
{
- return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+ if (STRPREFIX(arch, "s390"))
+ return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO;
+ else
+ return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 634a3fc..e480b30 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -698,7 +698,8 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
return rc;
}
-static int aaDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int aaDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index c974e1a..9e4d9f2 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -149,7 +149,8 @@ static void testDomainObjPrivateFree(void *data)
}
-static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 036181c..6ef6de3 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -53,7 +53,8 @@
#define VIR_FROM_THIS VIR_FROM_UML
-static int umlDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int umlDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML;
}
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 5ec0ba0..bcffb2f 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -822,7 +822,8 @@ cleanup:
}
-static int vboxDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int vboxDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 8101cc7..2eed4f8 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -50,7 +50,8 @@ vmwareFreeDriver(struct vmware_driver *driver)
}
-static int vmwareDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int vmwareDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index d1f7b41..237a6ab 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -2301,7 +2301,8 @@ struct guest_arch {
};
-static int xenDefaultConsoleType(const char *ostype)
+static int xenDefaultConsoleType(const char *ostype,
+ const char *arch ATTRIBUTE_UNUSED)
{
if (STREQ(ostype, "hvm"))
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index a170bef..5a93aea 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -43,7 +43,8 @@
#define VIR_FROM_THIS VIR_FROM_XENAPI
-static int xenapiDefaultConsoleType(const char *ostype)
+static int xenapiDefaultConsoleType(const char *ostype,
+ const char *arch ATTRIBUTE_UNUSED)
{
if (STREQ(ostype, "hvm"))
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c
index e6193af..822e518 100644
--- a/tests/testutilslxc.c
+++ b/tests/testutilslxc.c
@@ -8,7 +8,8 @@
# include "domain_conf.h"
-static int testLXCDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testLXCDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC;
}
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 69c78ec..4ff4a08 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -55,9 +55,13 @@ static virCapsGuestMachinePtr *testQemuAllocNewerMachines(int *nmachines)
return machines;
}
-static int testQemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testQemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch)
{
- return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+ if (STRPREFIX(arch, "s390"))
+ return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO;
+ else
+ return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
static int testQemuAddPPC64Guest(virCapsPtr caps)
diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c
index b5f20cb..517aeab 100644
--- a/tests/testutilsxen.c
+++ b/tests/testutilsxen.c
@@ -6,7 +6,8 @@
#include "testutilsxen.h"
#include "domain_conf.h"
-static int testXenDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testXenDefaultConsoleType(const char *ostype,
+ const char *arch ATTRIBUTE_UNUSED)
{
if (STREQ(ostype, "hvm"))
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 4913152..e523d1c 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -14,7 +14,8 @@
static virCapsPtr caps;
static virVMXContext ctx;
-static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index 451b1e4..94dfcf2 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -14,7 +14,8 @@
static virCapsPtr caps;
static virVMXContext ctx;
-static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
+static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
+ const char *arch ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
--
1.7.0.4
12 years
[libvirt] [PATCHv2 00/20] External snapshot support
by Peter Krempa
This is a second spin of the patches:
Changes to previous version:
- pushed fix for private_syms file
patches 1-4 are Eric's patches that this series builds upon
patches 5,were ACKed in v1
patches 6,7,9,10,14 are fixed versions after review
patch 8 is new in the series
the rest needs review.
You can fetch the changes at:
git fetch git://pipo.sk/pipo/libvirt.git snap-revert
Eric Blake (4):
snapshot: new XML for external system checkpoint
snapshot: improve disk align checking
snapshot: populate new XML info for qemu snapshots
snapshot: merge pre-snapshot checks
Peter Krempa (16):
qemu: Split out code to save domain memory to allow reuse
snapshot: Add flag to enable creating checkpoints in live state
snapshot: qemu: Add async job type for snapshots
snapshot: qemu: Rename qemuDomainSnapshotCreateActive
qemu: Fix possible race when pausing guest
snapshot: qemu: Add support for external checkpoints
snapshot: qemu: Remove restrictions preventing external snapshots
qemu: snapshot: Clean up snapshot retrieval to use the new helper
qemu: Split out guts of qemuDomainSaveImageStartVM() to allow reuse
snapshot: qemu: Add flag VIR_DOMAIN_SNAPSHOT_REVERT_STOPPED
snapshot: qemu: Add support for external inactive snapshots
conf: Add helper to determine if snapshot is external
snapshot: qemu: Add detail option for PMSUSPENDED event.
snapshot: qemu: Fix detection of external snapshots when deleting
snapshot: qemu: Add support for external snapshot deletion.
snapshot: qemu: Implement reverting of external snapshots
docs/formatsnapshot.html.in | 11 +
docs/schemas/domainsnapshot.rng | 23 +
examples/domain-events/events-c/event-test.c | 3 +
include/libvirt/libvirt.h.in | 7 +
src/conf/snapshot_conf.c | 102 +-
src/conf/snapshot_conf.h | 6 +
src/libvirt.c | 15 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 125 +-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 1203 ++++++++++++++------
src/qemu/qemu_process.c | 19 +
tests/domainsnapshotxml2xmlin/external_vm.xml | 10 +
tests/domainsnapshotxml2xmlin/noparent.xml | 9 +
tests/domainsnapshotxml2xmlout/all_parameters.xml | 1 +
tests/domainsnapshotxml2xmlout/disk_snapshot.xml | 1 +
tests/domainsnapshotxml2xmlout/external_vm.xml | 43 +
tests/domainsnapshotxml2xmlout/full_domain.xml | 1 +
tests/domainsnapshotxml2xmlout/metadata.xml | 1 +
tests/domainsnapshotxml2xmlout/noparent.xml | 1 +
.../noparent_nodescription.xml | 1 +
.../noparent_nodescription_noactive.xml | 1 +
tests/domainsnapshotxml2xmltest.c | 1 +
tools/virsh-domain-monitor.c | 2 +
tools/virsh-snapshot.c | 9 +
tools/virsh.pod | 27 +-
26 files changed, 1259 insertions(+), 365 deletions(-)
create mode 100644 tests/domainsnapshotxml2xmlin/external_vm.xml
create mode 100644 tests/domainsnapshotxml2xmlin/noparent.xml
create mode 100644 tests/domainsnapshotxml2xmlout/external_vm.xml
--
1.7.12.4
12 years