Bug 1140164 - RFE: qemu: support https cookie, timeout, sslverify and readahead settings
Summary: RFE: qemu: support https cookie, timeout, sslverify and readahead settings
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On: 1447413
Blocks: 1251748 1254282
TreeView+ depends on / blocked
 
Reported: 2014-09-10 12:05 UTC by Richard W.M. Jones
Modified: 2020-03-16 15:03 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-16 15:03:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2014-09-10 12:05:00 UTC
Description of problem:

(Note this is *not* needed for virt-v2v, or anything immediate, it
is just a general feature request)

qemu 2.2.0 curl driver supports a 'cookie' and a 'timeout' option.

The cookie is a single opaque string.  It can actually contain
multiple cookies in the same string.  The timeout is an integer
(timeout in seconds).

cookie option:
http://git.qemu.org/?p=qemu.git;a=commit;h=a94f83d94fdf907680f068f1be7ad13d1f697067

timeout option:
http://git.qemu.org/?p=qemu.git;a=commit;h=212aefaa53d142baa9a22f5aadd2e72eb916c0c0

Comment 1 Cole Robinson 2016-04-20 19:54:34 UTC
There's also the sslverify option. Possible XML extensions could look like

    <disk type='network' device='cdrom'>
      <source protocol="http" name="/path/to/file">
        <host name="myhost" port="443"/>
        <cookie>my-cookie-string</cookie>
        <timeout>60</timeout>
        <ssl verify='off'/>
      </source>
      ...
    </disk>

Which would map to qemu option like

-drive file=http://myhost:443/path/to/file,media=cdrom,file.cookie=my-cookie-data,file.timeout=60,file.sslverify=off

See this bug comment for a link to an example commit, extending the XML parser and qemu commandline building: https://bugzilla.redhat.com/show_bug.cgi?id=825939#c3

Comment 2 Richard W.M. Jones 2016-04-20 20:44:26 UTC
Pro-tip: Use the json:-style URLs, they are much easier to
create safely.

There is also the readahead setting.

Here is the virt-v2v code to do this:
https://github.com/libguestfs/libguestfs/blob/master/v2v/vCenter.ml#L214

Comment 3 Yaniv Kaul 2016-11-23 15:18:44 UTC
Why is the title about qemu if the bug is in libvirt?

Comment 4 Richard W.M. Jones 2016-11-24 09:50:04 UTC
libvirt should implement these qemu curl block driver features.

Comment 5 Yaniv Lavi 2017-01-04 15:56:06 UTC
We want to be able to use this function for RHV 4.2. Can you please consider it?

Comment 11 Daniel Berrangé 2017-05-02 16:38:22 UTC
FYI I filed this bug to track the enhancement needed in QEMU to support cookie setting https://bugzilla.redhat.com/show_bug.cgi?id=1447413

Comment 16 Martin Tessun 2018-11-22 09:58:30 UTC
As discussed in the quarterly planning there is currently no need for this feature.
As such closing this one.

Feel free to reopen with a justification why this feature is needed.

Thanks,
Martin

Comment 17 Peter Krempa 2018-11-22 10:25:05 UTC
This is still a valid feature request. I'll move it to the upstream tracker.

Comment 18 Peter Krempa 2020-03-09 16:25:07 UTC
Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2020-March/msg00247.html

Comment 19 Peter Krempa 2020-03-16 15:03:48 UTC
Feature added upstream:

d6db013c6e qemu: Pass through arguments of 'ssh' block driver used by libguestfs
d089234110 qemublocktest: Add JSON->JSON test cases for block device backends
7f8d0ca56a qemublocktest: XMLjsonXML: Test formatting/parsing of modern JSON
218ce53069 qemublocktest: Extract schema root for blockdev-add validation
1262cdede4 qemublocktest: Load QMP schema earlier
5179cc6b08 virStorageSourceParseBackingJSONUri: Handle undocumented value 'off' for sslverify
77194db01c virstoragefile: Add JSON parser for 'sslverify', 'readahead', 'cookies' and 'timeout'
9cac141cd6 qemu: block: Implement readahead and timeout properties for 'curl' driver
06d3e8d539 qemu: block: Add support for HTTP cookies
b512935b17 qemu: Handle hotplug and commandline for secret objects for http cookies
877cd35887 qemuDomainSecretStorageSourcePrepare: Setup secret for http cookies
4e8faa5cdc qemu: domain: Store data for 'secret' object representing http cookies
304da9376c qemu: block: Implement ssl verification configuration
3dd7952f6f qemuxml2argvtest: Add test case for disks with http(s) source
c1409e308f qemuDomainValidateStorageSource: Validate new network storage parameters
63fd461773 conf: Add support for setting timeout and readahead size for network disks
3b076391be conf: Add support for cookies for HTTP based disks
25481e25b1 conf: Add support for modifying ssl validation for https/ftps disks
43a3d2e02e qemuDomainGetSecretAESAlias: Replace outstanding uses with qemuAliasForSecret
70d2758a9c qemuDomainSecretStorageSourcePrepare: Change aliases for disk secrets
86fecaedf5 qemuDomainSecretAESSetupFromSecret: Use 'qemuAliasForSecret'
740dd1a4e5 qemu: Split out initialization of secrets for 'iscsi' hostdevs
95a8c4332d qemuDomainDeviceDiskDefPostParseRestoreSecAlias: Hardcode restored aliases
b05322fc03 qemuDomainSecretStorageSourcePrepare: Fix naming of alias variables
bb2a81df21 qemu: Introduce another helper for creating alias for a 'secret' object
f742461389 Remove qemuDomainSecretInfoNew
88663e59ef qemuDomainSecretAESSetup: Split out lookup of secret data
bad8637892 qemuDomainSecretAESSetup: Allocate and return 'secinfo' here
88126d5f0e qemuDomainSecretAESSetup: Automatically free non-secret locals
b544481a91 qemuDomainSecretInfo: Register autoptr cleanup function
7a34e04d82 qemuMigrationParamsResetTLS: Fix comment
3b61106550 qemuMigrationParamsResetTLS: Adapt to modern memory management
38bc76bcc1 qemu: Don't take double pointer in qemuDomainSecretInfoFree
4415b11d6b qemuBlockStorageSourceDetachPrepare: Get rid of cleanup section


Note You need to log in before you can comment on or make changes to this bug.