[libvirt] [PATCH v2 4/5] qemu: Process the hostdev "rawio" setting

Ján Tomko jtomko at redhat.com
Fri Sep 19 11:38:50 UTC 2014


On 09/19/2014 12:17 PM, John Ferlan wrote:
> Mimic the "Disk" processing for 'rawio', but for a scsi_host hostdev
> lun device.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_domain.c  | 18 ++++++++++++++++++
>  src/qemu/qemu_domain.h  |  4 ++++
>  src/qemu/qemu_driver.c  |  1 +
>  src/qemu/qemu_process.c | 19 +++++++++++++++++++
>  4 files changed, 42 insertions(+)
> 

> @@ -4376,6 +4378,23 @@ int qemuProcessStart(virConnectPtr conn,
>              goto cleanup;
>      }
>  
> +    /* If rawio not already set, check hostdevs as well */
> +    if (!rawio_set) {
> +        for (i = 0; i < vm->def->nhostdevs; i++) {
> +            virDomainHostdevSubsysSCSIPtr scsisrc =
> +                &vm->def->hostdevs[i]->source.subsys.u.scsi;
> +            if (scsisrc->rawio == VIR_TRISTATE_BOOL_YES) {
> +#ifdef CAP_SYS_RAWIO
> +                virCommandAllowCap(cmd, CAP_SYS_RAWIO);

You can break; here.

> +#else
> +                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                               _("Raw I/O is not supported on this platform"));
> +                goto cleanup;
> +#endif
> +            }
> +        }
> +    }
> +
>      virCommandSetPreExecHook(cmd, qemuProcessHook, &hookData);
>      virCommandSetMaxProcesses(cmd, cfg->maxProcesses);
>      virCommandSetMaxFiles(cmd, cfg->maxFiles);
> 

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140919/1ecaf8ff/attachment-0001.sig>


More information about the libvir-list mailing list