mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
qemu_command: assume QEMU_CAPS_DEVICE
Drop some checks that are no longer necessary as well as -usbdevice -pcidevice and -soundhw support.
This commit is contained in:
parent
33705aeec0
commit
34ab070c0d
@ -2890,9 +2890,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
|
|||||||
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
|
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
|
|
||||||
goto check_add_usb;
|
|
||||||
|
|
||||||
for (j = 0; j < ARRAY_CARDINALITY(contOrder); j++) {
|
for (j = 0; j < ARRAY_CARDINALITY(contOrder); j++) {
|
||||||
for (i = 0; i < def->ncontrollers; i++) {
|
for (i = 0; i < def->ncontrollers; i++) {
|
||||||
virDomainControllerDefPtr cont = def->controllers[i];
|
virDomainControllerDefPtr cont = def->controllers[i];
|
||||||
@ -2961,7 +2958,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check_add_usb:
|
|
||||||
if (usbcontroller == 0 &&
|
if (usbcontroller == 0 &&
|
||||||
!qemuDomainMachineIsQ35(def) &&
|
!qemuDomainMachineIsQ35(def) &&
|
||||||
!ARCH_IS_S390(def->os.arch))
|
!ARCH_IS_S390(def->os.arch))
|
||||||
@ -3664,25 +3660,12 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
|
|||||||
if (!def->watchdog)
|
if (!def->watchdog)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
|
|
||||||
optstr = qemuBuildWatchdogDevStr(def, watchdog, qemuCaps);
|
optstr = qemuBuildWatchdogDevStr(def, watchdog, qemuCaps);
|
||||||
if (!optstr)
|
if (!optstr)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
virCommandAddArg(cmd, "-watchdog");
|
|
||||||
|
|
||||||
const char *model = virDomainWatchdogModelTypeToString(watchdog->model);
|
|
||||||
if (!model) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("missing watchdog model"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VIR_STRDUP(optstr, model) < 0)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
virCommandAddArg(cmd, optstr);
|
virCommandAddArg(cmd, optstr);
|
||||||
VIR_FREE(optstr);
|
VIR_FREE(optstr);
|
||||||
|
|
||||||
@ -3945,27 +3928,12 @@ qemuBuildInputCommandLine(virCommandPtr cmd,
|
|||||||
virDomainInputDefPtr input = def->inputs[i];
|
virDomainInputDefPtr input = def->inputs[i];
|
||||||
|
|
||||||
if (input->bus == VIR_DOMAIN_INPUT_BUS_USB) {
|
if (input->bus == VIR_DOMAIN_INPUT_BUS_USB) {
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
char *optstr;
|
char *optstr;
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
if (!(optstr = qemuBuildUSBInputDevStr(def, input, qemuCaps)))
|
if (!(optstr = qemuBuildUSBInputDevStr(def, input, qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
virCommandAddArg(cmd, optstr);
|
virCommandAddArg(cmd, optstr);
|
||||||
VIR_FREE(optstr);
|
VIR_FREE(optstr);
|
||||||
} else {
|
|
||||||
switch (input->type) {
|
|
||||||
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
|
|
||||||
virCommandAddArgList(cmd, "-usbdevice", "mouse", NULL);
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_INPUT_TYPE_TABLET:
|
|
||||||
virCommandAddArgList(cmd, "-usbdevice", "tablet", NULL);
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_INPUT_TYPE_KBD:
|
|
||||||
virCommandAddArgList(cmd, "-usbdevice", "keyboard",
|
|
||||||
NULL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (input->bus == VIR_DOMAIN_INPUT_BUS_VIRTIO) {
|
} else if (input->bus == VIR_DOMAIN_INPUT_BUS_VIRTIO) {
|
||||||
char *optstr;
|
char *optstr;
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
@ -4094,10 +4062,6 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
|
|||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
if (!def->nsounds)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
for (i = 0; i < def->nsounds; i++) {
|
for (i = 0; i < def->nsounds; i++) {
|
||||||
virDomainSoundDefPtr sound = def->sounds[i];
|
virDomainSoundDefPtr sound = def->sounds[i];
|
||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
@ -4147,39 +4111,6 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
int size = 100;
|
|
||||||
char *modstr;
|
|
||||||
if (VIR_ALLOC_N(modstr, size+1) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i = 0; i < def->nsounds && size > 0; i++) {
|
|
||||||
virDomainSoundDefPtr sound = def->sounds[i];
|
|
||||||
const char *model = virDomainSoundModelTypeToString(sound->model);
|
|
||||||
if (!model) {
|
|
||||||
VIR_FREE(modstr);
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("invalid sound model"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sound->model == VIR_DOMAIN_SOUND_MODEL_ICH6 ||
|
|
||||||
sound->model == VIR_DOMAIN_SOUND_MODEL_ICH9) {
|
|
||||||
VIR_FREE(modstr);
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("this QEMU binary lacks hda support"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
strncat(modstr, model, size);
|
|
||||||
size -= strlen(model);
|
|
||||||
if (i < (def->nsounds - 1))
|
|
||||||
strncat(modstr, ",", size--);
|
|
||||||
}
|
|
||||||
virCommandAddArgList(cmd, "-soundhw", modstr, NULL);
|
|
||||||
VIR_FREE(modstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4369,8 +4300,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
|
|||||||
const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);
|
const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);
|
||||||
|
|
||||||
if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
|
if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
|
||||||
(def->videos[0]->vram || def->videos[0]->ram) &&
|
(def->videos[0]->vram || def->videos[0]->ram)) {
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
unsigned int ram = def->videos[0]->ram;
|
unsigned int ram = def->videos[0]->ram;
|
||||||
unsigned int vram = def->videos[0]->vram;
|
unsigned int vram = def->videos[0]->vram;
|
||||||
unsigned int vram64 = def->videos[0]->vram64;
|
unsigned int vram64 = def->videos[0]->vram64;
|
||||||
@ -4413,8 +4343,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (def->videos[0]->vram &&
|
||||||
def->videos[0]->vram &&
|
|
||||||
((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA &&
|
((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA &&
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
|
||||||
(primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA &&
|
(primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA &&
|
||||||
@ -4434,8 +4363,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->nvideos > 1) {
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
for (i = 1; i < def->nvideos; i++) {
|
for (i = 1; i < def->nvideos; i++) {
|
||||||
char *str;
|
char *str;
|
||||||
if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
|
if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
|
||||||
@ -4454,12 +4381,6 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
|
|||||||
virCommandAddArg(cmd, str);
|
virCommandAddArg(cmd, str);
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("only one video card is currently supported"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -4555,34 +4476,6 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
|
||||||
qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev,
|
|
||||||
virQEMUCapsPtr qemuCaps)
|
|
||||||
{
|
|
||||||
char *ret = NULL;
|
|
||||||
virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci;
|
|
||||||
|
|
||||||
if (pcisrc->addr.domain) {
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_HOST_PCI_MULTIDOMAIN)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("non-zero domain='%.4x' in host device PCI address "
|
|
||||||
"not supported in this QEMU binary"),
|
|
||||||
pcisrc->addr.domain);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
ignore_value(virAsprintf(&ret, "host=%.4x:%.2x:%.2x.%.1x",
|
|
||||||
pcisrc->addr.domain, pcisrc->addr.bus,
|
|
||||||
pcisrc->addr.slot, pcisrc->addr.function));
|
|
||||||
} else {
|
|
||||||
ignore_value(virAsprintf(&ret, "host=%.2x:%.2x.%.1x",
|
|
||||||
pcisrc->addr.bus, pcisrc->addr.slot,
|
|
||||||
pcisrc->addr.function));
|
|
||||||
}
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
qemuBuildUSBHostdevDevStr(const virDomainDef *def,
|
qemuBuildUSBHostdevDevStr(const virDomainDef *def,
|
||||||
virDomainHostdevDefPtr dev,
|
virDomainHostdevDefPtr dev,
|
||||||
@ -4678,28 +4571,6 @@ qemuBuildHubCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
|
||||||
qemuBuildUSBHostdevUSBDevStr(virDomainHostdevDefPtr dev)
|
|
||||||
{
|
|
||||||
char *ret = NULL;
|
|
||||||
virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb;
|
|
||||||
|
|
||||||
if (dev->missing) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("This QEMU doesn't not support missing USB devices"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!usbsrc->bus && !usbsrc->device) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("USB host device is missing bus/device information"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ignore_value(virAsprintf(&ret, "host:%d.%d", usbsrc->bus, usbsrc->device));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
qemuBuildSCSIHostHostdevDrvStr(virDomainHostdevDefPtr dev)
|
qemuBuildSCSIHostHostdevDrvStr(virDomainHostdevDefPtr dev)
|
||||||
{
|
{
|
||||||
@ -5105,20 +4976,12 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
|
|||||||
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
if (!(devstr =
|
if (!(devstr =
|
||||||
qemuBuildUSBHostdevDevStr(def, hostdev, qemuCaps)))
|
qemuBuildUSBHostdevDevStr(def, hostdev, qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
} else {
|
|
||||||
virCommandAddArg(cmd, "-usbdevice");
|
|
||||||
if (!(devstr = qemuBuildUSBHostdevUSBDevStr(hostdev)))
|
|
||||||
return -1;
|
|
||||||
virCommandAddArg(cmd, devstr);
|
|
||||||
VIR_FREE(devstr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PCI */
|
/* PCI */
|
||||||
@ -5135,7 +4998,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
char *configfd_name = NULL;
|
char *configfd_name = NULL;
|
||||||
unsigned int bootIndex = hostdev->info->bootIndex;
|
unsigned int bootIndex = hostdev->info->bootIndex;
|
||||||
|
|
||||||
@ -5169,24 +5031,12 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
|
|||||||
return -1;
|
return -1;
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCIDEVICE)) {
|
|
||||||
virCommandAddArg(cmd, "-pcidevice");
|
|
||||||
if (!(devstr = qemuBuildPCIHostdevPCIDevStr(hostdev, qemuCaps)))
|
|
||||||
return -1;
|
|
||||||
virCommandAddArg(cmd, devstr);
|
|
||||||
VIR_FREE(devstr);
|
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("PCI device assignment is not supported by this version of qemu"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SCSI */
|
/* SCSI */
|
||||||
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
|
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCSI_GENERIC)) {
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCSI_GENERIC)) {
|
|
||||||
char *drvstr;
|
char *drvstr;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-drive");
|
virCommandAddArg(cmd, "-drive");
|
||||||
@ -5880,11 +5730,6 @@ qemuBuildSgaCommandLine(virCommandPtr cmd,
|
|||||||
{
|
{
|
||||||
/* Serial graphics adapter */
|
/* Serial graphics adapter */
|
||||||
if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
|
if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("qemu does not support -device"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGA)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGA)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("qemu does not support SGA"));
|
_("qemu does not support SGA"));
|
||||||
@ -8605,8 +8450,7 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager,
|
|||||||
char *devstr;
|
char *devstr;
|
||||||
|
|
||||||
/* Use -chardev with -device if they are available */
|
/* Use -chardev with -device if they are available */
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) &&
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, def,
|
if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, def,
|
||||||
¶llel->source,
|
¶llel->source,
|
||||||
parallel->info.alias,
|
parallel->info.alias,
|
||||||
@ -8647,8 +8491,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|||||||
|
|
||||||
switch (channel->targetType) {
|
switch (channel->targetType) {
|
||||||
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
|
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) ||
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
"%s", _("guestfwd requires QEMU to support -chardev & -device"));
|
"%s", _("guestfwd requires QEMU to support -chardev & -device"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -8670,12 +8513,6 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
|
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("virtio channel requires QEMU to support -device"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: Refactor so that we generate this (and onther
|
* TODO: Refactor so that we generate this (and onther
|
||||||
* things) somewhere else then where we are building the
|
* things) somewhere else then where we are building the
|
||||||
@ -8735,11 +8572,6 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|||||||
switch (console->targetType) {
|
switch (console->targetType) {
|
||||||
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
|
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
|
||||||
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM:
|
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("sclp console requires QEMU to support -device"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCLP_S390)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCLP_S390)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("sclp console requires QEMU to support s390-sclp"));
|
_("sclp console requires QEMU to support s390-sclp"));
|
||||||
@ -8760,12 +8592,6 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
|
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("virtio channel requires QEMU to support -device"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, def,
|
if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, def,
|
||||||
&console->source,
|
&console->source,
|
||||||
console->info.alias,
|
console->info.alias,
|
||||||
@ -8905,12 +8731,6 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
|
|||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("redirected devices are not supported by this QEMU"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
|
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user