tests/functional/qemu_test/asset.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
The Python os.setxattr() API is Linux-specific, so trying to use
it on other OSes triggers a failure:
File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
line 227, in fetch
os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
^^^^^^^^^^^
AttributeError: module 'os' has no attribute 'setxattr'
Since we only set the attributes here for informational
purposes, skip them when os.setxattr() isn't available.
Cc: qemu-stable@nongnu.org
Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
tests/functional/qemu_test/asset.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 51a434b2b7..0abd89e0a3 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -223,11 +223,14 @@ def fetch(self):
raise AssetError(self, "Download retries exceeded", transient=True)
try:
- # Set these just for informational purposes
- os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
- self.url.encode('utf8'))
- os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
- self.hash.encode('utf8'))
+ # Set these just for informational purposes. Note that
+ # setxattr is Linux-only; as this is only informational
+ # we can simply skip it on other platforms.
+ if hasattr(os, "setxattr"):
+ os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
+ self.url.encode('utf8'))
+ os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
+ self.hash.encode('utf8'))
except OSError as e:
self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
--
2.43.0
On Fri, 1 May 2026 at 12:55, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> The Python os.setxattr() API is Linux-specific, so trying to use
> it on other OSes triggers a failure:
>
> File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> line 227, in fetch
> os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> ^^^^^^^^^^^
> AttributeError: module 'os' has no attribute 'setxattr'
>
> Since we only set the attributes here for informational
> purposes, skip them when os.setxattr() isn't available.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Is anybody going to pick this up via their tree, or should
I just put it into target-arm.next ?
thanks
-- PMM
On 11/05/2026 16.47, Peter Maydell wrote:
> On Fri, 1 May 2026 at 12:55, Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> The Python os.setxattr() API is Linux-specific, so trying to use
>> it on other OSes triggers a failure:
>>
>> File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
>> line 227, in fetch
>> os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
>> ^^^^^^^^^^^
>> AttributeError: module 'os' has no attribute 'setxattr'
>>
>> Since we only set the attributes here for informational
>> purposes, skip them when os.setxattr() isn't available.
>>
>> Cc: qemu-stable@nongnu.org
>> Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
> Is anybody going to pick this up via their tree, or should
> I just put it into target-arm.next ?
I currently don't have any other patches in my queue, so it would be great
if Daniel or you could take it.
Thanks,
Thomas
On Mon, May 11, 2026 at 03:47:33PM +0100, Peter Maydell wrote:
> On Fri, 1 May 2026 at 12:55, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > The Python os.setxattr() API is Linux-specific, so trying to use
> > it on other OSes triggers a failure:
> >
> > File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> > line 227, in fetch
> > os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> > ^^^^^^^^^^^
> > AttributeError: module 'os' has no attribute 'setxattr'
> >
> > Since we only set the attributes here for informational
> > purposes, skip them when os.setxattr() isn't available.
> >
> > Cc: qemu-stable@nongnu.org
> > Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
> Is anybody going to pick this up via their tree, or should
> I just put it into target-arm.next ?
I have it for my misc queue, but if you want to send a PR now then
consider it to havve
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
On Mon, 11 May 2026 at 16:16, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Mon, May 11, 2026 at 03:47:33PM +0100, Peter Maydell wrote:
> > On Fri, 1 May 2026 at 12:55, Peter Maydell <peter.maydell@linaro.org> wrote:
> > >
> > > The Python os.setxattr() API is Linux-specific, so trying to use
> > > it on other OSes triggers a failure:
> > >
> > > File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> > > line 227, in fetch
> > > os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> > > ^^^^^^^^^^^
> > > AttributeError: module 'os' has no attribute 'setxattr'
> > >
> > > Since we only set the attributes here for informational
> > > purposes, skip them when os.setxattr() isn't available.
> > >
> > > Cc: qemu-stable@nongnu.org
> > > Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> >
> > Is anybody going to pick this up via their tree, or should
> > I just put it into target-arm.next ?
>
> I have it for my misc queue, but if you want to send a PR now then
> consider it to havve
>
> Acked-by: Daniel P. Berrangé <berrange@redhat.com>
I probably won't have a full pullreq ready to send until the
end of the week, so feel free to keep it in your queue.
thanks
-- PMM
Am Fri, 1 May 2026 12:55:06 +0100
schrieb Peter Maydell <peter.maydell@linaro.org>:
> The Python os.setxattr() API is Linux-specific, so trying to use
> it on other OSes triggers a failure:
>
> File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> line 227, in fetch
> os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> ^^^^^^^^^^^
> AttributeError: module 'os' has no attribute 'setxattr'
>
> Since we only set the attributes here for informational
> purposes, skip them when os.setxattr() isn't available.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> tests/functional/qemu_test/asset.py | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
> index 51a434b2b7..0abd89e0a3 100644
> --- a/tests/functional/qemu_test/asset.py
> +++ b/tests/functional/qemu_test/asset.py
> @@ -223,11 +223,14 @@ def fetch(self):
> raise AssetError(self, "Download retries exceeded", transient=True)
>
> try:
> - # Set these just for informational purposes
> - os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> - self.url.encode('utf8'))
> - os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
> - self.hash.encode('utf8'))
> + # Set these just for informational purposes. Note that
> + # setxattr is Linux-only; as this is only informational
> + # we can simply skip it on other platforms.
> + if hasattr(os, "setxattr"):
> + os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> + self.url.encode('utf8'))
> + os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
> + self.hash.encode('utf8'))
> except OSError as e:
> self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
>
Reviewed-by: Thomas Huth <th.huth+qemu@posteo.eu>
Peter Maydell <peter.maydell@linaro.org> writes:
> The Python os.setxattr() API is Linux-specific, so trying to use
> it on other OSes triggers a failure:
>
> File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> line 227, in fetch
> os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> ^^^^^^^^^^^
> AttributeError: module 'os' has no attribute 'setxattr'
>
> Since we only set the attributes here for informational
> purposes, skip them when os.setxattr() isn't available.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> tests/functional/qemu_test/asset.py | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
> index 51a434b2b7..0abd89e0a3 100644
> --- a/tests/functional/qemu_test/asset.py
> +++ b/tests/functional/qemu_test/asset.py
> @@ -223,11 +223,14 @@ def fetch(self):
> raise AssetError(self, "Download retries exceeded", transient=True)
>
> try:
> - # Set these just for informational purposes
> - os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> - self.url.encode('utf8'))
> - os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
> - self.hash.encode('utf8'))
> + # Set these just for informational purposes. Note that
> + # setxattr is Linux-only; as this is only informational
> + # we can simply skip it on other platforms.
> + if hasattr(os, "setxattr"):
> + os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> + self.url.encode('utf8'))
> + os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
> + self.hash.encode('utf8'))
Well TIL:
attr -g qemu-asset-url /home/alex/.cache/qemu/download/ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a
Attribute "qemu-asset-url" had a 73 byte value for /home/alex/.cache/qemu/download/ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a:
https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day20.tar.xz
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> except OSError as e:
> self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
On Fri, May 01, 2026 at 12:55:06PM +0100, Peter Maydell wrote:
> The Python os.setxattr() API is Linux-specific, so trying to use
> it on other OSes triggers a failure:
>
> File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py",
> line 227, in fetch
> os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
> ^^^^^^^^^^^
> AttributeError: module 'os' has no attribute 'setxattr'
>
> Since we only set the attributes here for informational
> purposes, skip them when os.setxattr() isn't available.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset download & caching")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> tests/functional/qemu_test/asset.py | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel
© 2016 - 2026 Red Hat, Inc.