Add Qemu to SeaBIOS LCHS interface
cover Add Qemu to SeaBIOS LCHS interface
Non-standard logical geometries break under QEMU.
A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example 56 SPT (sectors per track). No matter what QEMU will guess - SeaBIOS, for large enough disks - will use LBA translation, which will report 63 SPT instead.
In addition we can not enforce SeaBIOS to rely on phyiscal geometries at all. A virtio-blk-pci virtual disk with 255 phyiscal heads can not report more than 16 physical heads when moved to an IDE controller, the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization.
By supplying the logical geometies directly we are able to support such "exotic" disks.
We will use fw_cfg to do just that.
Sam Eiderman (8):
block: Refactor macros - fix tabbing
block: Support providing LCHS from user
bootdevice: Add interface to gather LCHS
scsi: Propagate unrealize() callback to scsi-hd
bootdevice: Gather LCHS from all relevant devices
bootdevice: Refactor get_boot_devices_list
bootdevice: FW_CFG interface for LCHS values
hd-geo-test: Add tests for lchs override
bootdevice.c | 158 ++++++++++--- hw/block/virtio-blk.c | 6 + hw/ide/qdev.c | 7 +- hw/nvram/fw_cfg.c | 14 +- hw/scsi/scsi-bus.c | 15 ++ hw/scsi/scsi-disk.c | 14 ++ include/hw/block/block.h | 22 +- include/hw/scsi/scsi.h | 1 + include/sysemu/sysemu.h | 4 + tests/Makefile.include | 2 +- tests/hd-geo-test.c | 565 +++++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 767 insertions(+), 41 deletions(-)
Signature · 1 line
2.13.3
PATCH 1/8 block: Refactor macros - fix tabbing
Fixing tabbing in block related macros.
--- hw/ide/qdev.c | 2 +- include/hw/block/block.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-)
hw/ide/qdev.c +1 -1
@@ -285,7 +285,7 @@ static void ide_drive_realize(IDEDevice *dev, Error **errp)DEFINE_BLOCK_PROPERTIES (IDEDrive, dev.conf), \DEFINE_BLOCK_ERROR_PROPERTIES (IDEDrive, dev.conf), \DEFINE_PROP_STRING ("ver" , IDEDrive, dev.version), \ -DEFINE_PROP_UINT64 ("wwn" , IDEDrive, dev.wwn,0 ), \ +DEFINE_PROP_UINT64 ("wwn" , IDEDrive, dev.wwn,0 ), \DEFINE_PROP_STRING ("serial" , IDEDrive, dev.serial),\DEFINE_PROP_STRING ("model" , IDEDrive, dev.model)
include/hw/block/block.h +8 -8
@@ -50,21 +50,21 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf) _conf.logical_block_size), \DEFINE_PROP_BLOCKSIZE ("physical_block_size" , _state, \ _conf.physical_block_size), \ -DEFINE_PROP_UINT16 ("min_io_size" , _state, _conf.min_io_size,0 ), \ +DEFINE_PROP_UINT16 ("min_io_size" , _state, _conf.min_io_size,0 ), \DEFINE_PROP_UINT32 ("opt_io_size" , _state, _conf.opt_io_size,0 ), \ -DEFINE_PROP_UINT32 ("discard_granularity" , _state, \ - _conf.discard_granularity,-1 ), \ -DEFINE_PROP_ON_OFF_AUTO ("write-cache" , _state, _conf.wce, \ -ON_OFF_AUTO_AUTO ), \ +DEFINE_PROP_UINT32 ("discard_granularity" , _state, \ + _conf.discard_granularity,-1 ), \ +DEFINE_PROP_ON_OFF_AUTO ("write-cache" , _state, _conf.wce, \ +ON_OFF_AUTO_AUTO ), \ DEFINE_PROP_BOOL("share-rw", _state, _conf.share_rw, false) #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \DEFINE_PROP_DRIVE ("drive" , _state, _conf.blk), \ DEFINE_BLOCK_PROPERTIES_BASE(_state, _conf) -#define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \ -DEFINE_PROP_UINT32 ("cyls" , _state, _conf.cyls,0 ), \ -DEFINE_PROP_UINT32 ("heads" , _state, _conf.heads,0 ), \ +#define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \ +DEFINE_PROP_UINT32 ("cyls" , _state, _conf.cyls,0 ), \ +DEFINE_PROP_UINT32 ("heads" , _state, _conf.heads,0 ), \ DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0) #define DEFINE_BLOCK_ERROR_PROPERTIES(_state, _conf) \
Signature · 1 line
2.13.3
PATCH 2/8 block: Support providing LCHS from user
In reply to Sam EidermanAdd logical geometry variables to BlockConf.
A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs").
These devices include:
* ide-hd
* scsi-hd
* virtio-blk-pci
In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines.
--- include/hw/block/block.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/hw/block/block.h +5 -1
@@ -26,6 +26,7 @@ typedef struct BlockConf {uint32_t discard_granularity;/* geometry, not all devices use this */ uint32_t cyls, heads, secs; +uint32_t lcyls, lheads, lsecs;OnOffAuto wce;bool share_rw;BlockdevOnError rerror;
@@ -65,7 +66,10 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf)#define DEFINE_BLOCK_CHS_PROPERTIES (_state, _conf) \ DEFINE_PROP_UINT32("cyls", _state, _conf.cyls, 0), \ DEFINE_PROP_UINT32("heads", _state, _conf.heads, 0), \ - DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0) + DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0), \ + DEFINE_PROP_UINT32("lcyls", _state, _conf.lcyls, 0), \ + DEFINE_PROP_UINT32("lheads", _state, _conf.lheads, 0), \ + DEFINE_PROP_UINT32("lsecs", _state, _conf.lsecs, 0)#define DEFINE_BLOCK_ERROR_PROPERTIES (_state, _conf) \ DEFINE_PROP_BLOCKDEV_ON_ERROR("rerror", _state, _conf.rerror, \
Signature · 1 line
2.13.3
PATCH 3/8 bootdevice: Add interface to gather LCHS
In reply to Sam EidermanAdd an interface to provide direct logical CHS values for boot devices. We will use this interface in the next commits.
--- bootdevice.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ include/sysemu/sysemu.h | 3 +++ 2 files changed, 58 insertions(+)
bootdevice.c +55 -0
@@ -343,3 +343,58 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,/* initialize devices' bootindex property to -1 */ object_property_set_int (obj,-1 , name,NULL ); } + +typedef struct FWLCHSEntry FWLCHSEntry ; + +struct FWLCHSEntry { +QTAILQ_ENTRY (FWLCHSEntry) link; +DeviceState *dev; +char *suffix; +uint32_t lcyls; +uint32_t lheads; +uint32_t lsecs; +}; + +static QTAILQ_HEAD(, FWLCHSEntry) fw_lchs = +QTAILQ_HEAD_INITIALIZER (fw_lchs); + +void add_boot_device_lchs (DeviceState *dev,const char *suffix, +uint32_t lcyls,uint32_t lheads,uint32_t lsecs) +{ +FWLCHSEntry *node; + +if (!lcyls && !lheads && !lsecs) { +return ; + } + +assert (dev !=NULL || suffix !=NULL ); + + node =g_malloc0 (sizeof (FWLCHSEntry)); + node->suffix =g_strdup (suffix); + node->dev = dev; + node->lcyls = lcyls; + node->lheads = lheads; + node->lsecs = lsecs; + +QTAILQ_INSERT_TAIL (&fw_lchs, node, link); +} + +void del_boot_device_lchs (DeviceState *dev,const char *suffix) +{ +FWLCHSEntry *i; + +if (dev ==NULL ) { +return ; + } + + QTAILQ_FOREACH(i, &fw_lchs, link) { +if ((!suffix || !g_strcmp0 (i->suffix, suffix)) && + i->dev == dev) { +QTAILQ_REMOVE (&fw_lchs, i, link); +g_free (i->suffix); +g_free (i); + +break ; + } + } +}
include/sysemu/sysemu.h +3 -0
@@ -171,6 +171,9 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, DeviceState *dev, Error **errp);void restore_boot_order (void *opaque);void validate_bootdevices (const char *devices,Error **errp); +void add_boot_device_lchs (DeviceState *dev,const char *suffix, +uint32_t lcyls,uint32_t lheads,uint32_t lsecs); +void del_boot_device_lchs (DeviceState *dev,const char *suffix);/* handler to set the boot_device order for a specific type of MachineClass */ typedef void QEMUBootSetHandler(void *opaque, const char *boot_order,
Signature · 1 line
2.13.3
PATCH 4/8 scsi: Propagate unrealize() callback to scsi-hd
In reply to Sam EidermanWe will need to add LCHS removal logic to scsi-hd's unrealize() in the next commit.
--- hw/scsi/scsi-bus.c | 15 +++++++++++++++ include/hw/scsi/scsi.h | 1 + 2 files changed, 16 insertions(+)
hw/scsi/scsi-bus.c +15 -0
@@ -55,6 +55,14 @@ static void scsi_device_realize(SCSIDevice *s, Error **errp) } } +static void scsi_device_unrealize (SCSIDevice *s,Error **errp) +{ +SCSIDeviceClass *sc =SCSI_DEVICE_GET_CLASS (s); +if (sc->unrealize) { + sc->unrealize (s, errp); + } +} +int scsi_bus_parse_cdb (SCSIDevice *dev,SCSICommand *cmd,uint8_t *buf,void *hba_private) {
@@ -213,11 +221,18 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)static void scsi_qdev_unrealize (DeviceState *qdev,Error **errp) {SCSIDevice *dev =SCSI_DEVICE (qdev); +Error *local_err =NULL ;if (dev->vmsentry) {qemu_del_vm_change_state_handler (dev->vmsentry); } +scsi_device_unrealize (dev, &local_err); +if (local_err) { +error_propagate (errp, local_err); +return ; + } +scsi_device_purge_requests (dev,SENSE_CODE (NO_SENSE ));blockdev_mark_auto_del (dev->conf.blk); }
include/hw/scsi/scsi.h +1 -0
@@ -59,6 +59,7 @@ struct SCSIRequest { typedef struct SCSIDeviceClass { DeviceClass parent_class; void (*realize)(SCSIDevice *dev, Error **errp); + void (*unrealize)(SCSIDevice *dev, Error **errp); int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, void *hba_private); SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
Signature · 1 line
2.13.3
PATCH 5/8 bootdevice: Gather LCHS from all relevant devices
In reply to Sam EidermanRelevant devices are:
* ide-hd (and ide-cd, ide-drive)
* scsi-hd (and scsi-cd, scsi-disk, scsi-block)
* virtio-blk-pci
We do not call del_boot_device_lchs() for ide-* since we don't need to - IDE block devices do not support unplugging.
--- hw/block/virtio-blk.c | 6 ++++++ hw/ide/qdev.c | 5 +++++ hw/scsi/scsi-disk.c | 14 ++++++++++++++ 3 files changed, 25 insertions(+)
hw/block/virtio-blk.c +6 -0
@@ -1182,6 +1182,11 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)blk_set_guest_block_size (s->blk, s->conf.conf.logical_block_size);blk_iostatus_enable (s->blk); + +add_boot_device_lchs (dev,"/disk@0,0" , + (&conf->conf)->lcyls, + (&conf->conf)->lheads, + (&conf->conf)->lsecs); }static void virtio_blk_device_unrealize (DeviceState *dev,Error **errp)
@@ -1189,6 +1194,7 @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)VirtIODevice *vdev =VIRTIO_DEVICE (dev);VirtIOBlock *s =VIRTIO_BLK (dev); +del_boot_device_lchs (dev,"/disk@0,0" );virtio_blk_data_plane_destroy (s->dataplane); s->dataplane =NULL ;qemu_del_vm_change_state_handler (s->change);
hw/ide/qdev.c +5 -0
@@ -215,6 +215,11 @@ static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp)add_boot_device_path (dev->conf.bootindex, &dev->qdev, dev->unit ?"/disk@1" :"/disk@0" ); + +add_boot_device_lchs (&dev->qdev, dev->unit ?"/disk@1" :"/disk@0" , + (&dev->conf)->lcyls, + (&dev->conf)->lheads, + (&dev->conf)->lsecs); } static void ide_dev_get_bootindex(Object *obj, Visitor *v, const char *name,
hw/scsi/scsi-disk.c +14 -0
@@ -2390,6 +2390,16 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)blk_set_guest_block_size (s->qdev.conf.blk, s->qdev.blocksize);blk_iostatus_enable (s->qdev.conf.blk); + +add_boot_device_lchs (&dev->qdev,NULL , + (&dev->conf)->lcyls, + (&dev->conf)->lheads, + (&dev->conf)->lsecs); +} + +static void scsi_unrealize (SCSIDevice *dev,Error **errp) +{ +del_boot_device_lchs (&dev->qdev,NULL ); }static void scsi_hd_realize (SCSIDevice *dev,Error **errp)
@@ -2988,6 +2998,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data)SCSIDeviceClass *sc =SCSI_DEVICE_CLASS (klass); sc->realize = scsi_hd_realize; + sc->unrealize = scsi_unrealize; sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI disk" ;
@@ -3019,6 +3030,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data)SCSIDeviceClass *sc =SCSI_DEVICE_CLASS (klass); sc->realize = scsi_cd_realize; + sc->unrealize = scsi_unrealize; sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc ="virtual SCSI CD-ROM" ;
@@ -3054,6 +3066,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data)SCSIDiskClass *sdc =SCSI_DISK_BASE_CLASS (klass); sc->realize = scsi_block_realize; + sc->unrealize = scsi_unrealize; sc->alloc_req = scsi_block_new_request; sc->parse_cdb = scsi_block_parse_cdb; sdc->dma_readv = scsi_block_dma_readv;
@@ -3095,6 +3108,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data)SCSIDeviceClass *sc =SCSI_DEVICE_CLASS (klass); sc->realize = scsi_disk_realize; + sc->unrealize = scsi_unrealize; sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->fw_name ="disk" ;
Signature · 1 line
2.13.3
PATCH 6/8 bootdevice: Refactor get_boot_devices_list
In reply to Sam EidermanMove device name construction to a separate function.
We will reuse this function in the following commit to pass logical CHS parameters through fw_cfg much like we currently pass bootindex.
--- bootdevice.c | 61 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 27 deletions(-)
bootdevice.c +34 -27
@@ -202,6 +202,39 @@ DeviceState *get_boot_device(uint32_t position)return res; } +static char *get_boot_device_path (DeviceState *dev,bool ignore_suffixes, +char *suffix) +{ +char *devpath =NULL , *s =NULL , *d, *bootpath; + +if (dev) { + devpath =qdev_get_fw_dev_path (dev); +assert (devpath); + } + +if (!ignore_suffixes) { +if (dev) { + d =qdev_get_own_fw_dev_path_from_handler (dev->parent_bus, dev); +if (d) { +assert (!suffix); + s = d; + }else { + s =g_strdup (suffix); + } + }else { + s =g_strdup (suffix); + } + } + + bootpath =g_strdup_printf ("%s%s" , + devpath ? devpath :"" , + s ? s :"" ); +g_free (devpath); +g_free (s); + +return bootpath; +} +/* * This function returns null terminated string that consist of new line * separated device paths.
@@ -218,36 +251,10 @@ char *get_boot_devices_list(size_t *size)bool ignore_suffixes = mc->ignore_boot_device_suffixes; QTAILQ_FOREACH(i, &fw_boot_order, link) { -char *devpath =NULL , *suffix =NULL ;char *bootpath; -char *d;size_t len; -if (i->dev) { - devpath =qdev_get_fw_dev_path (i->dev); -assert (devpath); - } - -if (!ignore_suffixes) { -if (i->dev) { - d =qdev_get_own_fw_dev_path_from_handler (i->dev->parent_bus, - i->dev); -if (d) { -assert (!i->suffix); - suffix = d; - }else { - suffix =g_strdup (i->suffix); - } - }else { - suffix =g_strdup (i->suffix); - } - } - - bootpath =g_strdup_printf ("%s%s" , - devpath ? devpath :"" , - suffix ? suffix :"" ); -g_free (devpath); -g_free (suffix); + bootpath =get_boot_device_path (i->dev, ignore_suffixes, i->suffix);if (total) { list[total-1 ] ='\n' ;
Signature · 1 line
2.13.3
PATCH 7/8 bootdevice: FW_CFG interface for LCHS values
In reply to Sam EidermanUsing fw_cfg, supply logical CHS values directly from QEMU to the BIOS.
Non-standard logical geometries break under QEMU.
A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example 56 SPT (sectors per track). No matter what QEMU will report - SeaBIOS, for large enough disks - will use LBA translation, which will report 63 SPT instead.
In addition we cannot force SeaBIOS to rely on physical geometries at all. A virtio-blk-pci virtual disk with 255 phyiscal heads cannot report more than 16 physical heads when moved to an IDE controller, since the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization.
By supplying the logical geometries directly we are able to support such "exotic" disks.
We serialize this information in a similar way to the "bootorder" interface.
The fw_cfg entry is "bootdevices" and it serializes a struct. At the moment the struct holds the values of logical CHS values but it can be expanded easily due to the extendable ABI implemented.
(In the future, we can pass the bootindex through "bootdevices" instead "bootorder" - unifying all bootdevice information in one fw_cfg value)
The PV interface through fw_cfg could have also been implemented using device specific keys, e.g.: "/etc/bootdevice/%s/logical_geometry" where %s is the device name QEMU produces - but this implementation would require much more code refactoring, both in QEMU and SeaBIOS, so the current implementation was chosen.
--- bootdevice.c | 42 ++++++++++++++++++++++++++++++++++++++++++ hw/nvram/fw_cfg.c | 14 +++++++++++--- include/sysemu/sysemu.h | 1 + 3 files changed, 54 insertions(+), 3 deletions(-)
bootdevice.c +42 -0
@@ -405,3 +405,45 @@ void del_boot_device_lchs(DeviceState *dev, const char *suffix) } } } + +typedef struct QEMU_PACKED BootDeviceEntrySerialized { +/* Do not change field order - add new fields below */ +uint32_t lcyls; +uint32_t lheads; +uint32_t lsecs; +} BootDeviceEntrySerialized; + +/* Serialized as: struct size (4) + (device name\0 + device struct) x devices */ +char *get_boot_devices_info (size_t *size) +{ +FWLCHSEntry *i; +BootDeviceEntrySerialized s; +size_t total =0 ; +char *list =NULL ; + + list =g_malloc0 (sizeof (uint32_t )); + *((uint32_t *)list) = (uint32_t )sizeof (s); + total =sizeof (uint32_t ); + + QTAILQ_FOREACH(i, &fw_lchs, link) { +char *bootpath; +size_t len; + + bootpath =get_boot_device_path (i->dev, false, i->suffix); + s.lcyls = i->lcyls; + s.lheads = i->lheads; + s.lsecs = i->lsecs; + + len =strlen (bootpath) +1 ; + list =g_realloc (list, total + len +sizeof (s)); +memcpy (&list[total], bootpath, len); +memcpy (&list[total + len], &s,sizeof (s)); + total += len +sizeof (s); + +g_free (bootpath); + } + + *size = total; + +return list; +}
hw/nvram/fw_cfg.c +11 -3
@@ -916,13 +916,21 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,static void fw_cfg_machine_reset (void *opaque) { +MachineClass *mc =MACHINE_GET_CLASS (qdev_get_machine ()); +FWCfgState *s = opaque;void *ptr;size_t len; -FWCfgState *s = opaque; -char *bootindex =get_boot_devices_list (&len); +char *buf; - ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)bootindex, len); + buf =get_boot_devices_list (&len); + ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)buf, len);g_free (ptr); + +if (!mc->legacy_fw_cfg_order) { + buf =get_boot_devices_info (&len); + ptr =fw_cfg_modify_file (s,"bootdevices" , (uint8_t *)buf, len); +g_free (ptr); + } }static void fw_cfg_machine_ready (struct Notifier *n,void *data)
include/sysemu/sysemu.h +1 -0
@@ -174,6 +174,7 @@ void validate_bootdevices(const char *devices, Error **errp);void add_boot_device_lchs (DeviceState *dev,const char *suffix,uint32_t lcyls,uint32_t lheads,uint32_t lsecs);void del_boot_device_lchs (DeviceState *dev,const char *suffix); +char *get_boot_devices_info (size_t *size);/* handler to set the boot_device order for a specific type of MachineClass */ typedef void QEMUBootSetHandler(void *opaque, const char *boot_order,
Signature · 1 line
2.13.3
Re: [Qemu-devel] [QEMU] [PATCH 7/8] bootdevice: FW_CFG interface for LCHS values
Quoted 20 lines · Sam Eiderman
Using
fw_cfg, supply logical CHS values directly from QEMU to the BIOS.Non-standard logical geometries break under QEMU.
A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example 56 SPT (sectors per track). No matter what QEMU will report - SeaBIOS, for large enough disks - will use LBA translation, which will report 63 SPT instead.
In addition we cannot force SeaBIOS to rely on physical geometries at all. A virtio-blk-pci virtual disk with 255 phyiscal heads cannot report more than 16 physical heads when moved to an IDE controller, since the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization.
By supplying the logical geometries directly we are able to support such "exotic" disks.
Quoted 8 lines
We serialize this information in a similar way to the "bootorder" interface.
Thefw_cfgentry is "bootdevices" and it serializes a struct. At the moment the struct holds the values of logical CHS values but it can be expanded easily due to the extendable ABI implemented.(In the future, we can pass the bootindex through "bootdevices" instead "bootorder" - unifying all bootdevice information in one
fw_cfgvalue)
I would disagree with that. UEFI guest firmware doesn't seem to have any use for this new type of information ("logical CHS values"), so the current interface (the "bootorder" fw_cfg file) should continue to work. The ArmVirtQemu and OVMF platform firmwares (built from the edk2 project, and bundled with QEMU 4.1+) implement some serious parsing and processing for "bootorder".
Independently, another comment:
Quoted 41 lines
The PV interface through
fw_cfgcould have also been implemented using device specific keys, e.g.: "/etc/bootdevice/%s/logical_geometry" where %s is the device name QEMU produces - but this implementation would require much more code refactoring, both in QEMU and SeaBIOS, so the current implementation was chosen.Reviewed-by Karl Heubaum <[email protected]>Reviewed-by Arbel Moshe <[email protected]>Signed-off-by Sam Eiderman <[email protected]>--- bootdevice.c | 42 ++++++++++++++++++++++++++++++++++++++++++ hw/nvram/fw_cfg.c | 14 +++++++++++--- include/sysemu/sysemu.h | 1 + 3 files changed, 54 insertions(+), 3 deletions(-)bootdevice.c +18
-0@@ -405,3 +405,45 @@ void del_boot_device_lchs(DeviceState *dev, const char *suffix) } } } + +typedef struct QEMU_PACKED BootDeviceEntrySerialized { +/* Do not change field order - add new fields below */ +uint32_t lcyls; +uint32_t lheads; +uint32_t lsecs; +} BootDeviceEntrySerialized; + +/* Serialized as: struct size (4) + (device name\0 + device struct) x devices */ +char *get_boot_devices_info (size_t *size) +{ +FWLCHSEntry *i; +BootDeviceEntrySerialized s; +size_t total =0 ; +char *list =NULL ; + + list =g_malloc0 (sizeof (uint32_t )); + *((uint32_t *)list) = (uint32_t )sizeof (s);
bootdevice.c void del_boot_device_lchs(DeviceState *dev, const char *suffix) · line 435
Quoted 10 lines
bootdevice.c +10
-0+ total =sizeof (uint32_t ); + + QTAILQ_FOREACH(i, &fw_lchs, link) { +char *bootpath; +size_t len; + + bootpath =get_boot_device_path (i->dev, false, i->suffix); + s.lcyls = i->lcyls; + s.lheads = i->lheads; + s.lsecs = i->lsecs;
You should document the endianness of the fields in BootDeviceEntrySerialized, and then call byte order conversion functions here accordingly (most probably cpu_to_le32()).
As written, this code would break if you ran qemu-system-x86_64 / qemu-system-i386 (with TCG acceleration) on a big endian host.
Thanks
Laszlo
Quoted 56 lines
bootdevice.c +14
-0+ + len =strlen (bootpath) +1 ; + list =g_realloc (list, total + len +sizeof (s)); +memcpy (&list[total], bootpath, len); +memcpy (&list[total + len], &s,sizeof (s)); + total += len +sizeof (s); + +g_free (bootpath); + } + + *size = total; + +return list; +}hw/nvram/fw_cfg.c +11
-3@@ -916,13 +916,21 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,static void fw_cfg_machine_reset (void *opaque) { +MachineClass *mc =MACHINE_GET_CLASS (qdev_get_machine ()); +FWCfgState *s = opaque;void *ptr;size_t len; -FWCfgState *s = opaque; -char *bootindex =get_boot_devices_list (&len); +char *buf; - ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)bootindex, len); + buf =get_boot_devices_list (&len); + ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)buf, len);g_free (ptr); + +if (!mc->legacy_fw_cfg_order) { + buf =get_boot_devices_info (&len); + ptr =fw_cfg_modify_file (s,"bootdevices" , (uint8_t *)buf, len); +g_free (ptr); + } }static void fw_cfg_machine_ready (struct Notifier *n,void *data)include/sysemu/sysemu.h +1
-0@@ -174,6 +174,7 @@ void validate_bootdevices(const char *devices, Error **errp);void add_boot_device_lchs (DeviceState *dev,const char *suffix,uint32_t lcyls,uint32_t lheads,uint32_t lsecs);void del_boot_device_lchs (DeviceState *dev,const char *suffix); +char *get_boot_devices_info (size_t *size);/* handler to set the boot_device order for a specific type of MachineClass */ typedef void QEMUBootSetHandler(void *opaque, const char *boot_order,
Re: [Qemu-devel] [QEMU] [PATCH 7/8] bootdevice: FW_CFG interface for LCHS values
Quoted 34 lines · Laszlo Ersek
Quoted 20 lines · Sam Eiderman
Using
fw_cfg, supply logical CHS values directly from QEMU to the BIOS.Non-standard logical geometries break under QEMU.
A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example 56 SPT (sectors per track). No matter what QEMU will report - SeaBIOS, for large enough disks - will use LBA translation, which will report 63 SPT instead.
In addition we cannot force SeaBIOS to rely on physical geometries at all. A virtio-blk-pci virtual disk with 255 phyiscal heads cannot report more than 16 physical heads when moved to an IDE controller, since the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization.
By supplying the logical geometries directly we are able to support such "exotic" disks.
Quoted 8 lines
We serialize this information in a similar way to the "bootorder" interface.
Thefw_cfgentry is "bootdevices" and it serializes a struct. At the moment the struct holds the values of logical CHS values but it can be expanded easily due to the extendable ABI implemented.(In the future, we can pass the bootindex through "bootdevices" instead "bootorder" - unifying all bootdevice information in one
fw_cfgvalue)
Quoted 6 lines
I would disagree with that. UEFI guest firmware doesn't seem to have any use for this new type of information ("logical CHS values"), so the current interface (the "bootorder"
fw_cfgfile) should continue to work. The ArmVirtQemu and OVMF platform firmwares (built from the edk2 project, and bundled with QEMU 4.1+) implement some serious parsing and processing for "bootorder”.
I agree, I didn’t mean to say that “bootdevices" will replace “bootorder”, they will have to reside side by side.
I just meant to emphasis that bootorder is not extendible - adding more disk specific fields other than bootorder (that for some platforms will be unused) is not possible. “bootdevices” will work for LCHS, if another entry has to be passed - it can be added to “bootdevice”.
Migrating “bootorder” into a different fw_cfg value is a tedious, probably not worth it, effort.
Quoted 59 lines
Independently, another comment:
Quoted 41 lines
The PV interface through
fw_cfgcould have also been implemented using device specific keys, e.g.: "/etc/bootdevice/%s/logical_geometry" where %s is the device name QEMU produces - but this implementation would require much more code refactoring, both in QEMU and SeaBIOS, so the current implementation was chosen.Reviewed-by Karl Heubaum <[email protected]>Reviewed-by Arbel Moshe <[email protected]>Signed-off-by Sam Eiderman <[email protected]>---
bootdevice.c | 42 ++++++++++++++++++++++++++++++++++++++++++ hw/nvram/fw_cfg.c | 14 +++++++++++--- include/sysemu/sysemu.h | 1 + 3 files changed, 54 insertions(+), 3 deletions(-)bootdevice.c +18
-0@@ -405,3 +405,45 @@ void del_boot_device_lchs(DeviceState *dev, const char *suffix) } } } + +typedef struct QEMU_PACKED BootDeviceEntrySerialized { +/* Do not change field order - add new fields below */ +uint32_t lcyls; +uint32_t lheads; +uint32_t lsecs; +} BootDeviceEntrySerialized; + +/* Serialized as: struct size (4) + (device name\0 + device struct) x devices */ +char *get_boot_devices_info (size_t *size) +{ +FWLCHSEntry *i; +BootDeviceEntrySerialized s; +size_t total =0 ; +char *list =NULL ; + + list =g_malloc0 (sizeof (uint32_t )); + *((uint32_t *)list) = (uint32_t )sizeof (s);bootdevice.c void del_boot_device_lchs(DeviceState *dev, const char *suffix) · line 435
Quoted 10 lines
bootdevice.c +10
-0+ total =sizeof (uint32_t ); + + QTAILQ_FOREACH(i, &fw_lchs, link) { +char *bootpath; +size_t len; + + bootpath =get_boot_device_path (i->dev, false, i->suffix); + s.lcyls = i->lcyls; + s.lheads = i->lheads; + s.lsecs = i->lsecs;You should document the endianness of the fields in BootDeviceEntrySerialized, and then call byte order conversion functions here accordingly (most probably
cpu_to_le32()).
Quoted 2 lines
As written, this code would break if you ran qemu-system-x86_64 / qemu-system-i386 (with TCG acceleration) on a big endian host.
Nice catch, thanks!
Quoted 59 lines
Thanks
LaszloQuoted 55 lines
bootdevice.c +14
-0+ + len =strlen (bootpath) +1 ; + list =g_realloc (list, total + len +sizeof (s)); +memcpy (&list[total], bootpath, len); +memcpy (&list[total + len], &s,sizeof (s)); + total += len +sizeof (s); + +g_free (bootpath); + } + + *size = total; + +return list; +}hw/nvram/fw_cfg.c +11
-3@@ -916,13 +916,21 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,static void fw_cfg_machine_reset (void *opaque) { +MachineClass *mc =MACHINE_GET_CLASS (qdev_get_machine ()); +FWCfgState *s = opaque;void *ptr;size_t len; -FWCfgState *s = opaque; -char *bootindex =get_boot_devices_list (&len); +char *buf; - ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)bootindex, len); + buf =get_boot_devices_list (&len); + ptr =fw_cfg_modify_file (s,"bootorder" , (uint8_t *)buf, len);g_free (ptr); + +if (!mc->legacy_fw_cfg_order) { + buf =get_boot_devices_info (&len); + ptr =fw_cfg_modify_file (s,"bootdevices" , (uint8_t *)buf, len); +g_free (ptr); + } }static void fw_cfg_machine_ready (struct Notifier *n,void *data)include/sysemu/sysemu.h +1
-0@@ -174,6 +174,7 @@ void validate_bootdevices(const char *devices, Error **errp);void add_boot_device_lchs (DeviceState *dev,const char *suffix,uint32_t lcyls,uint32_t lheads,uint32_t lsecs);void del_boot_device_lchs (DeviceState *dev,const char *suffix); +char *get_boot_devices_info (size_t *size);/* handler to set the boot_device order for a specific type of MachineClass */ typedef void QEMUBootSetHandler(void *opaque, const char *boot_order,
PATCH 8/8 hd-geo-test: Add tests for lchs override
In reply to Sam EidermanAdd QTest tests to check the logical geometry override option.
The tests in hd-geo-test are out of date - they only test IDE and do not test interesting MBRs.
I added a few helper functions which will make adding more tests easier.
QTest's fw_cfg helper functions support only legacy fw_cfg, so I had to read the new fw_cfg layout on my own.
Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR.
--- tests/Makefile.include | 2 +- tests/hd-geo-test.c | 565 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 566 insertions(+), 1 deletion(-)
tests/Makefile.include +1 -1
@@ -765,7 +765,7 @@ tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y) tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y) qemu-img$(EXESUF) tests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o tests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o -tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o +tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o $(libqos-obj-y) tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y) tests/boot-serial-test$(EXESUF): tests/boot-serial-test.o $(libqos-obj-y) tests/bios-tables-test$(EXESUF): tests/bios-tables-test.o \
tests/hd-geo-test.c +565 -0
584 lines not on this page · raw message
Signature · 1 line
2.13.3
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Subject: [SeaBIOS] [QEMU] [PATCH 0/8] Add Qemu to SeaBIOS LCHS interface
Type: series
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'a9a0cfc956 hd-geo-test: Add tests for lchs override d1b86f9f47 bootdevice: FW_CFG interface for LCHS values 48dd083d65 bootdevice: Refactor get_boot_devices_list f37e8f7c3c bootdevice: Gather LCHS from all relevant devices 8a7193c16b scsi: Propagate unrealize() callback to scsi-hd c0a3a43fe2 bootdevice: Add interface to gather LCHS 9ebc9c1fd9 block: Support providing LCHS from user 6593400075 block: Refactor macros - fix tabbing
=== OUTPUT BEGIN ===
1/8 Checking commit 659340007537 (block: Refactor macros - fix tabbing)
ERROR: Macros with complex values should be enclosed in parenthesis #55: FILE: include/hw/block/block.h:65:
+#define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \
+ DEFINE_PROP_UINT32("cyls", _state, _conf.cyls, 0), \
+ DEFINE_PROP_UINT32("heads", _state, _conf.heads, 0), \
DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0)total: 1 errors, 0 warnings, 37 lines checked
Patch 1/8 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
2/8 Checking commit 9ebc9c1fd9a2 (block: Support providing LCHS from user) 3/8 Checking commit c0a3a43fe22e (bootdevice: Add interface to gather LCHS) 4/8 Checking commit 8a7193c16bb9 (scsi: Propagate unrealize() callback to scsi-hd) 5/8 Checking commit f37e8f7c3cc6 (bootdevice: Gather LCHS from all relevant devices) 6/8 Checking commit 48dd083d65ed (bootdevice: Refactor get_boot_devices_list) 7/8 Checking commit d1b86f9f478c (bootdevice: FW_CFG interface for LCHS values) 8/8 Checking commit a9a0cfc956a7 (hd-geo-test: Add tests for lchs override) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 === TEST SCRIPT END ===
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg -iquote /tmp/qemu-test/src/tcg/i386 -I/tmp/qemu-test/src/linux-headers -I/tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -I/usr/include/pixman-1 -I/tmp/qemu-test/src/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/pixman-1 -I/tmp/qemu-test/src/tests -MMD -MP -MT tests/tpm-tis-swtpm-test.o -MF tests/tpm-tis-swtpm-test.d -fsanitize=undefined -fsanitize=address -g -c -o tests/tpm-tis-swtpm-test.o /tmp/qemu-test/src/tests/tpm-tis-swtpm-test.c
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg -iquote /tmp/qemu-test/src/tcg/i386 -I/tmp/qemu-test/src/linux-headers -I/tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -I/usr/include/pixman-1 -I/tmp/qemu-test/src/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/pixman-1 -I/tmp/qemu-test/src/tests -MMD -MP -MT tests/tpm-tis-test.o -MF tests/tpm-tis-test.d -fsanitize=undefined -fsanitize=address -g -c -o tests/tpm-tis-test.o /tmp/qemu-test/src/tests/tpm-tis-test.c
clang -iquote /tmp/qemu-test/build/. -iquote . -iquote /tmp/qemu-test/src/tcg -iquote /tmp/qemu-test/src/tcg/i386 -I/tmp/qemu-test/src/linux-headers -I/tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -I/tmp/qemu-test/src/tests/fp -I/tmp/qemu-test/src/tests/fp/berkeley-softfloat-3/source/include -I/tmp/qemu-test/src/tests/fp/berkeley-softfloat-3/source/8086-SSE -I/tmp/qemu-test/src/tests/fp/berkeley-testfloat-3/source -I/usr/include/pixman-1 -I/tmp/qemu-test/src/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/pixman-1 -DHW_POISON_H -DTARGET_ARM -DSOFTFLOAT_ROUND_ODD -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 -DSOFTFLOAT_FAST_INT64 -DFLOAT16 -DFLOAT64 -DEXTFLOAT80 -DFLOAT128 -DFLOAT_ROUND_ODD -DLONG_DOUBLE_IS_EXTFLOAT80 -Wno-strict-prototypes -Wno-unknown-pragmas -Wno-uninitialized -Wno-missing-prototypes -Wno-return-type -Wno-unused-function -Wno-error -MMD -MP -MT test_a_i64_z_f16.o -MF ./test_a_i64_z_f16.d -fsanitize=undefined -fsanitize=address -g -c -o test_a_i64_z_f16.o /tmp/qemu-test/src/tests/fp/berkeley-testfloat-3/source/test_a_i64_z_f16.c/tmp/qemu-test/src/tests/hd-geo-test.c:743:47: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/ide@1,1/drive@0/disk@0", 10000, 120, 30},
^~~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:744:47: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/ide@1,1/drive@0/disk@1", 9000, 120, 30},
^~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:745:47: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/ide@1,1/drive@1/disk@0", 0, 1, 1},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:746:47: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/ide@1,1/drive@1/disk@1", 1, 0, 0},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:747:16: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{NULL, 0, 0, 0}
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:764:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@0,0", 10000, 120, 30},
^~~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:765:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@1,0", 9000, 120, 30},
^~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:766:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@2,0", 1, 0, 0},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:767:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@3,0", 0, 1, 0},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:768:16: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{NULL, 0, 0, 0}
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:786:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@0,0", 10000, 120, 30},
^~~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:787:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/channel@0/disk@1,0", 9000, 120, 30},
^~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:788:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@4/channel@0/disk@0,1", 1, 0, 0},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:789:50: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@4/channel@0/disk@1,2", 0, 1, 0},
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:790:16: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{NULL, 0, 0, 0}
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:809:40: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@3/disk@0,0", 10000, 120, 30},
^~~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:810:40: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{"/pci@i0cf8/scsi@4/disk@0,0", 9000, 120, 30},
^~~~~~~~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:811:16: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{NULL, 0, 0, 0}
^~~~~~~
{ }
/tmp/qemu-test/src/tests/hd-geo-test.c:824:16: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
{NULL, 0, 0, 0}
^~~~~~~
{ }fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.
clang -iquote /tmp/qemu-test/build/tests -iquote tests -iquote /tmp/qemu-test/src/tcg -iquote /tmp/qemu-test/src/tcg/i386 -I/tmp/qemu-test/src/linux-headers -I/tmp/qemu-test/build/linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote /tmp/qemu-test/src/accel/tcg -iquote /tmp/qemu-test/src/include -I/usr/include/pixman-1 -I/tmp/qemu-test/src/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -Wno-string-plus-int -Wno-typedef-redefinition -Wno-initializer-overrides -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/pixman-1 -I/tmp/qemu-test/src/tests -MMD -MP -MT tests/test-netfilter.o -MF tests/test-netfilter.d -fsanitize=undefined -fsanitize=address -g -c -o tests/test-netfilter.o /tmp/qemu-test/src/tests/test-netfilter.c
make: *** [/tmp/qemu-test/src/rules.mak:69: tests/hd-geo-test.o] Error 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]